2011年9月30日金曜日

Ruby + Watir

Watir でChromeを自動操作したいのだが

$ gem install watir-webdriver
Fetching: json_pure-1.6.1.gem (100%)
Fetching: rubyzip-0.9.4.gem (100%)
Fetching: ffi-1.0.9.gem (100%)
Building native extensions. This could take a while...
Fetching: childprocess-0.2.2.gem (100%)
Fetching: selenium-webdriver-2.7.0.gem (100%)
Fetching: watir-webdriver-0.3.4.gem (100%)
Successfully installed json_pure-1.6.1
Successfully installed rubyzip-0.9.4
Successfully installed ffi-1.0.9
Successfully installed childprocess-0.2.2
Successfully installed selenium-webdriver-2.7.0
Successfully installed watir-webdriver-0.3.4
6 gems installed
Installing ri documentation for json_pure-1.6.1...
Installing ri documentation for rubyzip-0.9.4...
Installing ri documentation for ffi-1.0.9...
Installing ri documentation for childprocess-0.2.2...
Installing ri documentation for selenium-webdriver-2.7.0...
Installing ri documentation for watir-webdriver-0.3.4...
Installing RDoc documentation for json_pure-1.6.1...
Installing RDoc documentation for rubyzip-0.9.4...
Installing RDoc documentation for ffi-1.0.9...
Installing RDoc documentation for childprocess-0.2.2...
Installing RDoc documentation for selenium-webdriver-2.7.0...
Installing RDoc documentation for watir-webdriver-0.3.4...
$ irb

