User your own timezone in Linux shell

Do you use a hosting provider that has a different timezone than you do? You can change the appearance of the timezone easily, without root access, or playing around with dates and times.

You can use the tzselect command. It will ask you for your Continent, your State/Province, and will output the command you need to modify your timezone.

I live in Brisbane, Australia, so my timezone is Australia/Brisbane. All I needed to do what append one line to my .bash_profile

echo “export TZ=Australia/Brisbane” >> .bash_profile

Now date returns the correct date and time, and all my files have local timestamps.

Fixing partition table in linux with sfdisk

Manipulating partition tables on MS-DOS labelled hard disk (the most common type as of this writing) is an extemely important skill to have as a System Administrator. If one or more partitions gets deleted or modified in an unintentional way, it is imperative that one know how to restore or modify the partitions to rectify the problem.

Continue reading

PAX: the universal UNIX and GNU Linux archiver

pax, which means peace in Latin, combines the best of both cpio and tar, which are found in nearly all modern GNU/Linux distributions. However, it appears as though it hasn’t been updated in several years!

Benefits include:

  • can use ‘find’ to get list of files, which is then piped through to pax (cpio style)
  • can read and write many archive formats, including ustar (default), cpio, and many others
  • can do copy-pass mode (copy entire directory tree to another location)
  • can do gzip compression on the fly (tar style)

man pax will show you more example

I suggest big corporations, and important public services stop using insecure operating systems

On April 21, 2010, beginning at approximately 14:00 UTC, millions of computers worldwide running Windows XP Service Pack 3 were affected by an erroneous virus definition file update by McAfee, resulting in the removal of a Windows system file (svchost.exe) on those machines, causing machines to lose network access and, in some cases, enter a reboot loop. Mcafee rectified this by removing and replacing the faulty DAT file, version 5958, with an emergency DAT file, version 5959 and has posted a fix for the affected machines in their consumer knowledge base. The University of Michigan’s medical school reported that 8,000 of its 25,000 computers crashed. Police in Lexington, Ky., resorted to hand-writing reports and turned off their patrol car terminals as a precaution. Some jails canceled visitation, and Rhode Island hospitals turned away non-trauma patients at emergency rooms and postponed some elective surgeries. Australian supermarket behemoth Coles reported that 10 percent (1,100) of its point-of-sales terminals were affected and was forced to shut down stores in both western and southern parts of the country.

http://en.wikipedia.org/wiki/McAfee#History

Amarok cannot connect to MySQL database

I deleted all instances of ‘amarok’ in $HOME/.kde4/share, and dropped the ‘amarokdb’ database, and dropped ‘amarokuser’, and re-created everything, but it still wouldn’t connect.

It turns out the solution is simple. Just change the password in the Amarok settings page from ‘password’ to something else (e.g. ‘password123’). Change the ‘amarokuser’ password, too, in mysql. Restart Amarok, and they can connect.

This is a bug in Amarok, as it doesn’t have a default password configured, one must be explicitly set.  Source