This is where I post snippets of information about Information Technology. It is mostly for my own reference but I hope that others will find it useful and comments are welcome.
Tuesday, September 25, 2012
Monday, September 24, 2012
Thursday, September 13, 2012
Monday, September 10, 2012
how to go landscape mode with android emulator
http://discuz-android.blogspot.com/2008/01/change-android-screen-landscapeportrait.html
On the emulator, after the Android system is started up, open another command window, type the following command line in the adb shell to change the screen to landscape:
# service call window 18 i32 1
type the following command line to change the screen to portrait:
# service call window 18 i32 0
the above didn't work but using the keypad's 7 key works (so does 9)
On the emulator, after the Android system is started up, open another command window, type the following command line in the adb shell to change the screen to landscape:
# service call window 18 i32 1
type the following command line to change the screen to portrait:
# service call window 18 i32 0
the above didn't work but using the keypad's 7 key works (so does 9)
Friday, September 07, 2012
install dbi / sqlite for ruby with gem
[root@learn ruby_tut]# yum provides */gem
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.cse.buffalo.edu
* extras: mirror.cogentco.com
rubygems-1.3.1-1.el5.noarch : The Ruby standard for packaging ruby libraries
Repo : epel
Matched from:
Filename : /usr/bin/gem
pe-rubygems-1.3.7-4.pe.el5.noarch : The Ruby standard for packaging ruby libraries
Repo : installed
Matched from:
Filename : /opt/puppet/bin/gem
[root@learn ruby_tut]# /opt/puppet/bin/gem install --remote sqlite-ruby
Building native extensions. This could take a while...
ERROR: Error installing sqlite-ruby:
ERROR: Failed to build gem native extension.
/opt/puppet/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /opt/puppet/lib/ruby/ruby.h
Gem files will remain installed in /opt/puppet/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3 for inspection.
Results logged to /opt/puppet/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext/gem_make.out
DANG IT!
OK lets try this ...
[root@learn ruby_tut]# yum install rubygems
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.cse.buffalo.edu
* extras: mirror.cogentco.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rubygems.noarch 0:1.3.1-1.el5 set to be updated
--> Processing Dependency: ruby-rdoc for package: rubygems
--> Finished Dependency Resolution
rubygems-1.3.1-1.el5.noarch from epel has depsolving problems
--> Missing Dependency: ruby-rdoc is needed by package rubygems-1.3.1-1.el5.noarch (epel)
Error: Missing Dependency: ruby-rdoc is needed by package rubygems-1.3.1-1.el5.noarch (epel)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
POO!
[root@learn ruby_tut]# yum --skip-broken install rubygems
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.cse.buffalo.edu
* extras: mirror.cogentco.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rubygems.noarch 0:1.3.1-1.el5 set to be updated
--> Processing Dependency: ruby-rdoc for package: rubygems
--> Finished Dependency Resolution
rubygems-1.3.1-1.el5.noarch from epel has depsolving problems
--> Missing Dependency: ruby-rdoc is needed by package rubygems-1.3.1-1.el5.noarch (epel)
Packages skipped because of dependency problems:
rubygems-1.3.1-1.el5.noarch from epel
[root@learn ruby_tut]# yum install ruby-rdoc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.cse.buffalo.edu
* extras: mirror.cogentco.com
Setting up Install Process
No package ruby-rdoc available.
Nothing to do
F*%$@#!ING S^#(#$Y !!!
Ok let's try what ... says to do
[root@learn ruby_tut]# mkdir install
[root@learn ruby_tut]# cd install/
[root@learn install]# wget http://rubyforge.org/frs/download.php/63601/dbi-0.4.3.tar.gz
--2012-08-01 15:44:32-- http://rubyforge.org/frs/download.php/63601/dbi-0.4.3.tar.gz
Resolving rubyforge.org... 50.56.192.79
Connecting to rubyforge.org|50.56.192.79|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://files.rubyforge.vm.bytemark.co.uk/ruby-dbi/dbi-0.4.3.tar.gz [following]
--2012-08-01 15:44:32-- http://files.rubyforge.vm.bytemark.co.uk/ruby-dbi/dbi-0.4.3.tar.gz
Resolving files.rubyforge.vm.bytemark.co.uk... 80.68.94.54
Connecting to files.rubyforge.vm.bytemark.co.uk|80.68.94.54|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 81851 (80K) [application/x-gzip]
Saving to: `dbi-0.4.3.tar.gz'
100%[==========================================================================>] 81,851 78.1K/s in 1.0s
2012-08-01 15:44:35 (78.1 KB/s) - `dbi-0.4.3.tar.gz' saved [81851/81851]
[root@learn install]# tar !*
tar -xzf dbi-0.4.3.tar.gz
[root@learn install]# cd dbi-0.4.3
[root@learn dbi-0.4.3]# ruby setup.rb config --with=dbi,dbd_sqlite
config: unknown option --with=dbi,dbd_sqlite
Try 'ruby setup.rb --help' for detailed usage.
[root@learn dbi-0.4.3]# ruby setup.rb config
---> bin
<--- bin
---> lib
---> lib/dbi
---> lib/dbi/handles
<--- lib/dbi/handles
---> lib/dbi/sql
<--- lib/dbi/sql
---> lib/dbi/base_classes
<--- lib/dbi/base_classes
---> lib/dbi/utils
<--- lib/dbi/utils
<--- lib/dbi
<--- lib
[root@learn dbi-0.4.3]# ruby setup.rb setup
---> bin
updating shebang: dbi
updating shebang: test_broken_dbi
<--- bin
---> lib
---> lib/dbi
---> lib/dbi/handles
<--- lib/dbi/handles
---> lib/dbi/sql
<--- lib/dbi/sql
---> lib/dbi/base_classes
<--- lib/dbi/base_classes
---> lib/dbi/utils
<--- lib/dbi/utils
<--- lib/dbi
<--- lib
[root@learn dbi-0.4.3]# ruby setup.rb install
rm -f InstalledFiles
---> bin
mkdir -p /usr/bin
install dbi /usr/bin/
install test_broken_dbi /usr/bin/
<--- bin
---> lib
mkdir -p /usr/lib/ruby/site_ruby/1.8
install dbi.rb /usr/lib/ruby/site_ruby/1.8/
---> lib/dbi
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbi
install utils.rb /usr/lib/ruby/site_ruby/1.8/dbi
install columninfo.rb /usr/lib/ruby/site_ruby/1.8/dbi
install base_classes.rb /usr/lib/ruby/site_ruby/1.8/dbi
install handles.rb /usr/lib/ruby/site_ruby/1.8/dbi
install row.rb /usr/lib/ruby/site_ruby/1.8/dbi
install trace.rb /usr/lib/ruby/site_ruby/1.8/dbi
install binary.rb /usr/lib/ruby/site_ruby/1.8/dbi
install typeutil.rb /usr/lib/ruby/site_ruby/1.8/dbi
install types.rb /usr/lib/ruby/site_ruby/1.8/dbi
install sql.rb /usr/lib/ruby/site_ruby/1.8/dbi
install exceptions.rb /usr/lib/ruby/site_ruby/1.8/dbi
install sql_type_constants.rb /usr/lib/ruby/site_ruby/1.8/dbi
---> lib/dbi/handles
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbi/handles
install statement.rb /usr/lib/ruby/site_ruby/1.8/dbi/handles
install driver.rb /usr/lib/ruby/site_ruby/1.8/dbi/handles
install database.rb /usr/lib/ruby/site_ruby/1.8/dbi/handles
<--- lib/dbi/handles
---> lib/dbi/sql
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbi/sql
install preparedstatement.rb /usr/lib/ruby/site_ruby/1.8/dbi/sql
<--- lib/dbi/sql
---> lib/dbi/base_classes
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbi/base_classes
install statement.rb /usr/lib/ruby/site_ruby/1.8/dbi/base_classes
install driver.rb /usr/lib/ruby/site_ruby/1.8/dbi/base_classes
install database.rb /usr/lib/ruby/site_ruby/1.8/dbi/base_classes
<--- lib/dbi/base_classes
---> lib/dbi/utils
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbi/utils
install date.rb /usr/lib/ruby/site_ruby/1.8/dbi/utils
install xmlformatter.rb /usr/lib/ruby/site_ruby/1.8/dbi/utils
install time.rb /usr/lib/ruby/site_ruby/1.8/dbi/utils
install tableformatter.rb /usr/lib/ruby/site_ruby/1.8/dbi/utils
install timestamp.rb /usr/lib/ruby/site_ruby/1.8/dbi/utils
<--- lib/dbi/utils
<--- lib/dbi
<--- lib
[root@learn dbi-0.4.3]#
[root@learn dbi-0.4.3]# cd ..
[root@learn install]# wget http://rubyforge.org/frs/download.php/60205/dbd-sqlite3-1.2.5.tar.gz
--2012-08-01 15:51:26-- http://rubyforge.org/frs/download.php/60205/dbd-sqlite3-1.2.5.tar.gz
Resolving rubyforge.org... 50.56.192.79
Connecting to rubyforge.org|50.56.192.79|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://files.rubyforge.vm.bytemark.co.uk/ruby-dbi/dbd-sqlite3-1.2.5.tar.gz [following]
--2012-08-01 15:51:26-- http://files.rubyforge.vm.bytemark.co.uk/ruby-dbi/dbd-sqlite3-1.2.5.tar.gz
Resolving files.rubyforge.vm.bytemark.co.uk... 80.68.94.54
Connecting to files.rubyforge.vm.bytemark.co.uk|80.68.94.54|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52156 (51K) [application/x-gzip]
Saving to: `dbd-sqlite3-1.2.5.tar.gz'
100%[==========================================================================>] 52,156 55.3K/s in 0.9s
2012-08-01 15:51:28 (55.3 KB/s) - `dbd-sqlite3-1.2.5.tar.gz' saved [52156/52156]
[root@learn install]# tar -xzf dbd-sqlite3-1.2.5.tar.gz
[root@learn install]# cd dbd-sqlite3-1.2.5
[root@learn dbd-sqlite3-1.2.5]# ls
build ChangeLog lib LICENSE Rakefile README setup.rb test
[root@learn dbd-sqlite3-1.2.5]# ruby setup.rb config
---> lib
---> lib/dbd
---> lib/dbd/sqlite3
<--- lib/dbd/sqlite3
<--- lib/dbd
<--- lib
[root@learn dbd-sqlite3-1.2.5]# ruby setup.rb setup
---> lib
---> lib/dbd
---> lib/dbd/sqlite3
<--- lib/dbd/sqlite3
<--- lib/dbd
<--- lib
[root@learn dbd-sqlite3-1.2.5]# ruby setup.rb install
rm -f InstalledFiles
---> lib
mkdir -p /usr/lib/ruby/site_ruby/1.8
---> lib/dbd
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbd
install SQLite3.rb /usr/lib/ruby/site_ruby/1.8/dbd
---> lib/dbd/sqlite3
mkdir -p /usr/lib/ruby/site_ruby/1.8/dbd/sqlite3
install statement.rb /usr/lib/ruby/site_ruby/1.8/dbd/sqlite3
install database.rb /usr/lib/ruby/site_ruby/1.8/dbd/sqlite3
<--- lib/dbd/sqlite3
<--- lib/dbd
<--- lib
[root@learn dbd-sqlite3-1.2.5]#
Subscribe to:
Posts (Atom)