| |||||||||||||||||||||||||||||||||||||||||
Wednesday, March 27, 2013
Reminder about your invitation from Ketan Kulkarni
Wednesday, March 20, 2013
Invitation to connect on LinkedIn
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wednesday, October 28, 2009
Apache: .htaccess redirection
the new domain, use the following code in .htaccess file placed in the
document root of your old website.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
This way, visitors of
http://olddomain.com/some_file.html
will be redirected to
http://www.newdomain.com/some_file.html
Wednesday, August 05, 2009
Linux: Avoid scp when copying a lot of files
scp. This is because scp spawns a new process for each file and can be
resource intensive.
When using the -r switch, scp does not care about symbolic links and
will follow them, even if it has already copied the file. This can
lead to scp copying an infinite amount of data and can easily fill up
your hard disk.
Therefore, when you think of backups or remote copy of directories,
think of rsync.
Linux: Download whole website with wget
wget -r -p -np -k http://www.sonomamgmt.com
Friday, July 10, 2009
Linux : Install fonts on Linux
system-wide) follow this procedure.
If ~/.fonts does not exist,
% mkdir ~/.fonts
Download and copy the .ttf files into this directory and run
% fc-cache
For users who need to download Devanagari fonts, here's a good resource.
http://www.wazu.jp/gallery/Fonts_Devanagari.html
Wednesday, May 20, 2009
MySQL:Set up unique key ignoring duplicates
a table containing duplicates, here's the key
mysql> ALTER IGNORE TABLE table_name ADD UNIQUE(column_name)
Please note the keyword IGNORE in the above statement. That does the
work forcefully.
Sunday, February 15, 2009
Linux : tr (translate) command
in upper case. I needed this in a shell script. Here's the command
date +%b | tr [a-z] [A-Z]
Output: FEB
Learn more about tr using the following command
man tr
Monday, February 09, 2009
Consider freelancing !
* Freelancing provides you with chances to build your own business
contacts who will keep you busy.
* You are free to do many jobs at the same time.
* Nobody takes away your credit. You get rewarded for your work.
* You can work remotely from the comfort of your home. You save daily
commute which takes a lot of time.
* You can work when you are most productive. Flexibility of time is a
great advantage.
* You get good pay rate simply because there are no overheads. Money
is not lost to company administration or your manager :-)
* As I started writing this post, I thought someone must have done it
before so I googled and found that there's a list of 101 such reasons
on
http://www.hrworld.com/features/101-reasons-to-freelance-091007/
I never considered all those reasons before starting freelancing myself.
* Finally, because it's become hard to get a job when the world is hit
by recession.
Tuesday, February 03, 2009
Mysql: keep connection open for longer
SET @@local.wait_timeout=1800;
SET @@wait_timeout=1800;
SET @@local.interactive_timeout=1800;
SET @@interactive_timeout=1800;
Wednesday, January 28, 2009
MySQL: GROUP BY on datetime column
FROM Table1 GROUP BY Date;
Sunday, December 28, 2008
Linux : Installing mplayer on centOS
% wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
% wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
% rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
% rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
% rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
% yum check-update
% yum install mplayer
Tuesday, September 16, 2008
Bash : concatenate strings in bash
You have $yr=2008
You want to obtain something like 2008_data.csv etc
$yr_data.csv does not work
The solution - Use curly braces to separate variables from strings
like this
${yr}_data.csv
Thursday, September 11, 2008
Linux : setting up hostname
Become root, save hostname in /etc/hostname and tell the hostname
command to read the name from the file.
Here are the commands to do the same
% su
% echo your_hostname > /etc/hostname
% hostname -F /etc/hostname
However, on next reboot, hostname will be lost.
On Red Hat / centOS, edit HOSTNAME= entry of the file
/etc/sysconfig/network
This sets up the hostname permanently.
Sunday, August 10, 2008
MySQL : Delete all tables of a database
been just dropping the database and creating it again. Does anyone
know any better method ? If you don't have privileges to create/drop
db, my method is not going to work :-)
Friday, February 01, 2008
MySQL : grant command
mysql>GRANT SELECT, INSERT, UPDATE, DELETE
->ON widgets.* TO widgetAdmin@localhost
->IDENTIFIED BY 'ilovewidgets';
Assuming that the user widgetAdmin did not yet exist when this query is executed, both the user and db tables will be updated with the necessary rows.
The above is taken from dev.mysql.com.You can also use assign all privileges to a user on a certain database. Following is the syntax.
mysql> GRANT ALL PRIVILEGES ON
-> test.* TO 'ketan'@'localhost'
-> IDENTIFIED BY 'ketans_password';
I find this command exceedingly useful ! A quick way to set up privileges of a user on a db.
Thursday, January 03, 2008
PHP : Facebook application to solve jumbled words
http://apps.facebook.com/word_jumble/
Try it out.
Friday, December 28, 2007
PHP : Solve jumbled words
http://apps.facebook.com/word_jumble/
Enjoy !
Wednesday, December 12, 2007
MySQL : rename a table
mysql> RENAME TABLE users TO members;
Saturday, November 24, 2007
Perl : selecting randomly elements of an array
use strict;
my @test = (0,1,2,3,4,5);
my $i = 6;
while($i > 0){
my $offset = int(rand(scalar(@test)+1)) - 1;
print $test[$offset]."\n";
splice(@test,$offset,1);
$i--;
}