Onto Norton 360…
20th October 2007ZoneAlarm cut off VMware's access to the internet, so it was time to reinstall it. However, I messed up the reinstallation and now there seems no way to reinstate things like they were without tampering with my Windows XP installation status, and I have no intention of doing that. The thing seems to think that it can start a TrueVector service that does not exist.
Since I have to have some security software on board, I made a return to the Symantec fold with my purchase of Norton 360. That does sound extreme, but I have been curious about the software for a while now. You get the usual firewall, antivirus and antispam functions with PC tuning, anti-phishing and backup features available as well. It is supposed to be unobtrusive, so we'll see how it goes from here.
Update:
PC Pro rates the software highly, while Tech.co.uk accuses it of being bloatware. Nevertheless, the only issue that I am having with it is its insistence on having Microsoft Update turned on. For now, I am sticking with Shavlik's NetChk Protect, especially seeing what Microsoft has been doing with its update service. Have a look at Windows Secrets.com to see what I mean. Other than that, it seems to working away in the background without intruding at all.
Filename autocompletion on the command line
19th October 2007The Windows 2000 command line feels an austere primitive when compared with the wonders of the UNIX/Linux equivalent. Windows XP feels a little better, and PowerShell is another animal altogether. With the latter pair, you do get file or folder autocompletion upon hitting the TAB key. What I didn't realise until recently was that continued tabbed cycled through the possibilities; I was hitting it once and retyping when I got the wrong folder or file. I stand corrected. With the shell in Linux/UNIX, you can get a listing of possibilities when you hit TAB for the second time and the first time only gives you completion as far as it can go with certainty; you'll never get to the wrong place, though you may not get anywhere at all. This works for bash, but not ksh88 as far as I can see. It's interesting how you can take two different approaches to reach the same end.
Numeric for loops in Korn shell scripting: from ksh88 to ksh93
18th October 2007The time-honoured syntax for a for
loop in a UNIX script is what you see below, and that is what works with the default shell in Sun's Solaris UNIX operating system, ksh88.
for i in 1 2 3 4 5 6 7 8 9 10
do
if [[ -d dir$i ]]
then
:
else
mkdir dir$i
fi
done
However, there is a much nicer syntax supported since the advent of ksh93. It follows C language conventions found in all sorts of places like Java, Perl, PHP and so on. Here is an example:
for (( i=1; i<11; i++ ))
do
if [[ -d dir$i ]]
then
:
else
mkdir dir$i
fi
done
Detecting file ownership in Korn shell scripts
17th October 2007I recently was having a play with using a shell script to do some folder creation to help me set up a system for testing, and I started to hit ownership issues that caused some shell script errors. At the time, I didn't realise that there is a test that you can perform for ownership. The "-o" in the code below kicks in the test condition and avoids the error in question.
if [[ -o $dirname ]]
then
cd test
for i in 1 2 3 4 5 6 7 8 9 10
do
if [[ -d study$i ]]
then
:
else
mkdir study$i
fi
done
ls
cd ~
fi
Previously, I shared a way to test for directory (-d operator) and file (-f operator) existence that follows the above coding convention. However, there are a plethora of others and I have made a list of them here:
Operator | Condition |
-e file |
File exists |
-L file |
File is a symbolic link |
-r file |
User has read access to file |
-s file |
File is non-empty |
-w file |
User has write access to file |
-x file |
User has execute-access to file |
-G file |
User's effective group ID is the same as that of the file |
file1 -nt file2 |
File 1 is newer than file2 |
file1 -ot file2 |
File 1 is older than file2 |
file1 -et file2 |
File 1 was created at the same time as file2 |
It's all useful stuff when you want to rid the command line output of errors in an above board way. These are the kinds of things that often make life easier...
Negative logic in Korn shell scripts
16th October 2007I was looking for a way to negative logic, doing something when a condition is not satisfied, that is, and found that the way to do it is to do nothing when the condition is satisfied and something when it isn't. Being used to saying do something when a condition is false, this does come as a surprise. In time, I may find another way on my UNIX shell scripting journey. Meanwhile, the code below will only create a directory when it doesn't already exist.
dirname=test
if [[ -d $dirname ]]
then
: # the colon operator means do nothing
else
mkdir test
fi
Changing the appearance of WordPress admin pages
15th October 2007There appears to be a percolation of plugins that aim to change the appearance of WordPress administration pages from their day-glow blue to something more pleasing; Earthtones is the one that I use for this blog, but I have also been known to use WP Tiger Administration as well. Both options work well, though the latter needs some adjustments to work as well with WordPress 2.3 as it does with the 2.2 line.
One area that they both fail to influence is the appearance of the upload screen. It doesn't help that upload.php, the underlying PHP script, is a dual-purpose animal: used in an iframe in the post editing page and standalone for upload management. Curiously, you can only upload files on the post editing page and not on the upload management screen, a definite quirk. The thing that really stops these admin theme plugins gaining any sort of purchase with upload.php is that it also uses an auxiliary stylesheet, upload.css, that is called after the WordPress function hook has been defined; if it came before this, then the styles in upload.css could be overridden.
While you could edit upload.php and edit the replacement stylesheet, the former activity would require repeating at every WordPress upgrade. I chose to edit upload.css and will keep that is a safe place so that I can replace the file following an upgrade. If upload.php was treated like every other admin script, then this would be unnecessary. A useful suggestion for Automattic, perhaps?
New FileZilla
14th October 2007First, I must admit that the release of FileZilla 3 passed me by until recently. From the user interface point of view, the changes don't look too radical, but it is now cross-platform, a bonus for Linux and Mac users. It can also co-exist with FileZilla 2 for those Windows users needing features from that offering that aren't yet available in FileZilla 3. That does pose the question: why upgrade when that which you have works just as well? It is just as well that transferring settings is as easy as importing the FileZilla 2 settings into its successor is as easy as importing an XML file: in version 3, go to Edit > Import... on the menus and pick up the FileZilla.xml file from the installation directory for version 2. Though you might get some warnings and I certainly did, the FTP sites that I had set up already came over intact.
LVHA…
12th October 2007On my web design journey, I have learned the wisdom that CSS styles for hyperlinks should be defined like the following:
a:link {...}
a:visited {...}
a:hover {...}
a:active {...}
List out the names of the pseudoselectors, and you'll soon work out where they got LVHA: Link, Visited, Hover and Active. However, I have recently spotted the following being used:
a {...}
a:hover {...}
The trick here is to define your style globally and only define specifics for the relevant pseudoselector, hover in this example. It works well in the likes of Mozilla and Opera, but Internet Explorer is another story. Even IE7 needs the LVHA treatment. I spotted this when I observed unexpected changes in the appearance of link text after visiting the link: visited links starts to change colour. While I know that the likes of Jakob Nielsen frown upon non-changing link colour, I choose to ignore this and keep it constant, so following the LVHA approach is needed to keep things as I would like them.
Is Apple ditching Windows 2000?
11th October 2007Having had a brainwave of using my Windows 2000 VM to play music without impacting the rest of my PC's working, I made the discovery that a bit of digging was required to find a version of iTunes and QuickTime that work with Win2K. Google delivered the goods, so here are the links:
It all reminds me of a post that I wrote a few months back, but iTunes is now working and, thanks to VMware's Shared Folders functionality, using the host PC's digital music collection. I'll be seeing how the ring-fencing goes...
Accessing the host file system from a VMware virtual machine
9th October 2007I am very surprised at myself for not realising until recently that there is a way to make host data visible to a guest operating system installed in a VMware virtual machine other than resorting to using flash drives, CD's, DVD's and the like. Though you can copy and paste from the host into the VM, I have found that to be hit-and-miss at times. It was a revelation to find VMware's Shared Folders function. My suspicion is that you need VMware Tools installed in the guest operating system to make it work, which may not be trivial for some Linux distributions or UNIX. However, I was using it with a Windows 2000 guest and a Windows XP host, and it worked like a dream.
What you see below are the shared folder settings in the host's VMware interface for that virtual machine. Just clicking on the Add... button brings up a wizard that will set up the shared folder for you; it's all very user-friendly. Look for the Edit virtual machine settings link on the VM configuration page, click that and pop over to the Options tab and this what you can get.
The result of the above spot of configuration appears in Windows Explorer like it does below. Not only are the shared folders accessible in this way, but you can also map drive letters as if they were network resources, a very nice feature. It is definitely more accessible than working out Windows networking and getting things to happen that way.