Wednesday, March 27, 2013

Reminder about your invitation from Ketan Kulkarni

 
 
 
LinkedIn
 
This is a reminder that on March 21, Ketan Kulkarni sent you an invitation to become part of their professional network at LinkedIn.
 
 
 
 
On March 21, Ketan Kulkarni wrote:

> To: blogger [ketan404.linux@blogger.com]
> From: Ketan Kulkarni [ketan404@gmail.com]
> Subject: Invitation to connect on LinkedIn

> I'd like to add you to my professional network on LinkedIn.
>
> - Ketan
 
 
 
 
 
You are receiving Reminder emails for pending invitations. Unsubscribe.
© 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
 

Wednesday, March 20, 2013

Invitation to connect on LinkedIn

 
LinkedIn
 
 
 
Ketan Kulkarni
 
From Ketan Kulkarni
 
Partner at FirstRay Consulting
Pune Area, India
 
 
 
 
 
 
 

I'd like to add you to my professional network on LinkedIn.

- Ketan

 
 
 
 
 
 
 
You are receiving Invitation to Connect emails. Unsubscribe
© 2012, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
 

Wednesday, October 28, 2009

Apache: .htaccess redirection

If you want visitors of your old website domain to be redirected to
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

When you are copying a lot of files files it may take a long time with
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

Command to download whole website

wget -r -p -np -k http://www.sonomamgmt.com

Friday, July 10, 2009

Linux : Install fonts on Linux

To install new fonts in your home directory (only for you; not
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

For many of you who might be having trouble setting up a unique key on
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

I made a good use of the translate command recently to get month-name
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 !

Reasons why you should 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

These mysql queries will keep the connection open for 1800 seconds

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

SELECT DATE_FORMAT(MyDate, '%d %M %Y') AS Date, COUNT(*) AS numRows
FROM Table1 GROUP BY Date;

Sunday, December 28, 2008

Linux : Installing mplayer on centOS

Installing mplayer on centOS is simple ! Execute the following commands as root


% 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

The problem -

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

Here's how you can set hostname of your linux machine

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

It seems there's no command to delete all tables of a database. I have
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

The GRANT function is used both to create new users, and to assign privileges to users.
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

Wrote a facebook application to solve jumbled words.

http://apps.facebook.com/word_jumble/

Try it out.

Friday, December 28, 2007

PHP : Solve jumbled words

Wrote a facebook application to solve jumbled words. Here's the link

http://apps.facebook.com/word_jumble/

Enjoy !

Wednesday, December 12, 2007

MySQL : rename a table

Renaming a table is easy ! Following is the command.

mysql> RENAME TABLE users TO members;

Saturday, November 24, 2007

Perl : selecting randomly elements of an array

#!/usr/bin/env perl
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--;
}