Posts

Showing posts from February, 2011

Should turn this into a makefile...

gcc $(mysql_config --cflags) mysql_test03.c $(mysql_config --libs) -Wall -o /usr/bin/mysql_test03

Show installed packages - Ubuntu

The command we need to use is dpkg –get-selections, which will give us a list of all the currently installed packages. $ dpkg --get-selections adduser install alsa-base install alsa-utils install apache2 install apache2-mpm-prefork install apache2-utils install apache2.2-common install apt install apt-utils install The full list can be long and unwieldy, so it’s much easier to filter through grep to get results for the exact package you need. For instance, I wanted to see which php packages I had already installed through apt-get: dpkg --get-selections | grep php libapache2-mod-php5 install php-db

Show line numbers in vi or vim

While editing a document (and not inserting text), type the following to turn on line numbers: :set number If you tire of the line numbers, enter the following command to turn them off: :set nonumber