Friday, July 20, 2012

Python Basics

The single most important thing to know about python is that everything is object in python.

use dir() or the inspect module to inspect any object. The help() function is very useful. It's a wrapper around pydoc module.I use it frequently to know the statements like print, raise etc.

dir.__doc__ will give you the details.

inspect.getmembers() ouputs a list of all members of the passing object.

To know about any function at first try the __doc__ first

Sunday, June 3, 2012

Openssh as proxy server connection

Today I discovered the ssh -D feature which can be used as a secure proxy server connection.

For example I am using ssh -D 4589 username@hostname     to make a secure connection to the hostname. 4589 is the local port to be used . After connecting to the  remote hostname If you configure the proxy settings in the browser( In the socks field put 127.0.0.1 and as port put 4589 or whatever port you define in the command ) you'll be using your own proxy server! no need to use the insecure public proxys.

Check the manual of SSH for more info

Friday, January 20, 2012

Ubuntu 11.10 Recording Sound from the Sound Card

From the top right corner select sound preference. In the Hardware tab Select the profile 'Analog Stereo Output'.

Install audacity if you don't have. Open audacity, got to Edit>Preference from the devices list select pulse0 as the recording interface. 

Now record any sound as usual from the audacity

Monday, August 29, 2011

Ruby Books

I have been working on ruby. Best book I have found is "Programmin Ruby" By Dave Thomas.

The language which has best documentation is "PHP" . The php manual is all what you need, I was searching something like that in ruby and 'Programming Ruby' is the gem.

Sadly I haven't found such documentation for Python.
http://docs.python.org/ is 'ok' to me but it has not been effective like 'php' or 'ruby' . 


Saturday, August 27, 2011

Ruby on Rails Apache passenger defaults to production environment

I have been playing with ROR. I had been experimenting with WebRick server that comes with rails but default.
I tried to test my app with apache passenger module/mod_rails.
Passenger will assume the environment as 'production'.
On the other hand when you use rake db:migrate command it works for the 'development' environment.

If you want to use passenger for testing/development enviroment use the
rake db:migrate RAILS_ENV=production command.

or set the RailsEnv in your .conf file or in a .htaccess file(If AllowOverride is  set ).
For details visit here.
http://www.modrails.com/documentation/Users%20guide%20Apache.html






About Me

Web Developer From Dhaka, Bangladesh.