2012年7月23日月曜日

vimでgitのブラウジングすると便利だよ


という話
gitvというプラグイン:Gitvコマンドからどうぞ

3方向マージ(3 way merge)もGdiffで一発

http://d.hatena.ne.jp/cohama/20120417/1334679297
http://yuku-tech.hatenablog.com/entry/20110427/1303868482

2012年7月19日木曜日

vimのプラグイン管理vundle

便利なのでメモ

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle


http://shu-cream.blogspot.jp/2011/04/2011vimvundle.html

2012年7月9日月曜日

opensslの確認コマンドまとめ

http://chinmai.net/~osakana/tech-memo/wiki.cgi?page=OpenSSL+CSR%2C+%BE%DA%CC%C0%BD%F1%A4%CA%A4%C9%B3%CE%C7%A7%A5%B3%A5%DE%A5%F3%A5%C9

Postfix⇒Gmailへのリレー設定

以下の設定でGoogleのSMTPを中継するようになる main.cf
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_tls_CAfile = /etc/postfix/ssl/cacert.pem
/etc/postfix/sasl_passwd
[smtp.gmail.com]:587 hoge@gmail.com:hogepasswd
以下のコマンドを忘れずに postmap sasl_passwd 参考リンク
http://linux.matchy.net/archives/35
http://stevejenkins.com/blog/2011/06/fixing-postfix-certificate-verification-failed-for-gmail-untrusted-issuer-error-message/
http://giantdorks.org/alain/fix-for-postfix-untrusted-certificate-tls-error/

2012年6月26日火曜日

gitでpushしたらpushした先でワーキングツリーをリセット

それhookで出来るよ

cd .git/hooks/
mv post-receive.sample post-receive
chmod +x post-receive
echo 'cd /home/hoge/huga/' >> post-receive
echo 'git --git-dir=.git reset --hard HEAD' >> post-receive

2012年6月23日土曜日

SSH力を身につけた


sshで繋いじゃった後でも
Enter押してすぐに
~Cでコンソール(helpコマンド使えるよ)
~#でフォワード一覧
~?でヘルプ

↓みたいに.ssh/config書けば多段がいけるらしい
Host humidai
 HostName hoge.co.jp
Host target
 ProxyCommand ssh -W 192.168.x.x:22 humidai


参考リンク
SSH力をつけよう

2012年6月16日土曜日

2012年6月9日土曜日

Linuxからリモートデスクトップ(RDP)

xfreerdpでいけます
apt-get install freerdp-x11

gitでbareじゃない共有リポジトリを作る

共有リポジトリだと作業フォルダが無くて不便なので

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[receive]
        denyCurrentBranch = ignore
コマンドならこう
git config --add receive.denyCurrentBranch ignore
参考リンク http://d.hatena.ne.jp/shokai/20101105/1288968082

2012年6月8日金曜日

Linuxデスクトップのガジェットとか

システムモニタ
・adesklets
・conky
・gdesklets

参考リンク
http://wikiwiki.jp/linux/?FrontPage
http://usamimi.info/~linux/

2012年6月4日月曜日

DebianでKVMを試してみた

こんな感じでDebian Wiki通りにやればOK
-cの後は/dev/cdrom or iso
virt-install -n testos -r 128 --disk path=/tmp/testos.dsk,size=10 --os-type=linux --network bridge=br0 --vncport=5900 --vnclisten=0.0.0.0 -c /tmp/debian.iso
あとはこんな感じでXサーバーにコンソールを出力させた
virt-viewer testos --display=192.168.0.5:0
仮想マシンの削除
virsh destroy testos2
virsh undefine testos2
参考リンク
http://docs.redhat.com/docs/ja-JP/Red_Hat_Enterprise_Linux/5/html/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html

brctlでブリッジインターフェイスを作成

KVMを使うときに必要になったブリッジインターフェイスの設定メモ コマンドでは以下のようにやればO
 brctl addbr br0
 brctl addif br0 eth0
/etc/network/interfaces
auto lo br0
iface lo inet loopback

allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1

iface br0 inet static
bridge_ports eth0
address 192.168.0.40
netmask 255.255.255.0
gateway 192.168.0.1
参考リンク
brctl でLinuxマシンをHUBにする - いますぐ実践! Linuxシステム管理 第2回 KVMの導入と基本的な使い方