Deleting all rows from Cassandra table, with out removing the schema.

October 5, 2015

Good old truncate.

TRUNCATE keyspace_name.table_name;

How to change the default text editor in debian

August 31, 2015

sudo update-alternatives –config editor

How to check if I am running systemd , sysv or upstart ?

August 27, 2015

stat  init process (process 1) and it will show the binary.

Example: On a systemd box

#stat /proc/1/exe
File: ‘/proc/1/exe’ -> ‘/lib/systemd/systemd’

Check if / Make a MySQL instance read only

January 8, 2013

To check if A DB is already in read only mode:

SELECT @@global.read_only;

To set ( at Runtime)

SET GLOBAL read_only=1;

To set permanently,  add the following in my.cnf


These options will  make the DB run  in a read only mode, except for the slave threads and the super users, who can still do writes.  This is used on slaves when you want to make sure only read requests are executed on slaves.

DEBIAN: Where is preinst, postinst, prerm, and postrm etc are stored AFTER installing the deb package

December 4, 2012

Ever had issues with uninstalling a package due to incorrect entries in prerm or postrm ?  Or do you like to have a look at  preinst, postinst, prerm, and postrm of an installed package?

You can find them here and make any corrections so that you are able to uninstall  the package.

ls /var/lib/dpkg/info/YOURPACKAGENAME

Find strings in one file which are not present in another file

November 16, 2012

When there is one string per line and they are not sorted, the simplest solution  would be:

grep -Ffx file2 -v file1

Debian :: Accessing lvm from single user mode

November 9, 2012

We have /usr mounted on lvm,  so it’s tricky to get the commands in
/usr/bin and /usr/sbin to work in single user mode. lvm devices wont
be loded by default.

lvm vgscan
lvm vgchange -ay
lvm lvs

Now you should see your normal LVM devices in /dev (example:
/dev/LVM-GROUP/LVM-VOLUME) . You can mount and use them.

How to find out which repository a package would be downloaded from – debian/ubuntu

June 12, 2012

apt-cache policy

Remove embedded album art

May 13, 2010

To remove embedded album art from music files from Ubuntu or variants, you can use eyeD3 which is in repository.

To install:

    apt-get install eyed3

To remove embedded album art :

    eyeD3 –remove-images * *.mp3
    eyeD3 –remove-images * *.ANY_OTHER_FORMAT

Find out what version of Ubuntu you’re using

August 28, 2008

Use this command:

lsb_release -a

in terminal


Get every new post delivered to your Inbox.