hasen's tech life

Twitter: @hasen

Received disconnect from port 22:2: too many authentication failures というエラーが出たので対応した.

Git

$ git fetch -p > Received disconnect from port 22:2: too many authentication failures > Authentication failed. > fatal: Could not read from remote repository. > > Please make sure you have the correct access rights > and the repository exi…

# bundlerでエラーが出たので対応した.

# bundlerでエラーが出たので対応した. # Ruby $ ./bin/bundle i An error occurred while installing nokogiri (1.6.8.1), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.6.8.1' --source 'https://rubygems.org/'` succeeds …

# 新しいMacの環境構築でいろいろとエラーが出たので対応した.

# 新しいMacの環境構築でいろいろとエラーが出たので対応した. # Vim $ vi hoge dyld: Library not loaded: /usr/local/opt/perl/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE/libperl.dylib Referenced from: /usr/local/bin/vim Reason: image not …

HomebrewでPHPを7.1から7.2にアップデート.

# HomebrewでPHPを7.1から7.2にアップデート. $ brew unlink php@7.1 $ brew link php@7.2 $ echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile $ echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile $ …

CentOS7にPostgre9.5をインストールした

# CentOS7にPostgre9.5をインストールした. $ wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm $ sudo rpm -ivh pgdg-centos95-9.5-2.noarch.rpm $ sudo vi /etc/yum.repos.d/pgdg-95-centos…

nginxでWordPressのプラグインSiteGuardを利用する.

# nginxでWordPressのプラグインSiteGuardを利用する. # confファイルでリライトする. rewrite ^/wp-signup\.php$ 404-siteguard break; rewrite ^/wp-activate\.php$ 404-siteguard break; rewrite ^/your_login_url(.*)$ wp-login.php$1 break; $ sudo c…

bundle installでエラーが出たので対応した.

# bundle installでエラーが出たので対応した. $ ./bin/bundle i Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /PATH/TO/vendor/bundle/ruby/2.5.0/gems/mysql2-0.5.2/ext/mysql2 checking for rb_absint_size(…

Let's EncryptのSSL認証更新でエラーがでたので対応した.

# Let's EncryptのSSL認証更新でエラーがでたので対応した. $ sudo /usr/bin/certbot-auto renew --force-renew > The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-inte…

EC2のディスクを拡張する.

AWS

# EC2のディスクを拡張する. $ lsblk > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT > xvda 202:0 0 30G 0 disk > └>─ xvda1 202:1 0 30G 0 part / $ df -h > ファイルシス サイズ 使用 残り 使用% マウント位置 > devtmpfs 7.9G 56K 7.9G 1% /dev > tmpfs 7.…

Metabaseの起動でエラーがでたので対応した.

# Metabaseの起動でエラーがでたので対応した. $ java -jar metabase.jar > ERROR impl.StdSchedulerFactory :: Couldn't generate instance Id! 名前またはサービスが不明です # AWSのコンソール画面で VPC Dashboard -> DNS resolution|hostnamesをEnable…

検証用にphpenvでv5.6.38をinstallしたときに必要だったライブラリ.

# 検証用にphpenvでv5.6.38をinstallしたときに必要だったライブラリ. sudo yum install -y gcc sudo yum install -y gcc-c++ sudo yum install -y re2c sudo yum install -y libmcrypt-devel sudo yum install -y autoconf sudo yum install -y automake s…

MySQLのインストールに失敗したので対応した.

# MySQLのインストールに失敗したので対応した. # なにかで過去にインストールしたが使っていないとのことで削除した.(ひとの環境) $ brew reinstall mysql@5.7 > --initialize specified but the data directory has files in it. Aborting. > [ERROR] Ab…

MetabaseをEC2にインストールした

# MetabaseをEC2にインストールした. # Elastic Beanstalkを使わずにそのまま入れた.# 注意事項はRDSのAvailability zoneと揃える,MySQLなどクライアントをインストールしておく.# tail -f nohup.outして,metabaseが立ち上がったのを確認してからiptabl…

ERROR 3144 (22032) at line 206: Cannot create a JSON... というエラーが出たので対応した

# ERROR 3144 (22032) at line 206: Cannot create a JSON value from a string with CHARACTER SET 'binary' $ vi hoge.sql — /*!40101 SET NAMES binary */; ++ /*!40101 SET NAMES utf8mb4 */;

Unable to autoload constant XxxController... と出力されたので対応した.

