Saturday, 17 July 2010

Setting up MySQL with Ruby on Rails in Windows

1. Download MySQL Community Server (latest is 5.1.48) and install it.
2. In the console type
gem install mysql
This installs the mysql adapter for ruby.
With rails 2.2 or later (mine is 2.3.8),  MySQL 5.1 in windows doesn't integrates well.
3. So to avoid problems download libmySQL.dll. This is an older version of MySQL client library. Copy it into the ruby\bin folder.
This avoids error during rake db:migrate which might cause
rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
4. You can install the MySQL GUI Toolkit (optional).

Friday, 16 July 2010

mxmlc Error Loading: "D:\Program Files\Java\jre6\bin\server\jvm.dll"

mxmlc which is the flex compiler requires that you have Java Runtime Environment installed in you system which in particular must be 32 bit (at present). The error - Error Loading: "D:\Program Files\Java\jre6\bin\server\jvm.dll" is shown means you are having a 64 bit JRE. You need to point to a 32 bit version. Open the Environment Variable window and configure as shown in the screenshot.
























Create a new variable called JAVA_HOME with value pointing to the 32 bit version of JRE. In my case its D:\Program Files (x86)\Java\jre1.6.0_07\
Now mxmlc should work.

Saturday, 10 July 2010

Install Ruby on Rails in Windows 7

Installing Ruby on Rails in Windows is very easy.
1. Goto download section of www.rubyonrails.org
2. Check the recommended version for ruby to be installed.
At present the recommended version is Ruby 1.8.7.
3. Download Ruby 1.8.7  (preferably Ruby 1.8.7-p249 RubyInstaller).
4. Download RubyGems. You can download the latest one. (ruby-gems-1.3.7.zip)
5. Install Ruby. (You must check set environment path during installation.)
6. Extract ruby-gems and navigate to the extracted folder using cmd.
7. Inside the ruby-gems folder type:
ruby setup.rb
8. Now RubyGems is installed.
9. Now you can simply run
gem install rails
to install rails.
Its found that there are some problems with Ruby1.9.1 with rails (in Ubuntu). However Ruby 1.8.7 works fine.

Install wget for windows and set environment path

1. Download Windows binaries of wget.
2. Extract it to to say D:\Utils\ (you can put it where ever you want).
3. Right-click Computer under the start menu and choose Properties.
4. On the left pane click Advanced System Settings and choose Environment Variables.
5.  In the 'User Variables' section (the upper part), create new variable named Path if it doesn't exist.
6. For that click the New button, give the name value Path and variable value the location of the wget folder. In our case its D:\Utils
But if the Path variable is already present, add a semi-colon at the end and then specify the location of wget.exe.

Tuesday, 6 July 2010

Register your IRC Nickname

In order to register your irc nickname with the Nickserv, login to an irc channel.
Here I use a web based client for making this process simple and easy.
1. Goto http://webchat.freenode.net
2. Enter the nickname you wanted to register and any irc channel, say #python and click connect.
3. If it isn't already owned you will see a page with logs and at the bottom you can type messages. This is the status page tab. After a while you will see the #python page.
4. Click the status tab and enter /msg Nickserv REGISTER password email
where passwordis the password you want and an email to confirm the nickname. Confirmation message will be sent to your email.
5. Open your mail and follow the instruction.
6. The verification format will be of the form /msg NickServ VERIFY REGISTER yournickname verificationcode

If you don't want to make your email public then enter /msg nickserv set hidemail on.
To set nick to private mode set /msg nickserv set private on so that list command does not show the nick.

Once identified with the server, to change password use /msg nickserv set password $newpass

Note that you need to log in atleast once in 60 days to prevent the username from being inactive.
Ref: IRC Beginner's commands

wget websites

wget utility can be used to save websites for offline viewing.
wget --no-parent -rkpU Mozilla http://examplewebsite.com/index.html
--no-parent does not fetch files from parent directories.
-r recursively downloads the pages. Means if the index.html contains links to .css files and other pages those will be downloaded.
-k convert-links The links that appear in a page will be pointed to local files
-p page-requisites Get all images etc needed to display the html page.
-U Mozilla U means user-agent and Mozilla is one of the user-agents. Some sites allows only user-agents identified as browsers only since they don't want the sites ripped.

Sunday, 4 July 2010

Fix sound in Ubuntu 10.04

With the installation of Ubuntu 10.04, most probably the sound won't work by default. You can see the a red icon as shown in the picture below.



Click the sound icon and choose unmute.
Done.