ruby-1.9.2-p290 :001 > require 'watir-webdriver'
=> true
ruby-1.9.2-p290 :002 > browser = Watir::Browser.new(:chrome)
Selenium::WebDriver::Error::WebDriverError: Unable to find the chromedriver executable. Please download the server from http://code.google.com/p/chromium/downloads/list and place it somewhere on your PATH. More info at http://code.google.com/p/selenium/wiki/ChromeDriver.
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/chrome/service.rb:18:in `executable_path'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/chrome/service.rb:28:in `default_service'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/chrome/bridge.rb:12:in `initialize'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/driver.rb:35:in `new'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/driver.rb:35:in `for'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver.rb:81:in `for'
from /home/nakamura/.rvm/gems/ruby-1.9.2-p290/gems/watir-webdriver-0.3.4/lib/watir-webdriver/browser.rb:35:in `initialize'
from (irb):2:in `new'
from (irb):2
from /home/nakamura/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `
'
ruby-1.9.2-p290 :003 >

UbuntuSutdio 11.04 PPAからLowLatencyカーネルを導入する

Ubuntu Studio に関するTips/セットアップ/カーネルについて
の通り、PPAからLowLatencyカーネルを導入しました。
$sudo add-apt-repository ppa:abogani/ppa
$sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com F141B61E
$sudo apt-get update
$sudo apt-get install linux-lowlatency
$ uname -a
Linux ubuntu 3.0.0-12-lowlatency #19ppa1~natty1-Ubuntu SMP PREEMPT Mon Sep 26 07:57:09 UTC 2011 i686 i686 i386 GNU/Linux

UbuntuStudio 11.04 + rvm + ruby1.9.2

次のサイトを参考に入れました。
(Ubuntu)(Ubuntu11.04)(ruby)(rvm)(Ubuntu 11.04 に rvm で ruby のマルチバージョン環境を構築してみた)
[Ubuntu11.04]RVMを導入しRuby1.9をインストール

$sudo apt-get update
$sudo apt-get install aptitude
$sudo aptitude update
$sudo aptitude install git-core curl
$bash < <(curl -s https://rvm.beginrescueend.com/install/rvm )
一旦端末を終了してもう一度起動する
$rvm notes
$sudo aptitude install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
$rvm list known
$rvm install 1.9.2
$rvm use 1.9.2 --default
$sudo ln -s ~/.rvm/bin/ruby /usr/bin/
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]


2011年9月25日日曜日

cpuburn cpuに高負荷を掛けて試験


synapticでインストール











$cat /usr/share/doc/cpuburn/README
N E W burnK7 for the AMD Athlon/Duron has been released.

These programs are designed to load x86 CPUs as heavily as possible for
the purposes of system testing. They have been optimized for different
processors. FPU and ALU instructions are coded an assembler endless loop.
They do not test every instruction. The goal has been to maximize heat
production from the CPU, putting stress on the CPU itself, cooling
system, motherboard (especially voltage regulators) and power supply
(likely cause of burnBX/MMX errors).

burnP5 is optimized
for Intel Pentium w&w/o MMX processors
P6 is for Intel PentiumPro, PentiumII&III and Celeron CPUs
K6 is for AMD K6 processors
K7 is for AMD Athlon/Duron processors
MMX is to test cache/memory interfaces on all CPUs with MMX
BX is an alternate cache/memory test for Intel CPUs

GKrellM システムモニタ







Lubuntu Software Centerから
GKrellM システムモニタをインストール

2011年9月18日日曜日

GSmartControl ハードディスクの監視










Synoapitic package managerでGSmartcontrolをインストール

MSI 865G Neo2 + Lubuntu + lm-sensors

lm-sensors でのメモ
Synoapitic package managerでlm-sensorsをインストール
$sudo sensors-detect
(再起動)
/etc/modulesに下記が追加された
# Generated by sensors-detect on Sun Sep 18 12:47:57 2011
# Chip drivers
w83627hf
(再起動)
$sudo sensors
sensorsの内容が表示されず、sensors-detectしなおせ・・・
(Linux) Ubuntu 9.10 kernel 2.6.31でlm-sensorsから情報取得できない
を参考に
/etc/default/grubを変更した。
(前)#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
(後)GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_enforce_resources=lax"
$sudo update-grub
(再起動)
~$ sensors
w83627hf-isa-0290
Adapter: ISA adapter
in0: +1.34 V (min = +0.00 V, max = +4.08 V)
in1: +1.34 V (min = +0.00 V, max = +4.08 V)
in2: +3.38 V (min = +2.82 V, max = +3.79 V)
in3: +3.01 V (min = +0.51 V, max = +0.51 V) ALARM
in4: +3.10 V (min = +2.18 V, max = +0.05 V) ALARM
in5: +0.58 V (min = +0.00 V, max = +2.08 V)
in6: +0.86 V (min = +1.44 V, max = +1.04 V) ALARM
in7: +3.23 V (min = +0.00 V, max = +0.00 V) ALARM
in8: +3.04 V (min = +2.18 V, max = +0.00 V) ALARM
fan1: 3375 RPM (min = -1 RPM, div = 8) ALARM
fan2: 1687 RPM (min = 21093 RPM, div = 8) ALARM
fan3: 0 RPM (min = 84375 RPM, div = 8) ALARM
temp1: +37.0°C (high = +2.0°C, hyst = +1.0°C) ALARM sensor = thermistor
temp2: +53.0°C (high = +120.0°C, hyst = +115.0°C) sensor = diode
temp3: +62.5°C (high = +120.0°C, hyst = +115.0°C) sensor = thermistor
cpu0_vid: +0.000 V
beep_enable:enabled

ALARMは/etc/sensors3.conf が未編集のまま

wine + java + LimeZilla










LimeZilla downloadをする。

$wine limezilla-setup.exe

LimeZillaを起動すると、Javaが入っていないので
Java Downloads for All Operating Systems
から windows7,XP Offlineをdownloadして

$wine jre-6u27-windows-i586-s.exe
LimeZillaが使えます。

フォント
ubuntu役に立つ?小技集

フォント関連を参考に


2011年9月15日木曜日

Lubuntu 11.04 + lubuntu control center + lubuntu software center










コントロールセンターとソフトセンターを追加しました。
sudo add-apt-repository ppa:lubuntu-desktop/ppa
sudo apt-get update
sudo apt-get install lubuntu-control-center
sudo apt-get install lubuntu-software-center

旧型PC 3 Lubuntu 11.04 インストール

CPU:Intel(R) Celeron(R) CPU 2.93G
MOTHER:MSI 865G Neo2
MEMORY:1GB PC3200-512MBX2
VIDEO:R9200LE
HDD:SEAGATE ST3120026A (120GB)a

パネルにCPU使用量モニタ Mozcを追加した。

Lubuntu 11.04 約0分46秒(bios起動時間10秒含む) shoutdown約3秒