Execute mysql command from shell

2010-02-04 1 min read Database

phpMyAdmin is a very slow application if you want to execute a query on your database. If you know the name of the database then any GUI tool is an overhead. So I have written a one liner shell script to do that for me 🙂

Here’s the script:

echo ”select * from table where field like ”%$1%””|mysql -h doamin.com -u amit -p -D amit -r –password=hello

When run with one argument it will execute the sql query directly without asking for password also.

Continue reading

Packagekit Error

2010-02-04 1 min read Fedora

With the latest update on my Fedora 10(F10) I started getting this error when ever I wanted to use the gnome package kit (I was able to use yum though):
failed to get a TID: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface ”org.freedesktop.PackageKit.Transaction” member ”SetLocale” error name ”(unset)” destination ”org.freedesktop.PackageKit”) (0)

I searched couple of forums but did not find any good resource on what was happening. Finally I decided to rollback Packagekit and dbus. And Yahoooooooooooo, it started working again.

Continue reading

Color in grep output to distinquish the matching entries

2010-02-04 1 min read Linux

Most of the times I end up spending a lot of time to look for the string in the grep output when I do a search. This is quite frustrating and thus I looked at the options for grep command that would make my life easier and there definately is something. Here it is:

export GREP_COLOR=”5;36”

But for this to work you would still need to give the ”–color=auto” option in the grep command. There are two ways to do this, create a alias for grep as ”grep –color=auto” or specify the same in GREPOPTIONS.

Continue reading

kernel source code — the easier way to get it with git.

2010-02-04 1 min read Fedora

The simplest way to get the kernel code is :

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

If you want to get the other branches then head over to <a href="http://git.kernel.org">&#8221;Kernel Git Page&#8221;

This will get the Linux kernel tree. As of today , 12 days ago, the tree was tagged to 2.6.31.
Now thats cool, but do you want it to be simpler and do not want to know the git command get to what you want to do that is learn linux kernel then here\’s what you can do :
sudo yum install teamgit
Here is the interface that you will get to add new repo:

Continue reading

Top 3 Sites To Help You Become A Linux Command Line Master]

2010-02-04 0 min read Linux
\"Programming
Image by fogus via Flickr

The truth about Linux today is that one may never have to actually <a class="zem_slink" title="Spice Girls" rel="homepage" href="http://www.thespicegirls.com">touch a terminal or issue a single Linux command in order to run some versions of this flexible alternative <a class="zem_slink" title="Operating system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Operating_system">operating system. While there are times when using the Linux <a href="http://www.makeuseof.com/tag/an-introduction-to-the-linux-command-line/">command line could be expeditious and the benefits of possessing the ability to use it are numerous, many users can be intimidated by the prospect.

Continue reading

Damn Vulnerable Linux – DVL review

2010-02-04 1 min read Linux

Today morning I got a chance to look at one of the other less commonly known Linux Distribution and out of the line distribution, very good for Learning purposes. The distribution is known as DVL (Damn Vulnerable Linux). As the name suggest this is for people looking at developing their skills in Security and Penetration testing. Quite a lot of good and interesting tools are included. More is left for users to experiment but I definately liked the distribution. Here is the <a href="http://www.damnvulnerablelinux.org/" target="_blank">homepage.

Continue reading

chfn – Change finger information

2010-02-04 1 min read Linux

Finger is a nifty nice utility to get the information on the user. A sample output of the command is as below:

-0-(ak) ~ > finger ak
Login: ak                     Name: Amit Agarwal
Directory: /home/amitag                 Shell: /bin/bash
Office: MGL
On since Sun Oct 19 13:50 (IST) on tty7 from :0
On since Sun Oct 19 13:50 (IST) on pts/0 from :0.0
No mail.
No Plan.
All this information can be changed with the command chfn. No hassles, just type in the command it does the rest, asking you for the information whatever required. You can also specify the details in the command itself with the below mentioned parmateres:

Continue reading
Older posts Newer posts