Entries from 2012-01-01 to 1 year

Ruby 逆引き チュートリアル

Ruby逆引き http://www.namaraii.com/rubytips/ http://doc.ruby-lang.org/ja/1.9.3/doc/index.htmlチュートリアル http://www.ruby.or.jp/ja/tech/development/ruby/tutorial/020_data_type1.html データ型(数・文字列) 配列 ハッシュ 時刻 制御構造&例外…

Ether cable 圧着 自作

http://www.geekpage.jp/practical/utp/index.php

mount SMB

sudo apt-get install smbfssudo mount -t cifs -o username=ore,uid=ore,gid=ore //192.168.0.1/myfolder /mnt

URLの正規表現

URLの正規表現 ^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$

ubuntu 12.04 Requires installation of untrusted packages google-chrome-stable

gpg --keyserver keyserver.ubuntu.com --recv 6D975C4791E7EE5Egpg --export --armor 6D975C4791E7EE5E | sudo apt-key add -apt-get updateapt-get install google-chrome-stable

HTTP Header escape

irb> requre 'uri' irb> header="%xxxx%xxxx ... %xxxx" irb> URI.unescape(h)

proxy

http://www.cybersyndrome.net/country.html

unicorn sinatra short tutorial

http://spitfiresky.com/blog/getting-started-with-sinatra.html##NOTE Ruby 1.9.2 doesn't automatically include "." in the $LOAD_PATH. To workaround this, modify config.ru by stating require './sinatratestapp' instead of require 'sinatratesta…

jekyll

Jekyllは、ブログのような静的サイトを構築するためのRuby製ファイルジェネレータです。Jekyllはあくまでファイルジェネレータであり、Railsのように、コマンド一つでサイトの基礎を全部構築してくれるフレームワークではありません。むしろSinatraの思想に…

Unicorn

http://unicorn.bogomips.org/Unicorn/Configurator.htmlLighting fast, zero-downtime deployments with git, capistrano, nginx and Unicorn http://ariejan.net/2011/09/14/lighting-fast-zero-downtime-deployments-with-git-capistrano-nginx-and-unico…

Ruby Sinatra Padrino Server Deploy

Unicorn passenger Thin Mongrel nginx nginx or appache (webserver) ↓ Unicorn or passenger (Rack plugin for webserevr) ↓ ruby shotgun applicationhttp://blog.livedoor.jp/faulist/archives/1306666.html https://github.com/blog/517-unicorn http:/…

ネットワークLAN 全ての IP

$ for i in `seq 1 1 254` ; do ping -c 1 -w 50 192.168.0.$i ; done

NFC: Near field communication. RFID:Radio-frequency identification

as title

gmailでメール&添付ファイルを送る:mailパッケージを使い、tmailをつかわない。

Rubyでメールを扱うには、TMailの例が多いのですが、 tmailscanner.so: undefined symbol: rb_get_kcode みたいなエラーが出て動かない。rb_get_kcodeは1.9.2では存在してないらしく、gemパッケージのやつは1.8系でしかうごかない。無理をするなら、https://…

GMailを使ってメールを送信:Pitについて

すばらしい http://www.tamoot.net/d/20101222.html参考 http://d.hatena.ne.jp/GegegeMokeke/20070601 http://d.hatena.ne.jp/koseki2/20090328/rubymail http://doc.ruby-lang.org/ja/1.9.2/library/net=2fsmtp.html http://d.hatena.ne.jp/gakeno_ueno_ho…

Error: Postfix - mail for xxxxx.com loops back to myself

以下のエラーが出たら"Oct 7 10:19:01 ubuntuServer postfix/smtp[7860]: 3D8872009BB: to=, relay=none, delay=0.05, delays=0.04/0/0.01/0, dsn=5.4.6, status=bounced (mail for xxxxx.com loops back to myself)"Add xxxxx.com to the mydestination lin…

Postfixとdevocotの設定

https://help.ubuntu.com/community/Postfix https://help.ubuntu.com/community/Dovecot

Cron ターミナルでは動くのにcrontabでだめ等

基本的にはbash環境とcrontabの環境が違うのが問題http://d.hatena.ne.jp/satake7/20080615/p1 http://kazmax.zpp.jp/linux/lin_cron.html http://clown-do.ddo.jp/index.php?id=526 https://forums.ubuntulinux.jp/viewtopic.php?id=6926 https://discussio…

Skype4.0で複数のアカウントで同時ログインする方法

copy $HOME/.Skype to$HOME/.Skype.profile1 $HOME/.Skype.profile2skype dbpath=~/.Skype_profile1 skype dbpath=~/.Skype_profile2

mechanize encoding error : input conversion failed due to input error, bytes 0xFD 0xFE 0x2D 0x2D が出たときは

http://w.livedoor.jp/ruby_mechanize/d/Mechanize%3A%3APageフォーム送信をする場合は Mechanize は #encoding の返り値(この場合 UTF-8)に変換して送信しようとするので、一般的な Web ブラウザの挙動「なにもなければフォームの書かれたHTMLの文字エン…

Remote Desktop Protocol (RDP) server

すばらしい http://blog.loadlimits.info/2010/02/linux%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%A7%E4%BD%BF%E3%81%88%E3%82%8B%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E7%92%…

マルチスレッドプログラミング

すばらしい。 http://techracho.bpsinc.jp/piichan1031/2010_07_05/2030

全角文字を半角に直す。

zenkaku_moji.split('').map!{|s| s.tr('a-zA-Z0-9ー', 'a-zA-Z0-9-')}.join

padrino activerecord sqlite

padrino g project_name -t shoulda -e haml -c sass -s jquery -d activerecord -a sqlite -b

Padrinoチュートリアルtutorialでハマった。日本語・中国語訳ボランティアしますので連絡下さい!!!

Padrinoのチュートリアルでハマりました。Padrino自体は個人的にはweb業界では最大のヒット、RoRを凌駕するフレームワークだと感じているのですが、日本語訳(未完らしいが基本的には英語Doc本文も)初心者が致命的につまづきそうな部分があります。要するに…

geditをTextMate風に

http://blog.sudobits.com/2011/04/02/textmate-for-ubuntu-linux/

T0,T1, ip route, iprule

http://lartc.org/howto/lartc.rpdb.multiple-links.html

ppp のpid (process id)を調べる

cat /var/run/ppp0.pid

Route traffic via ppp0

Route traffic via ppp0To route traffic via PPP0 interface add following route command to /etc/ppp/ip-up.d/route-traffic # vi /etc/ppp/ip-up.d/route-trafficAppend following sample code (modify NET an IFACE as per your requirments): #!/bin/b…

wiki install

http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu/ja