sazwqa

December 14, 2009

JVM terminated exit code 13

Filed under: Uncategorized — sazwqa @ 10:39 am

 

Spent a good time amount of time figuring, what this error is and still clueless.

I was able to run the latest version of eclipse after I degraded my eclipse and ran it and then ran the latest version.

What’s the logic ?

February 1, 2009

Accessing svn+ssh repository using TortoiseSVN

Filed under: TortoiseSVN, appz, putty, svn+ssh — Tags: , , — sazwqa @ 10:38 am

TortoiseSVN could be a real pain, if you have to access a repository that is accessible via SSH since it pings for password every time.

Here are the steps to use your public/private key pair:

1. If you already have Putty generated public/private key pair then skip to next step, else if you are like me who use OpenSSH keys for everything then you need to run PUTTYGEN.EXE and import/convert your keys to Putty public/private key pair.
2. Run PAGEANT.EXE with path to your putty private key

Better you can add this shortcut (PAGEANT.EXE path_to_putty_private_key) to your start-up to auto-authorize for all sessions as you log in.

Update: Just realized that you will need to checkout the code-base prefixing your name else the PLink will ping each time for your name.

So, if your repository is located at say: svn+ssh://svn.codebase.com, check it out in the following manner:
svn+ssh://username@svn.codebase.com

January 19, 2009

PHP Uptime script for Windows

Filed under: Uncategorized — sazwqa @ 6:47 am

1. Download the uptime tool from Microsoft.

2. Copy uptime.exe to windows folder (or you can set proper PATH)

3. Add the following code on your page:

<?php echo(shell_exec("uptime");) ?>

That’s it !

Finding windows uptime

Filed under: Uncategorized — sazwqa @ 6:43 am

This little tool available from Microsoft, gives your uptime.

http://support.microsoft.com/kb/232243

December 9, 2008

Precise RSpec

Filed under: fun, rspec — Tags: , — sazwqa @ 7:27 am
C:\Users\rd\Desktop\cucumber>spec bowling_spec.rb -f specdoc

Bowling
- test1
- test2
- test3

Finished in 0.0560000000000001 seconds

3 examples, 0 failures

December 8, 2008

Managing multiple ruby versions on windows

Filed under: appz, ruby, script, windows — Tags: , — sazwqa @ 8:04 am

Well I have to handle multiple ruby versions for different apps and change them frequently too.

So created a nifty script to change ruby versions on the fly.

# find installed ruby
Dir.chdir("C:/")
versions = Dir.glob("ruby*")[1..-1]
versions.each{|v| v.gsub!('ruby','')}
current_version = `ruby -v`
current_version_suffix = current_version.split[1].gsub('.','')
# handle mingw
if current_version =~ /mingw/
  current_version_suffix = 'win'
end

# generate menu
puts("current version: " + `ruby -v`)
puts("Installed ruby versions:")
versions.each_with_index { |v, i| p("#{i+1}. #{v}") }
print("Select number to change version, or enter to exit: ")
choice = gets.chop!
exit if choice.empty?

# rename
File.rename('c:\ruby', "ruby"+current_version_suffix)
File.rename("ruby"+versions[choice.to_i-1], 'c:\ruby')
puts("\n") if current_version_suffix =~ /19/ # for ruby 1.9
puts("changed version: " + `ruby -v`)

The above script is also available on pastie, http://pastie.org/334773

You can call it by creating shortcut for windows, like:

@ruby e:\shortcuts\change.rb

Update: Updated the script to take patchlevel in consideration:

# find installed ruby versions
Dir.chdir("c:/")
ruby_versions = Dir.glob("ruby*")[1..-1].each{|v| v.gsub!('ruby','')}
current_version_string = `ruby -v`
current_version_number = current_version_string.split[1].gsub('.','')
current_version_patchlevel = current_version_string.scan(/patchlevel\s?(\d+)/)
current_version = "#{current_version_number}p#{$1}"

# generate menu
puts("current version: #{current_version_string}")
puts("Installed ruby versions:")
ruby_versions.each_with_index { |v, i| puts("#{i+1}. #{v}") }
print("Select number to change version, or enter to exit: ")
choice = gets.chop!
exit if choice.empty?

# rename
File.rename('c:\ruby', "ruby"+current_version)
File.rename("ruby"+ruby_versions[choice.to_i-1], 'c:\ruby')
puts("changed version: #{`ruby -v`}")

Heredoc/here-document syntax

Filed under: here-document, heredoc, perl, php, python, ruby — Tags: , , , , , — sazwqa @ 7:31 am

Just because I forget this a lot when it’s needed the most.

http://keithdevens.com/weblog/archive/2005/Aug/17/heredoc

December 6, 2008

Fitt’s Law and Microsoft Office

Filed under: fitt's law, microsoft, office — Tags: , , — sazwqa @ 5:06 pm

Nice read, regarding Fitt’s law related to user interface and it’s use in microsoft office.

http://blogs.msdn.com/jensenh/archive/2006/08/22/711808.aspx

Apps are evolving, for sure !

December 1, 2008

updating rubygems manually

Filed under: ruby, rubygems, rubygems-update — Tags: , , , — sazwqa @ 8:29 am

If you get “Nothing to update” when you try to update your rubygems and you’re sure your gems need to be updated.

Update them manually:

gem install rubygems-update
update_rubygems

check updated gems:

gem env

November 30, 2008

no such file to load — openssl

Filed under: Rails, libssl, openssl, ror, ruby, rubyonrails — Tags: , , , , , , , — sazwqa @ 8:03 pm

Getting this ? simple you need to install the openssl package. Follow me:

sudo apt-get install libopenssl-ruby openssl
sudo apt-get install libssl-dev

Locate ruby source directory and browse to /ext/openssl and shoot the following:

sudo ruby extconf.rb
sudo make
sudo make install

relax :)

Older Posts »

Powered by WordPress