Archive for the ‘Uncategorized’ Category

List all public IPs from aws cli

December 28, 2015

aws ec2 describe-instances \
–query “Reservations[*].Instances[*].PublicIpAddress” \

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

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

January 17, 2008

Feedjit Live Website Statistics

Hello world!

September 1, 2007

Hello world!..