Hello World

Sunday, 30 November, 2008, 04:26 AM ( 1087 views ) - Geek - Posted by grifter
Want to swap option and command keys to play World of Warcraft?
Here is how to do it using Apple Script. (Only works for Leopard)

You will need to tick on "Enable access for assistive devices" under Universal Access for it to work though.

--- Start ---
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.keyboard"
end tell
tell application "System Events"
tell application process "System Preferences"
click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
tell sheet 1 of window "Keyboard & Mouse"
set intDefault to "0"
set strCmdKey to value of pop up button "Command (⌘) Key:"
if strCmdKey ends with "Command" then
click pop up button "Command (⌘) Key:"
click menu item "⌥ Option" of menu 1 of pop up button "Command (⌘) Key:"
delay 0.1
click pop up button "Option (⌥) Key:"
click menu item "⌘ Command" of menu 1 of pop up button "Option (⌥) Key:"
delay 0.1
click button "OK"
else
click button "Restore Defaults"
delay 0.1
click button "OK"
end if
end tell
end tell
end tell
tell application "System Preferences" to quit
--- End ---

Saturday, 8 November, 2008, 07:29 AM ( 1718 views ) - Geek - Posted by grifter
Finally, I got the Libretto 50 CT out of the storeroom.

I intend to use it for some coding and some mp3s.

So I installed linux on it without X, and turn on framebuffer for some occasional surfing. :P

To enable Framebuffer:

$ vi /boot/grub/menu.lst

add "vga=0x313" at the end of the kernel line.

To enable Sound:

$ apt-get install alsa-utils

You will get a mixer to adjust the volume.

Wednesday, 29 October, 2008, 07:28 AM ( 483 views ) - Geek - Posted by grifter
I want to backup my mail server automatically everyday inclusive of mail data, user data and system logs.

Here is how I do it.

$ vi /root/maintenance-scripts/sqlbackup

#!/bin/sh
mysqldump --databases postfix -u <USER> --password=<PASS> > /root/backup/postfix-`date +%Y-%m-%d` && gzip /root/backup/postfix-`date +%Y-%m-%d`

$ vi /root/maintenance-scripts/logbackup

#!/bin/sh
tar -cvf /root/backup/systemlog-`date +%Y-%m-%d`.tar /var/log && gzip /root/backup/systemlog-`date +%Y-%m-%d`.tar

$ vi /root/maintenance-scripts/mailbackup

#!/bin/sh
rm -rf /root/backup/vmail && cp -rf /home/vmail/* /root/backup/vmail && tar -cvf /root/backup/vmail.`date +%Y%m%d`.tar /root/backup/vmail && gzip /root/backup/vmail.`date +%Y%m%d`.tar

Next, cron it:

$ crontab -e

45 23 * * * sh /root/maintenance-scripts/sqlbackup &> /dev/null
50 23 * * * sh /root/maintenance-scripts/logbackup &> /dev/null
09 00 * * * sh /root/maintenance-scripts/mailbackup &> /dev/null

This is what happens.
At 9:00am, mail data will be backed up into /root/backup/vmail.<date>.tar.gz
At 11:45pm, Postfix SQL data will be backed up into /root/backup/postfix-<date>.gz
At 11:50pm, system logs will be backed up into /root/backup/systemlog-<date>.tar.gz

Sunday, 5 October, 2008, 07:28 AM ( 109 views ) - Geek - Posted by grifter
Copying, moving, deleting of files starting with -

$ cp -- -<file> <location>

$ mv -- -<file> <newfile>

$ rm -- -<file>

Wednesday, 24 September, 2008, 07:27 AM ( 173 views ) - Geek - Posted by grifter
If you install .NET Framework on a machine that already has IIS, its all good. IIS will automatically configure itself to handle ASP.NET pages and redirect to the ASP.NET runtime.

If you happen to be an moron like me that installed .NET framework and then install IIS afterwards, you may find that the ASP.NET pages will not be displayed.

Solution:

There is a utility that is packaged with .NET Framework but not documented.
It is located in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe.
You will need to issue this command: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Problem Solved.

| 1 | 2 | Next> Last>>