Uncategorized Archive

OPTIMIZE TABLE foo; will squeeze out the dead space. ALTER TABLE foo ORDER BY something; does what OPTIMIZE does (but in a totally different way), plus clusters data based on the ORDER BY. In a few cases, this can be quite beneficial. Here’s an example: * Table is bigger than will fit in cache. * [...]

Force Postgres to stop

You might see the following when issuing the normal stop command to postgres via pg_ctl. -bash-3.1$ pg_ctl stop waiting for server to shut down……………………………………………………… failed pg_ctl: server does not shut down Sometimes postgres does not want to shutdown by just issuing a pg_ctl stop as the postgres user. User might feel the need to “kill [...]

Argument list too long

Hate when you can’t delete everything in a directory at once because rm runs out of args. This will DELETE everything in your current folder. Try this: find . -name ‘*’ -exec rm {} \; What to force it so it does not ask you y/n for each file? find . -name ‘*’ -exec rm [...]

This is how I do it. Mileage may very, use at own risk. First: sudo apt-get install linux-image- This will give you all current options for a new linux kernel image. Next do the same with the headers! sudo apt-get install linux-headers- Make sure you do your headers too!!!

So I need to unrar password protected files that are in a batch. Apprx 10-20 each time. This little command line script worked wonders for me, just replace PASSWORD with your password. find -type f -name ‘*.rar’ -exec unrar -pPASSWORD x {} \;