Ubuntu 12.04 proper LCDd suspend

Please edit this file: /usr/lib/pm-utils/sleep.d/LCDd and make it executable chmod +x LCDd.

#!/bin/sh
# If we are running LCDd stop and restart
# Otherwise lirc_* modules won't get unloaded and
# they do not work properly with suspend/resume
 
. "${PM_FUNCTIONS}"
 
suspend_lcd()
{
if [ -x /etc/init.d/LCDd ]; then
/etc/init.d/LCDd stop 2>&1 > /dev/null
fi
}
 
resume_lcd()
{
if [ -x /etc/init.d/LCDd ]; then
/etc/init.d/LCDd start 2>&1 > /dev/null
fi
}
 
case "$1" in
hibernate|suspend)
suspend_lcd
;;
thaw|resume)
resume_lcd
;;
*) exit $NA
;;
esac

Shrink databasename_Log.LDF file on Microsoft SQL

Since I administer a very high load news site, I noticed that MSSQL log file of the site database is growing enormously. Database itself devided into 2 files one 330MB and the other 721MB, but log files grew to 5GB for the first file, and 20GB for the second file.

Since Microsoft doesn’t recommend that you delete these files, you need to shrink them to smaller files. To do this you have to backup your database (f.e. acctfiles) log files with truncate_only option. Continue reading “Shrink databasename_Log.LDF file on Microsoft SQL”