PythonによるAmazonS3へのバックアップスクリプト
@ghawkguがPythonで動くAWSのAPI"boto"を教えてくれたので、自分用のgitリポジトリのバックアップのために書いた。
botoをインストールしてから、cronに日次で設定するだけ。デフォルト7ファイルでロテートする。
botoをインストールしてから、cronに日次で設定するだけ。デフォルト7ファイルでロテートする。
上海見聞録、Java考察、ハイテク関連などを中心として日々の思いをぶちまけます。
./conv4kindle.sh KVS_Introduction_v1_2.pdfするとKVS_Introduction_v1_2.zipみたいのができるので、KindleのPicturesフォルダへコピーする。
sudo apt-get install compizconfig-settings-managerその後、システム設定からCompizConfig Settings Managerを開く。Advanced Searchの検索ボックスでキーボードのアイコンをクリックして"F10"キーを押下する。

apt-get install openvpn udev dnsmasq設定ファイル /etc/openvpn/easy-rsa/2.0/vars を適宜修正
cp -R /usr/share/doc/openvpn/examples/easy-rsa/ /etc/openvpn
export KEY_COUNTRY="US"サーバ証明書、鍵の構築
export KEY_PROVINCE="JP"
export KEY_CITY="Tokyo"
export KEY_ORG="makino-style.org"
export KEY_EMAIL="******@example.com"
cd /etc/openvpn/easy-rsa/2.0/クライアント証明書、鍵の構築
. /etc/openvpn/easy-rsa/2.0/vars
. /etc/openvpn/easy-rsa/2.0/clean-all
. /etc/openvpn/easy-rsa/2.0/build-ca
. /etc/openvpn/easy-rsa/2.0/build-key-server server
. /etc/openvpn/easy-rsa/2.0/build-key client1client1は適当な名前を設定してOK
. /etc/openvpn/easy-rsa/2.0/build-dh後でクライアントへDLしておくべきファイルは以下3つ
ca.crtopenvpnサーバ起動に必要な証明書、鍵を移動
client1.crt
client1.key
cd /etc/openvpn/easy-rsa/2.0/keysサンプル設定ファイルをコピー
cp ca.crt ca.key dh1024.pem server.crt server.key /etc/openvpn
cd /usr/share/doc/openvpn/examples/sample-config-files以下は、一部linodeドキュメントとは異なる設定。 /etc/openvpn/server.conf の設定を編集、ポートの変更、pushのコメントアウト。
gunzip -d server.conf.gz
cp server.conf /etc/openvpn/
port 1199※ ちなみにdhcp-optionは最初のdnsmasqのインストールが必須なので注意。
push "redirect-gateway def1"
push "dhcp-option DNS 10.8.0.1"
/etc/init.d/openvpn restart先程のクライアント用のファイルをローカルで取得して接続テストする。接続ができたらいったん切断して下記のルーティングの設定にうつる。
# 設定確認
pear config-get http_proxy
# XXXXX:xxxxを設定
pear config-set http_proxy XXXXX:xxxx
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit
sudo apt-get install phpunit# 阿呆になりますな・・・
sudo apt-get install php5-dev php5-curl libcurl4-gnutls-devlibpcre3-dev
wget http://pecl.php.net/get/oauth-1.0.0.tgz
tar xvzf oauth-1.0.0.tgz
cd oauth-1.0.0
--- oauth.c 1970-01-01 09:13:08.000000000 +0000
+++ ../oauth.c.patched 2011-03-31 09:58:49.225640423 +0000
@@ -1185,6 +1185,9 @@
}
curl_easy_setopt(curl, CURLOPT_URL, url);
+ // Proxy Settings
+ curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
+ curl_easy_setopt(curl, CURLOPT_PROXYPORT, "13128");
/* the fetch method takes precedence so figure it out after we've added the OAuth params */
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, http_method);
patch < ./oauth_with_proxy.patch
phpize
./configure
make
sudo apt-get install php-pearphp5-dev php5-curl libcurl4-gnutls-dev libpcre3-dev
sudo pecl install oauth-1.0.0