投稿

proxy突破方法まとめ

■ 現状把握。 プロキシサーバーとの通信確認コマンド netstat -aon | sks -Pattern ":60088" → 参考 Windows端末でプロキシ情報の取得方法 $ netsh $ show proxy ■ ブラウザで認証したくないとき Firefox 自動エントリー about:config signon.autologin.proxy = False   レジストリキーの編集 \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL には、おそらく http://proxy.yourdomain/parh/to/proxy.pac と記載されているので、このファイルの中身を見て、 return “PROXY proxy.yourdomain:8800”; を探し、 user, password 情報を追加する。 ■ 開発ツールでのProxy突破 $ python pip install $ pip install {パッケージ名} --proxy http://{ユーザ名}:{パスワード}@{ホスト名}:{ポート番号} $ curl --proxy http://proxy.example.com:8080 http://hoge.com $ git config --global http.proxy http://proxy.example.com:8080 ツールを使う。 stone を使う 最新64bit版 download HTTPortでファイアーウォール(プロキシ)を超えよう

pythonでEC2のリソースチェックする(AWS APIを利用) on CentOS

前提 aws cliをインストール( Installing the AWS CLI )して、aws configureは設定しておく。 aws configureしておく。( What Is the AWS Command Line Interface? ) vagrantを使ってのインストールは前回の( ココ )を参照 やること 1. boto3のインストール 1. boto3のインストール # インストール $ pip install boto3 # バージョン確認 $ pip freeze | grep boto3 boto3==1.14.12 すべてのインスタンスの起動、停止 ec2_status.py #!/usr/bin/env python3 import sys import logging import boto3 import botocore from ec2.check import EC2_Instance_Check # ログレベル設定 logging.basicConfig(level=logging.INFO) ''' # ログ群 logging.critical('critical') logging.error('error') logging.warning('warning') logging.info('info') logging.debug('debug') ''' class RDS_Instance_Check: rds = None def __init__(self): self.rds = boto3.client('rds') def get_tags_for_db(self, db): try: logging.debug("get_tags_for_db start") instance_arn = db['DBInsta...

CentOS7.8にWordpressをインストールする

やること。 php7.2のインストール MySQLのインストール Apache起動 Wordpressインストール 1. php7.2のインストール やること。 # リポジトリ追加 $ yum -y install epel-release $ yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # リポジトリ確認 $ ls -l /etc/yum.repos.d/ total 96 ----------------------- -rw-r--r--. 1 root root 456 Feb 18 01:07 remi-php54.repo -rw-r--r--. 1 root root 1314 Feb 18 01:07 remi-php70.repo -rw-r--r--. 1 root root 1314 Feb 18 01:07 remi-php71.repo -rw-r--r--. 1 root root 1314 Feb 18 01:07 remi-php72.repo -rw-r--r--. 1 root root 1314 Feb 18 01:07 remi-php73.repo -rw-r--r--. 1 root root 1314 Feb 18 01:07 remi-php74.repo -rw-r--r--. 1 root root 750 Feb 18 01:07 remi-safe.repo -rw-r--r--. 1 root root 2605 Feb 18 01:07 remi.repo # php7.4をインストール $ yum -y install httpd php74 php74-php php74-php-mysqlnd 2. MySQLのインストール # リポジトリインストール $ yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm # リポジトリ確認 $ ls -l /etc/yum.repos.d/ | grep mysql -rw-r--r--. 1 root root 1036...

Vagrant upでVirtualBox Guest Additions: Kernel headers not found for target kernel Error

Vagrant UPするといきなりエラー発生。 The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! /usr/sbin/rcvboxadd setup Stdout from the command: VirtualBox Guest Additions: Starting. VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while. VirtualBox Guest Additions: To build modules for other installed kernels, run VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup &lt version &gt VirtualBox Guest Additions: or VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all VirtualBox Guest Additions: Kernel headers not found for target kernel 3.10.0-1127.13.1.el7.x86_64. Please install them and execute /sbin/rcvboxadd setup Stderr from the command: modprobe vboxguest failed The log file /var/log/vboxadd-setup.log may contain further information. まず、記載されているKernelをInstallする。 「Kernel headers not found for target kernel 3.10.0-1127.13.1.el7.x86_64.」これですね。 $ yum -y ...