# Unable to autoload constant XxxController... と出力されたので対応した. # タイポ.... Unable to autoload constant XxxController, expected /PATH/TO/app/controllers/yyy_controller.rb to define it $ vi app/controllers/yyy_controller.rb -- Xx…

confファイルのリダイレクト処理とか,検索せずサラッと書きたい.

# confファイルのリダイレクト処理とか,検索せずサラッと書きたい. > Redirect /old https://new.page

# Reason: Incompatible library version: RMagick2.bundle requires version 7.0.0 or laterというエラーが出たので対応した.

# Reason: Incompatible library version: RMagick2.bundle requires version 7.0.0 or laterというエラーが出たので対応した. $ ./bin/rake db:migrate > rake aborted! > Reason: Incompatible library version: RMagick2.bundle requires version 7.0.0 …

MacにVirtualBoxをインストールできなかったので対応した.

# MacにVirtualBoxをインストールできなかったので対応した. # エラー # System Prefarences > Security & Privacy -> Generalから設定を調整した.

Gem Load Error is: This installation of RMagick was configured with ImageMagick 6.9.9 but ImageMagick 6.9.10-6 is in use.というエラーがでたので対応した.

# Gem Load Error is: This installation of RMagick was configured with ImageMagick 6.9.9 but ImageMagick 6.9.10-6 is in use.というエラーがでたので対応した. $ ./bin/bundle .... > Gem Load Error is: This installation of RMagick was configure…

Error starting host: Error getting state for host: machine does not existとでたので対応した.

# Error starting host: Error getting state for host: machine does not existとでたので対応した. $ minikube start > Error starting host: Error getting state for host: machine does not exist $ minikube delete $ minikube start

ERROR! The server quit without updating PID fileというエラーが出たので対応した.

# ERROR! The server quit without updating PID fileというエラーが出たので対応した. # brew upgradeしたことでバージョンが変わっていることが原因だった. $ mysql.server start > .. ERROR! The server quit without updating PID file (/usr/local/va…

# kubectlでログを確認する.

# kubectlでログを確認する. $ kubectl get cronjobs $ kubectl get jobs $ kubectl describe job XXXXXXXX

Laravelでリダイレクトで画面が切り替わるたびに'HTTP/1.0 302 Fountd Cache-Control: no-cache, private Date: ...'と表示されるので修正した.

# Laravelでリダイレクトで画面が切り替わるたびに'HTTP/1.0 302 Fountd Cache-Control: no-cache, private Date: ...'と表示される. 戻り値の型指定がstringになっていたのでRedirectResponseに変更した。

# composerで'proc_open(): fork failed - Cannot allocate memory'というエラーが出たので対応した.

# composerで'proc_open(): fork failed - Cannot allocate memory'というエラーが出たので対応した. $ composer require google/apiclient > ... > PHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/ve…

構成管理の更新を自動化する.

# 構成管理の更新を自動化する. $ sudo yum install -y yum-cron.noarch $ sudo vi /etc/yum/yum-cron.conf -- apply_updates = no ++ apply_updates = yes $ sudo service yum-cron start $ sudo chkconfig yum-cron on

KubernetesでCronJobを登録したので,実行を確認.

# KubernetesでCronJobを登録したので,実行を確認.$ kubectl get cronjob$ kubectl describe cronjob NAME-SPACE$ kubectl delete cronjob NAME-SPACE$ kubectl get jobs $ kubectl describe job NAME-SPACE-XXXXXXXXXXXX $ kubectl logs NAME-SPACE-XXXXX…

AWS Certificate Managerで認証手続きを行う.

AWS Certificate Managerで認証手続きを行う. フォームには「*.xxxx.xxxx」の形式で入力 nextをクリック. DNS validationを選択. Reviewをクリック. Confirm and Requestをクリック. Name(サブドメ部分のみ), CNAME, Value(最後のドット以外)をドメイン…

IP tablesの特定のルールを削除する.

# IP tablesの特定のルールを削除する. $ sudo iptables -t nat -L --line-numbers $ sudo iptables -t nat -D PREROUTING NUMBER (NUMBERだけ変える)

EC2にTomcatをインストールする.

# EC2にTomcatをインストールする. $ sudo yum -y install java-1.7.0-openjdk-devel $ sudo yum install tomcat7 tomcat7-webapps $ sudo service tomcat7 start $ sudo chkconfig tomcat7 on $ sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j …

テスト環境にアクセス出来ない時,IP制限がかかっていないか確認する.

AWS

# テスト環境にアクセス出来ない時,IP制限がかかっていないか確認する. (制限をかけたのは自分...)