2017年1月7日土曜日

cygwinでansibleインストール時に「 /usr/include/sys/time.h:104:34: エラー: 不明な型名 'u_int' です」のエラー解決方法

cyginでansibleをインストールしたら、以下のエラーが出来ました
 /usr/include/sys/time.h:104:34: エラー: 不明な型名 'u_int' です

解決方法は、ファイル「/usr/include/sys/time.h」に「u_int」の定義を追加すること

vi /usr/include/sys/time.h


#ifndef u_int
typedef unsigned int u_int;
#endif

cygwinにsshpassを入れる手順

Step1、まずダウンロード用ディレクトリーを作成
   mkdir -p /usr/local/src

Step2、Step1で作成したディレクトリーに移動
   cd /usr/local/src

Step3、sshpassのソースファイルをダウンロードする
   wget "https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz/download" -O sshpass.tar.gz

Step4、ダウンロードしたファイルを解凍
    tar xvfz sshpass.tar.gz

Step5、手動でコンパイルとインストールする
   cd sshpass-1.06
  
  ./configure
  make
  make install

    
Step6、バージョン確認
 sshpass -V


リモート windowsを再起動させる方法

リモート接続の場合は、「Start Menu」が操作できない状態となっています。

リモートマシンを再起動されるには、便利なコマンドがあります。
以下のコマンドを実行すれば、すぐ再起動できます。

shutdown -t 0 -r -f

-t 0:0秒後にシャットダウン
-r: 再起動
-f: アプリを強制的に停止