CentOS7で利用するVagrantFileのまとめ

CentoOS環境で利用するVagrantFileを整理しておく。 VagrantFileは以下の通り。 Vagrantで生成したCentOSのバージョン確認 $ cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) VagrantFileは以下の通り。 virtualenvインストール用shell $virtualenv = <<SHELL if ! type /usr/local/bin/virtualenv > /dev/null 2 > &1; then # echo $PATHは以下の結果となり、/usr/local/binは含まれていない。 # /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin yum update yum install -y python3 pip3 install virtualenv # vagrantユーザとしてvirtualenvとansibleをインストール su -c "source /vagrant/provision/bash/install_ansible.sh" vagrant # vagrantユーザとしてaws apiをインストール su -c "source /vagrant/provision/bash/install_awsapi.sh" vagrant fi SHELL Vagrant.configure("2") do |config| config.vm.box = "bento/centos-7" config.vm.box_version = "202006.16.0" config.vm.network "private_network", ip: "192.168.33.10" config.vm.provider "virtualbox" do |vm| # vm name vm.n...

Ansibleを使ってVagrant上にmssqlserverを構築する

Ansibleを使ってVagrant上にmssqlserverを構築する。 基本、 ここのサイト をもとに勉強していますが、GuestAdditionsの競合回避のため、CentoOSは最新の7.8を使いました。 勉強もとのサイトのサンプルコードと異なる箇所のみ記載していきます。 大きな違いは、サンプルコードは、python3.7をインストールしていますが、CentOS7.8ではすでにインストール済であることです。 事前準備 プラグインのインストール vagrant-vbguestは、ホストOSとゲストOSのGuestAdditionsのバージョンを自動で合わせてくれるVagrantのプラグインです。 ホストとゲスト間で フォルダー を 共有 するには「 Guest Additions 」が必要です。 今回は、競合しないよう最新のViertualBoxとCentoOSを使いますが一応入れておく。 $ vagrant plugin install vagrant-vbguest ※不要な場合はVagrantfileでconfig.vbguest.auto_update = falseすること。 今回は、CentOSの最新版 config.vm.box = "bento/centos-7" config.vm.box_version = "202006.16.0" を使うことでhost側と差異がでないようにした。 ( vagrant cloud centos7 ) vagrant up後のバージョン確認 $ cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core)   ansible構成作成 Vagrantファイル作成 # ansibleインストール用shell $ansible_install = < /dev/null 2>&1; then yum install -y python3 pip3 install virtualenv # vagrantユーザとしてvirtualenvとansibleをインストール su -c "source /vagrant/provisio...

Gitサーバを構築する(Ubuntu18.04)

Docker上のUbuntuにGitサーバを立てて使ってみる。 ここ( GitLab Official Linux Package )に沿ってインストールしていく。 1. Install and configure the necessary dependencies サーバ側にgitをインストール $ sudo apt install git $ git --version git version 2.17.1 $ sudo apt install curl openssh-server ca-certificates $ sudo apt install postfix Satellite system: All mail is sent to another machine, called a 'smarthost', for delivery. Local only: The only delivered mail is the mail for local users. There is no network. 1. No configuration 2. Internet Site 3. Internet with smarthost 4. Satellite system 5. Local only General type of mail configuration: 5 .............. .............. System mail name: test@gitserver.jp 2. Add the GitLab package repository and install the package GitLabのrepositoryを追加しInstall # Repositoryの追加とgitlabのインストール $ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash $ sudo apt install gitlab-ce # gitlabの設定 $ sudo vim /etc/gitlab/gi...