Entries from 2015-10-01 to 1 month

Ubuntu USB Drive Mount 接続

Open "Disk Utility", and look for your device, and click on it. This will let you be sure you know the correct filesystem type and device name for it. In my case, it was 'ext4' and '/dev/sdb1' respectively. Next: Decide what you want to ca…

Ubuntu selenium-webdriver

Gemsgem install headless gem install selenium-webdriver使い方require "selenium-webdriver" require 'headless'headless = Headless.new headless.start driver = Selenium::WebDriver.for :chrome driver.navigate.to "http://google.com"element = dri…

Ruby/Tk ウィンドウを消した後でも Ruby の処理は続けたい場合 destroy exit

http://www.mnet.ne.jp/~tnomura/tksample.html http://ronor.web.fc2.com/rubytk/require 'tk'name = ''TkLabel.new(nil, 'text'=>'Put your name below.').pack entry = TkEntry.new.pack TkButton.new(nil, 'text'=>'OK', 'command'=>proc{ name = entry.…

Ruby/Tk can't fork

Ruby/Tk does NOT support forking the process on which Tk interpreter is running (unless NEVER control Tk interpreter under the forked child process). In the library 'tk.rb', a Tk interpreter is initialized. Therefore, if you want running T…

Ruby/Tk can't fork

Ruby/Tk does NOT support forking the process on which Tk interpreter is running (unless NEVER control Tk interpreter under the forked child process). In the library 'tk.rb', a Tk interpreter is initialized. Therefore, if you want running T…

ubuntu 12.04 rmagick

$ sudo apt-get install imagemagick $ sudo apt-get install libmagickwand-dev$ gem install rmagick

Ruby/Tk RMagick

気がついたことrmagickは - 画像処理するもので、その表示位置をデスクトップや他のXserver上の表示位置をコントロールするものではない。例えば そういうときはTcl/Tkを使う。tkは - rbenv,rvmでつにねに現在使っているrubyの再コンパイルが必要。要するに…

ubuntu 12.04 ruby 2.1 rvm Ruby/Tk 動かない

http://futurismo.biz/archives/2226$ sudo apt-get remove tk-dev $ sudo apt-get install tk8.4-dev tcl8.4-dev$ sudo ln -sfn /usr/lib/tcl8.4/tclConfig.sh /usr/lib/tclConfig.sh $ sudo ln -sfn /usr/lib/tk8.4/tkConfig.sh /usr/lib/tkConfig.sh$ rvm…

ruby/Tk auto close root automatically

require 'tk'TkRoot.new {geometry '300x200+100+100'} TkAfter.new(3000, # milliseconds 1, proc{exit} # what to call when the timer expires ).startTk.mainloop

ubuntu 14.04 ruby 2.2 rvm Ruby/Tk 動かない

http://stackoverflow.com/questions/20874900/ruby-require-tk-yields-loaderror-no-such-file-to-load-tk http://5zalt.hatenablog.com/entry/2015/02/12/124228 $ sudo apt-get install tk-dev $ rvm reinstall ruby-2.2-head --with-tcltkversion=8.6 --…

ubuntu12.04 printer network ファイアウォールデーモンが起動していません

http://qiita.com/iberianpig@github/items/826809e978965d1a03a2FireWall使ってないので、どうやらこれはバグらしい。$ system-config-printerをTerminalで入力すると、以前のGUIが立ち上がる。

unicorn sinatra non-modular app inline __END__

http://stackoverflow.com/questions/15639998/sinatra-via-rackup-does-not-like-inline-templates https://github.com/rstacruz/nanomonk/blob/master/vendor/sinatra-1.0/README.jp.rdocenable :inline_templates bundle exec unicorn_rails --path /notM…

mechanize submit encode フォーム送信 エンコード・デコードツール、request header 確認ツール

mechanizeでフォーム送信すると期待されたエンコードで送信されない事がある。送信結果が文字化けしてしまう。 以下の条件に当てはまるウェブページで起こる。 - HTML 中に meta 要素の charset が存在しない - レスポンスヘッダのContent-Typeにもcharsetが…