Tuesday, May 24, 2011

How to copy multiple file from remote host using scp

To copy complete folder then -r swich can be used,

scp -r user@host:folder_path source_path_of_current_machine

To copy selected file from folder, then specify path1 and path2 of file separated by space

scp user@host:"path1 path2" source_path_of_current_machine

And if file is in the same folder then bash file expansion enclosed in double quote can be used,

scp user@host:"foder_path/{file1,file2}" source_path_of_current_machine




Thursday, May 19, 2011

How to run latest or multiple firefox release on linux

I want to run firefox 5 and firefox 6 on my ubuntu lucid while running firefox3.
Use follwing step,

  1. Download firefox 5 and firefox 6 build from mozzila site.
  2. then extract tar file and start the firefox using command 
  3. start firefox5 using,
    #ff5_dir/firefox -P "ff5" -no-remote
  4.  start firefox5 using,
    #ff6_dir/firefox -P "ff6" -no-remote
  5. firefox will prompt you to create new profile give name ff5 for firfox5 and ff6 for firfox 6, after creating profile uncheck option "Don't ask at starup",
  6. Now use the same step 2 command to start firfox 5 and firefox 6 or you can create shortcut with above step 2 command

 


Tuesday, May 17, 2011

How to delete firefox cookie from command line in ubuntu linux

just delete sqlite db file using following command
change home_dir and firefox_profile_name(some random   generated name) accordingly in command

rm home_dir/.mozilla/firefox/firefox_profile_name/cookies.sqlite

How to setup filezilla or Krusader for ec2 on ubuntu linux

add follwing entry int your ssh config file (ex. your_home_dir/.ssh/config)


Host server_address
 IdentityFile ssh_private_key_location
(change server_address and ssh_private_key_location accordingly)
you get ec2 ssh_private_key, when you create keypair in aws_console->keypairs section. They key you need to specify when you boot new instance.also change ssh private key security mode to 600.

Then add site into filezilla->site manager as shown in the above screenshot.

  1. host should be server address
  2. select servertype as sftp
  3. select username on linux instance accordingly
  4. then connect to ec2 instance


and for Krusader you need to specify same thing as shown in the above screenshot


How to use ec2 as proxy using SSH tunnel for geo related web testing on linux

create ssh tunnel using follwing command (change port number,key file address,username and ec2 instance ip address accordingly),
ssh -D 9999 -i key_file_location username@ec2_instance_address
then set SOCKS HOST proxy setting for the firefox (prefernce->network tab) or other browser as shown in the figure


















Close the ssh tunnel once you are done with testing.

how to enable mysql general logging using query without restarting server on ubuntu lucid 10.4.2

to see what's going on inside mysql without restarting server, logging can be enabled using following query

SET GLOBAL general_log_file = '/var/log/mysql/mysql.log';
SET GLOBAL general_log = 'ON'

and logging can be disabled using following query

SET GLOBAL general_log = 'OFF'

Tuesday, May 3, 2011

How to enable openx for geotargeting

install openx  after that download free geoip city database from maximind site and uncompress it.

#wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
#gunzip -d GeoLiteCity.dat.gz

enable geotargeting in configuration section of openx administration account

copy GeoLiteCity.data to <openx_home>/plugins/geoTargeting/oxMaxMindGeoIP/data
sudo chown www-data:www-data GeoLiteCity.dat
sudo chmod 777 GeoLiteCity.dat

change geoTargeting plugin setting, add "GeoLiteCity.dat" for city data file

in <openx_home>/plugins/etc/oxMaxMindGeoIP/oxMaxMindGeoIP.xml change line as shown below for GeoLiteCity.dat

            <file path="{MODULEPATH}geoTargeting/oxMaxMindGeoIP/">oxMaxMindGeoIP.class.php</file>
            <file path="{MODULEPATH}geoTargeting/oxMaxMindGeoIP/">oxMaxMindGeoIP.delivery.php</file>
            <file path="{MODULEPATH}geoTargeting/oxMaxMindGeoIP/data/">GeoLiteCity.dat</file>

in <openx_home>/plugins/geoTargeting/oxMaxMindGeoIP/oxMaxMindGeoIP.delivery.php change following line
        //$geo = oxMaxMind_getGeo($ip, dirname(__FILE__) . '/data/FreeGeoIPCountry.dat');
        $geo = oxMaxMind_getGeo($ip, dirname(__FILE__) . '/data/GeoLiteCity.dat');