Entries from 2012-06-01 to 1 month

Ubuntu 12.04 Gnome3 disable screen saver

gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

mechanize proxy

a.set_proxy 'localhost', 4128

Ethernet Card の番号を変える eth0, eth1...

edit /etc/udev/rules.d/70-persistent-net.rules SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:81:5a:fa", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Networkmanager indicator missing

sudo nano /etc/NetworkManager/NetworkManager.conf"managed=false" → "managed=true"killall nm-appletand then reboot.

Nesta Heroku App Git upload key

http://nestacms.com/docs/deployment/heroku https://devcenter.heroku.com/articles/renaming-apps#manually_updating_a_git_remote $ heroku create --stack bamboo-mri-1.9.2 Enter your Heroku credentials. Email: ,(Herokuアカウント名) Password (ty…

Yahoo Japan エンコード mechanize/open-uri

YJのページのヘッダーによるとエンコードはEUC-JPと言うことなのでrequire 'mechanize' eucBody=a.get(uri){|page| page.encoding="EUC-JP"}.body page = Nokogiri::HTML( NKF.nkf('--utf8 --euc-input', eucBody) )としていたが、上手く行かない(上記pageが…

文字エンコーディング

またぞろきたももんがさん師匠の受け売りです。http://d.hatena.ne.jp/kitamomonga/20081209/kaisetsu_for_ver_0_9_ruby_www_mechanize http://jp.rubyist.net/magazine/?0009-BundledLibraries#l15Mechanize は meta charset やレスポンス HTTP ヘッダの Co…

jQuery クリックされた自分or親elementを探す

$(document).ready(function() { $("#example div").click(function() { var index = $(this).index(); $("#example_index").html("Index " + index + " was clicked"); }); });ーーーーーーーーーーーーーーーーーー$("*", document.body).each(function ()…

jQuery 小技 Toggle セレクタ

$(elem).prop("disabled",!$(elem).prop("disabled"))if($(this).prop('value')=='変更'){$(this).prop('value','確定')}else{$(this).prop('value','変更')}$('#play_button_id').toggle(play,play_pause)http://allabout.co.jp/gm/gc/24187/2/ http://alla…

Sinatraのapp_root

http://d.hatena.ne.jp/foosin/20090613/1244917528start.rbにMVCの全てを詰め込む事もできるが、やはりMVCのそれぞれでファイルを分けたい。sinatraではMVC的なファイルの配置は、ビュー以外は用意されていない。アプリケーションルート(以後 $APP_ROOTと…

Sinatra Haml jQuery example

http://shokai.org/blog/archives/5610 http://shokai.org/blog/archives/6029 http://youichi-kato.cocolog-nifty.com/blog/2009/08/sinatra-haml-sa.html http://youichi-kato.cocolog-nifty.com/blog/2009/08/sinatra-haml--1.htmlSinatraでちょいTwitter…

Cappuccino and Cocoa

web applications that look and feel like desktop applicationshttp://cappuccino.org/ http://www.exampler.com/blog/2011/12/17/tdd-workflow-sinatra-haml-jquery-part-1/ The Cocoa and Cocoa Touch frameworks that power Mac OS X and iOS are tight…

Serialport-server USB

毎度橋本商会さんすごいです。http://shokai.github.com/serialport-server/ http://shokai.org/blog/archives/6009

Ubuntu LAN上の使用中IPアドレスを一斉調査する

sudo arp-scan --interface=eth1 192.168.2.0/24

Ubuntu 12.04 Gnome3 System tray missing!

Alt-RightClickで"Add to Panel"更にNotificationAreaでskype,HPLIP,InputMethodが戻ってきます。またはsudo apt-get install sni-qt:i386

Wake on LAN wol設定

http://d.hatena.ne.jp/pochio_pochiyama/20110620/p2 http://d.hatena.ne.jp/ichiro_tanaka/20090505/1241530936 https://help.ubuntu.com/community/WakeOnLan http://www.intel.com/jp/support/motherboards/desktop/sb/CS-022309.htmWOLで起動したいマシ…

Ubuntu 12.04 ruby1.9.3p0 mechanize 2.5.1 Yahoo文字化け

特に最新の組み合わせを指向した分けではないが、新規のubuntuサーバーを建てるために12.04を採用したために全て: ubuntu11.04 ->12.04 ruby1.9.2p180 ->1.9.3p0 mechanize2.1 ->2.5.1 になった。その途端にmechanizeで今まで正常に動いていたYahooJapanへ…