LoginSignup
23
22

More than 3 years have passed since last update.

Cygwin環境構築メモ

Last updated at Posted at 2018-02-06

備忘用。

cygwinインストール

色々纏めてインストール。
モノはこちら

dosプロンプトで
setup-x86_64.exe ^
   --root c:\cygwin ^
   --local-package-dir %CD% ^
   --site http://ftp.iij.ad.jp/pub/cygwin/ ^
   --quiet-mode ^
   --packages Tcl, gcc, git, gnupg, inetutils, libiconv, libiconv-devel, libncurses-devel, libsqlite3-devel, libxml2-devel, libxslt-devel, make, openssl-devel, patch, readline, screen, vim, wget

apt-cygのインストール

apt-cygはパッケージ管理用のツール。
アプリケーションが簡単にインストールできるようになります。
Cygwinを立ち上げて、以下のコマンドでGitHubからスクリプトをダウンロードできます。

以下、cygwinのコンソール内で
# ↓正規版。開発終了したらしい。
wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
# 参照:https://github.com/transcode-open/apt-cyg/blob/master/status.md

# しょうがないから、一番commitが活発らしい↓を導入するといいかも
# https://github.com/kou1okada/apt-cyg
wget https://raw.githubusercontent.com/kou1okada/apt-cyg/master/apt-cyg

・実行権限をつけてPATHの通っている場所に置く

chmod 755 apt-cyg
mv apt-cyg /usr/local/bin/

・国内のリポジトリから更新するようにする

apt-cyg -m ftp://ftp.iij.ad.jp/pub/cygwin/ update

・apt-cygのプロキシ設定

InternetExplorerを立ち上げる → 「ツール」 → 「インターネットオプション」 → 「接続」 → 「LANの設定」 → 「詳細設定」
の設定と同様に c:\etc\wgetrc の以下を設定する。
※wgetの設定をすると、apt-cygも使えるようになる

# ↓コメント(#)をとる
#https_proxy = http://username:password@proxyhost:port
#http_proxy = http://username:password@proxyhost:port
#ftp_proxy = http://username:password@proxyhost:port

vimインストール

apt-cyg install vim

curl / unzip インストール

apt-cyg install curl unzip

gcc環境整備

apt-cyg install gcc-core
apt-cyg install gcc-g++

ping文字化け対策

apt-cyg install libiconv libiconv-devel inetutils  # 必要なパッケージのインストール
git clone http://github.com/vmi/cocot
cd cocot
./configure && make && make install

.bashrc

alias ll='ls -l --color=auto'
alias ping='cocot ping'
alias javac='javac -J-Dfile.encoding=UTF-8'
alias java='java -Dfile.encoding=UTF-8'

inetutils ( telnet )

apt-cyg install inetutils

expectインストール (Tclインストール・最新化済前提)

apt-cyg install expect

git

apt-cyg install git

(メモ)特定キーワードを持つファイル名のEXCELを現在パスにコピー

for a in <keyword>; do find <path> -name "*$a*.xlsx" | xargs -i cp {} . ; done

(メモ)JSON整形

echo '{"key1": "value1", "key2": {"key3": "value3"}}' | python -m json.tool
23
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
22