Archive
System Maintenance

When you start up Ter­mi­nal, does it take over 10 sec­onds or so before the prompt appears?

Turns out the Terminal.app stores logs of pre­vi­ous ses­sions and over time this grows. Even apps like Main­Menu, that delete the "User Cache", do not delete these files.

These files are stored in an eso­teric loca­tion, hid­den from the reg­u­lar user. The files have the .asl file extension.

Here's the command.


sudo rm -f /private/var/log/asl/*.asl

Exe­cute that in a Ter­mi­nal win­dow. Then quit and restart Ter­mi­nal. No more delays or lags. Much faster Ter­mi­nal. The lack of logs to seek really speeds up Terminal.

This has been tried and tested in Snow Leop­ard, Leop­ard and OSX Lion. Won­der why Macs don't come with this already!

Read More

I use the Nokia e61i as my mobile. Instead of my telco's data plan (which offers me a mea­gre 1GB per month) I sim­ply pre­fer to use my home wire­less LAN when I am at home. Until recently I used the wire­less "access point" with­out any secure set­tings, but have had to move to WEP now due to cheeky neighbors.

Prob­lem: Nokia's WLAN option kept prompt­ing me for the WEP key *every­time* I would con­nect to my email or any website.

After googling for a good many days and bum­bling around on Nokia's forums, I have finally fig­ured out how to make Nokia remem­ber the cotton-picking pass­word. Sim­ple answer: you need to lose your cached WLAN entry, which may be stored as a non-WEP access point.

Here are the more detailed steps:

  1. Delete your cur­rent WLAN access point you've cre­ated for the E61i. This is the secret sauce.
  2. Now, under

    Tools > Settings > Connection > Access Points

    Select Options and cre­ate a new access point using "default set­tings". We'll tweak them below.

  3. Under Con­nec­tion Name, pick a name for your con­nec­tion. This doesn't have to be your wire­less network's SSID, but you can keep it under the same name.
  4. Under Data Bearer, select WLAN.
  5. Under WLAN Net­work Name, select man­ual entry and type in your SSID name.
  6. Under Net­work Sta­tus mark "Hidden".
  7. Net­work Mode will be the default: "Infrastructure".
  8. Under WLAN Secu­rity Mode, choose your secu­rity type. For instance, mine is WEP, so that's what I selected.
  9. Under WLAN Secu­rity Set­tings, go to WEP key set­tings and define your encryp­tion level, for­mat, and key. For instance, for WEP you might have 64 bit, ASCII, and "xyz­abc" as your level, for­mat, and key respec­tively. If you don't know this stuff, this entire tuto­r­ial is per­haps not for you, oth­er­wise you know what these val­ues are. (You can always login as admin user into your wire­less router and recon­firm these set­tings for your spe­cific case.)

That's it. You can now con­nect to some web­site or your email server on your mobile phone, select the WLAN with the name you chose in Step 3 above, and your Nokia e-series phone will remem­ber your WEP pass­word for good. Finally.

Read More

As it says on the tin:

Update: Here's a great list of things to do.

  1. Main­Menu. Free. Superla­tive. Cre­ates a neat lit­tle menu item on the top bar. Bet­ter than most other tools I have tried for this pur­pose, espe­cially in its clean inter­face. Some­times, if you have the plea­sure of expe­ri­enc­ing a sit­u­a­tion when the Trash won't clean because OSX says that the "Appli­ca­tion is still in use" but you're sure you quit it and it's not live any­way, MainMenu's "Force Empty Trash" is a fab­u­lous tool to have at your fin­ger­tips.
  2. Lit­tle Snitch: Tells you every­time some pro­gram on your machine wants to "call home" and con­nect to some server. Great flex­i­bil­ity in allow­ing the pro­gram to con­nect to a server, a port, or in gen­eral. Allow (or Deny) it to con­nect only once, or until the appli­ca­tion quits, or For­ever.
  3. RCDe­fault­App: Just as it is on any OS from Win­dows to Ubuntu, it often hap­pens that you would like to asso­ciate cer­tain file types with cer­tain appli­ca­tions. On Mac OSX, we do have the same right-click con­tex­tual menu as Win­dows that allows "Open with [Appli­ca­tion]" and "Make this the default appli­ca­tion", but for some rea­son this doesn't always work, and occa­sion­ally doesn't even show up as an option. No mat­ter. RCDe­fault­App is the appli­ca­tion that allows you to do that superbly, and then some.
  4. But­ler: Another small util­ity with a neg­li­gi­ble foot­print that allows for some nifty short­cuts to stuff already on your machine.
  5. Per­ian: No Mac should be with­out this. This pretty much explains itself. There's a nice video tuto­r­ial here that shows how easy it is to install and then for­get it. Sud­denly your Quick­time (and iTunes) will be able to play a whole raft of video for­mats. If you want to be really equipped, get the Divx codec, the 3ivx, and Flip4Mac which plays wmv (Win­dows Media Player) files on your Mac. Of course if you get really frus­trated there's always the tried and tested VLC Player.
  6. CleanApp: The best appli­ca­tion unin­staller out there, hands down. Don't believe for a minute when the OSX man­u­als tell you that on a Mac all you need to do is drag the appli­ca­tion into the Trash and you're done. BS. Many appli­ca­tions (think Adobe) install sev­eral things in sev­eral loca­tions. CleanApp 3 tells you all the asso­ci­ated trap­pings of these appli­ca­tions and allows you to unin­stall them all together.CleanApp is not free, alas (there is always a poor man's App­Cleaner, which does some basic stuff) but it allows for much more gran­u­lar con­trol. The best part: CleanApp has a "Log­ging" ser­vice that keeps track of what­ever you install, and then knows in gran­u­lar detail every­thing that you need to unin­stall later; you can enable and dis­able this log­ging ser­vice at will, so it is use­ful to keep it gen­er­ally off and only switch it on before you are under­tak­ing a seri­ous install of soft­ware, such as Final Cut Pro from Apple for example.
  7. Tin­ker­Tools: To mod­ify the many sys­tem pref­er­ences in your OSX that should have been made tinker-able but are not. Us Win­dows switch­ers are used to mod­ding every­thing, so this is a fab­u­lous tool.
  8. Trans­mis­sion: The best tor­rent client for OSX. Very sim­ple, no-nonsense, and yet pretty inter­face. BitRocket is all google-juiced as it has been around longer, but it went down more often than Paris Hilton's pants.  Limewire now has an OSX ver­sion too, but I am done with crash­ing and slow down­load speeds unless you cough up a few dol­lars.
  9. Candy Bar: If you really, really want to mod­ify your icons. Panic is one of the bet­ter soft­ware devel­op­ers for the OSX plat­form. Their Uni­son tool, a native OSX Usenet client is pure code poetry. There's a lot of iconog­ra­phy avail­able at their part­ner web­site Icon­Fac­tory. Can­dy­Bar is not free though. If you are short on cash, you can always try the some­what bare­bones Lite­Icon.
  10. Vienna: The best and most ele­gant RSS reader client for OSX at the moment. Now if only they could sync it with Google Reader, Bob might be my uncle. How long has the Google API been out now!?
  11. Chicken of the VNC: The best VNC client out there, con­nects with­out prob­lems to Win­dows VNC servers too.

  12. Omni­DiskSweeper: As you start using your OSX, and installing appli­ca­tions and such, your hard disk usage keeps mount­ing (no pun intended). The fast, small foot­print Omni­DiskSweeper does this job faster than any­thing else on the mar­ket, includ­ing the some­what visu­ally pret­tier What­Size.
  13. Mono­lin­gual: Like Win­dows, OSX also comes with about a gazil­lion lan­guages pre­in­stalled, which take sev­eral giga­bytes on your hard disk. Like­wise, OSX the oper­at­ing sys­tem also comes with a num­ber of archi­tec­tures such as Pow­erPC even if you have an Intel sys­tem, because the same OS needs to sup­port older Apple hard­ware. Any­one who has bought a new sys­tem with Intel's archi­tec­tures (the lat­est Mac­books or iMacs) can safely get rid of the other archi­tec­tures. Mono­lin­gual is a sim­ple, free util­ity that does exactly that.
  14. Tech Tools Pro: Expla­na­tion com­ing soon.
Read More

Any­one who runs hosted remote servers and has to log into remote ter­mi­nals for reg­u­lar use, it is vital to have short­cuts that allow for quick login. SSH2 is the rec­om­mended way.

On Win­dows, there is the fan­tas­tic SSH2 tool Secure­CRT. Or if you're cash crunched, a com­bi­na­tion of Putty and Putty Con­nec­tion Man­ager works for many.

On Mac OSX and Unix/Linux sys­tems, one doesn't truly need an SSH client at all, because the "Ter­mi­nal" appli­ca­tion is inbuilt. Peo­ple talk of iTerm and such, but I have still to see a value add for such tools.

But one does miss the con­ve­nience of Secure­CRT on OSX, because I have still to find a true Secure­CRT alter­na­tive for the Mac plat­form. Some­thing that allows me to make pre-determined con­nec­tions so I can just click on them to con­nect (which tools like Jel­ly­fiSSH do) and then logs me in directly with­out prompt­ing for a pass­word (which Jel­ly­fiSHH does not do).

So I have sim­ply made aliases in my [code].profile[/code] file, which gets exe­cuted every­time you start your Ter­mi­nal win­dow (so it's a good place to put your short­cuts and any code you wish to exe­cute when the ter­mi­nal starts, such as paths).

  1. Start the Terminal.
  2. Open the pro­file file for the cur­rent user (you).
  3. pico .profile
  4. Enter a new line for our shortcut.
  5. alias s='ssh -2 -p 22 user@host.com'

Quick expla­na­tion for that com­mand in step 3. The let­ter "s" is the short­cut I make for con­nect­ing to the sniptools.com server. Change it to what you wish. This will mean that when I start Ter­mi­nal, all I need to do is type "s" and it con­nects me via SSH to the sniptools.com server. The "-p" switch is an impor­tant one because some of us with para­noid secu­rity set­tings might have a dif­fer­ent port num­ber than the default port 22 for secure SSH. The rest user/host stuff is self-explanatory. The "-2" is to force SSH2 con­nec­tions instead of older vanilla SSH.

Now. Save the pro­file file and source it to try it out:

source .profile

Sourc­ing is only for this one time, for your cur­rent Ter­mi­nal win­dow, which had already exe­cuted the pro­file file *before* we added this alias. When you start a new Ter­mi­nal ses­sion, these aliases et al will be auto­mat­i­cally set for you.

Done. Now your pro­file has the alias for "s". From now when you type "s" in your Ter­mi­nal, it will con­nect, but it will ask you for a pass­word. To get rid of the nag­ging pass­word, we need to cre­ate pub­lic authen­ti­ca­tion key for the domain. This, in fact is what Secure­CRT does behind the scenes on Win­dows too.

Here are the steps to accom­plish this. Run these one-time com­mands in order from the Ter­mi­nal window.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# generate pub and priv keys, leave the passphrase empty
# (simply press ENTER when asked for it)
ssh-keygen
 
#copy the pub key to the remote computer
#(change port number if different from the usual 22)
#change "user" to your user name
#change "host" to your domain name
scp -P 22 ~/.ssh/id_rsa.pub user@host:~/
 
#log on to the remote computer
ssh -p 22 user@host
 
#create the .ssh directory in the root login directory, if it doesn't already exist
mkdir .ssh
 
#append key to file
cat id_rsa.pub >> ~/.ssh/authorized_keys
 
#delete the public key file, no longer needed
rm -f id_rsa.pub
 
#log off the remote server
exit
 
#logon to the remote server, without password prompt
ssh -2 -p 22 user@host

That's it. This is a huge time­saver. Now all I need to do to login to the sniptools.com server is type one let­ter, "s" in the Ter­mi­nal, and I'm on! Fol­low these instruc­tions for each host you con­nect to on a reg­u­lar basis and you'll love the con­ve­nience henceforth.

Read More

So I finally got around to installing Office 2007. This is what it looked like:

Office 2007 - First Look

Office 2007 — First Look

Now I don't know about you, but to me this bloo-ey look is hideous.I am not on Vista yet, by choice, so that sky blue gra­da­tion thing going on the top was not my cuppa. Why soft­ware designed for a cer­tain plat­form can­not honor a user's gen­eral sys­tem UI pref­er­ences is beyond me, but Office 2007 does insist on hav­ing it's own look and feel. As though the new rib­bon clut­ter was not enough.

I wanted to get rid of those rib­bons to begin with. So I down­loaded the the free ver­sion of Rib­bon Cus­tomizer. They offer some Pro ver­sion but it does things I don't par­tic­u­larly care about. Alter­na­tively, there is Tool­bar­Tog­gle, but on their site I did not seem to catch a free ver­sion, and I was unwill­ing to pay for this stuff.

The Rib­bon­Cus­tomizer install is pretty straight­for­ward and when you start Word 2007 after its instal­la­tion, here is how Word looks. There is an addi­tional item in the View menu at the end:

Word 2007 after RibbonCustomizer

Word 2007 after RibbonCustomizer

I clicked on the obvi­ous menu option to make Clas­sicUI my first menu tab. This is what this does:

Classic 2003 interface

Clas­sic 2003 interface

That's a good start, but I now wanted to clean up some other stuff. For­tu­nately, Microsoft chose to include the addi­tional "Min­i­mize Rib­bon" fea­ture, which con­tex­tu­ally hides the rib­bon when your focus is on writ­ing inside the doc­u­ment. So let's do that:

Minimize the Word 2007 ribbon

Min­i­mize the Word 2007 ribbon

Now to get rid of the forced Blue. Click on the "More Com­mands" option in the menu shown in the screen­shot above. Choose Sil­ver and make other adjust­ments to your taste:

Choose silver

Choose sil­ver

Now this is what Word 2007 looks like, with min­i­mized rib­bon, clas­sic 2003 UI, and a some­what less intru­sive sil­ver gradient:

Phew. I also rec­om­mend set­ting the default "Save" options as your reg­u­lar Word ".doc" instead of the new ".docx" (or other .xlsx and .pptx equiv­a­lents) as that is a bit more stan­dard even today in 2008.

Read More

Quite sim­ple. As it says on the tin. OSX will often try to "intel­li­gently" asso­ciate your files with the soft­ware most likely to be able to open it. But this is not what you always want.

For instance, I do not want *.png files open­ing up with Adobe Fire­works just because I use the soft­ware to cre­ate new ones.

Here's a mighty use­ful app that allows you to set the default appli­ca­tions for file exten­sions, or mime type, or most com­mon uses (such as "Email", "Brows­ing") etc. It sits snugly within the "Sys­tem Pref­er­ences" and is quite easy to access.

How it looks:

Default Apps in OSX

Click on the image to go to the developer's website.

Read More

I used the excel­lent "Mono­lin­gual" on OSX to delete unnec­es­sary lan­guages from my iMac. I could have sworn I did not delete the Japan­ese input sys­tem, Koto­eri. But turns out I had.

To rein­stall it, I vis­ited the usual forums and searched Google. No solu­tion. No down­load­able file.

Well, the solu­tion is simple.

  1. Insert DVD 1 of your orig­i­nal Mac OSX software.
  2. Click into the folder "Optional Install".
  3. Click on "OptionalInstalls.mpkg".
  4. Expand the menu item "Lan­guage Translations".
  5. Choose "Japan­ese".

That's it. It should install the input menu in about 2 min­utes. When you're done, eject the DVD and click on the "Inter­na­tional" option in your Sys­tem Preferences.

If the option does not show as Eng­lish (romaji) "Koto­eri", it should show up as orig­i­nal Japan­ese as in the screen­shot below:

Read More

So you're try­ing to delete a huge list of files and see­ing this error. It's a lim­i­ta­tion of your ker­nel, because your OS can­not han­dle too many files at once.

The solu­tion is sim­ple. Use the fol­low­ing command:

find . -name 'dos-*' -print0 | xargs -0 rm

Where "dos-" is a string con­tained in the files you wish to delete. That should do it.

Sug­ges­tion: for log fold­ers that fill up quickly, e.g., the logs of a data­base or Apache mod­ules such as mod_evasive, it's usu­ally a good idea to auto­mat­i­cally remove the files older than a cer­tain num­ber of days. For instance, to remove all log files in the mod_evasive folder older than 2 days, use this com­mand in the crontab:

01 01 * * * find /var/log/apache/mod_evasive/* -mtime 2 -exec rm {} \; > /dev/null 2>&1
Read More

Sim­ple lit­tle trick to get to the lat­est version.

Most Cpanel/WHM servers come with PHP and Zend installed. With the recent (and impor­tant) update of PHP 5.2.1, the Zend Opti­mizer that is installed by default (ver­sion 3.0.1 as of this writ­ing) breaks.

You might begin to see a mes­sage like this:

[26-Apr-2007 10:32:49] PHP Warn­ing: Zend Opti­mizer does not sup­port this ver­sion of PHP — please upgrade to the lat­est ver­sion of Zend Opti­mizer in Unknown on line

To fix this, sim­ply login to your SSH as root and exe­cute the fol­low­ing com­mand to upgrade Zend Optimiser:

/scripts/installzendopt 3.2.8

Note that if you skip the ver­sion num­ber, Zend Opti­mizer 3.0.1 will be installed by default. The trick is to spec­ify the ver­sion as above. This will also work in the future, so as long as you know the lat­est released ver­sion of Zend Opti­mizer, just replace the red text above with that number.

Read More

Inter­est­ing post from ZDNet buoys an impor­tant con­cept to know, but only barely scratches the sur­face of the issue.

Read More