Sunday, November 18, 2012

Commands


Clean the Kernals
============================================
dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done


select * from ReportSummaryDB.CampaignInsightSummarySegment where date >='2012-08-12' and date <='2012-08-18' INTO OUTFILE '/tmp/CampaignInsightSummarySegment.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';

http://www.electrictoolbox.com/mysqldump-selectively-dump-data/
mysqldump -t -u root -p ReportSummaryDB CampaignInsightSummarySegment --where="date >='2012-08-12' and date <='2012-08-18'" > CampaignInsightSummarySegment1218.sql;

mysqldump -t -u root -p ReportSummaryDB CampaignInsightSummarySegment --where="date >='2012-08-12' and date <='2012-08-18'" > CampaignInsightSummarySegment1218.sql;

SVN Password
htpasswd /etc/subversion/passwd jason

Friday, November 16, 2012

Hadoop Format Steps

1. stop hadoop service (/usr/local/hadoop/bin/stop-all.sh)
2. login root user
3. rm -rf /mnt/sdb1/* in all servers
4. login as hduser
5. /usr/local/hadoop/bin/hadoop namenode -format in all servers
6. start hadoop service as hduser(/usr/local/hadoop/bin/start-all.sh)

Wednesday, November 14, 2012

Tuesday, November 6, 2012

[HowTo] Enable or disable modules in Apache


You can enable or disable any apache module using a2enmod and a2dismod. You don’t need to edit the conf file for that unless you are having some problem with this method. The syntax of these commands is really simple:

To enable a module:
sudo a2enmod module_name
To disable a module:
sudo a2dismod module_name
For instance, to enable mod_expires, execute sudo a2enmod expires in the terminal. If you see the following output, you can be sure that it has been enabled.
dpac@dpac-laptop:~$ sudo a2enmod expires
Enabling module expires.
Run '/etc/init.d/apache2 restart' to activate new configuration!
To disable mod_expires:
sudo a2dismod expires
Restart the server after enabling the module.
sudo service apache2 restart
Or
sudo /etc/init.d/apache2 restart
Or
sudo /etc/init.d/apache2 force-reload
PS: On linux systems, you can use auto-complete feature by pressing tab with a2enmod and a2dismod. It will show list of mods installed on your system.