26
Jan
2009
Author: willem
In: apple, applescript, tools
The Mac Tricks and Tips website had a great tip on how to quickly resize multiple images on your Mac using an AppleScript:
Open the Script Editor application (a quick way to do this is by searching for it with Spotlight), then copy the following code into the editor:
-- save in Script Editor as an Application, then
-- drag image files onto the Application's icon
on open some_items
repeat with this_item in some_items
try
rescale_and_save(this_item)
end try
end repeat
end open
to rescale_and_save(this_item)
tell application "Image Events"
launch
set the target_width to 120
-- open the image file
set this_image to open this_item
set typ to file type of this_image
copy dimensions of this_image to {current_width, current_height}
if current_width is greater than current_height then
scale this_image to size target_width
else
-- figure out new height
-- y2 = (y1 * x2) / x1
set the new_height to (current_height * target_width) / current_width
scale this_image to size new_height
end if
tell application "Finder" to set new_item to (container of this_item
as string) & "scaled." & (name of this_item)
save this_image in new_item as typ
end tell
end rescale_and_save
If you want to change the size the output image will have, you need to change this line:
set the target_width to 120
Click the “Compile” button on the toolbar and wait until the purple text color is replaced by blue and green (this indicates that the code compiled without any errors).
Click the File menu and choose Save, then save the script as a script file so you have a copy of the source code. Click the File menu again, choose Save As, and save the script as an Application (you could create a differently named Application from this script for each change you make to the target_width variable in the source code).
To run your new application simply drop an image file on it to have a resized copy of the image created in the folder the application is stored in.
24
Jan
2009
Author: willem
In: linux, tools, unix
Darkstat is a packet-sniffing daemon for UNIX machines that collects network traffic statistics and can display them as HTML pages.
For this example I installed and configured Darkstat on an Ubuntu 7.10 (Gutsy Gibbon) machine, but the same procedure should work for most Debian-based Linux distributions:
Darkstat can be installed with apt-get by opening a new Terminal window and running the following command:
sudo apt-get install darkstat
After the package has been downloaded and installed, you need to modify it’s configuration file in a text editor by running this command:
sudo nano /etc/darkstat/init.cfg
Change this line:
To this:
Then press control-X (to quit the text editor) followed by Y (to save your changes) and Enter (to overwrite the existing file).
Finally, you need to start the Darkstat daemon by running this command:
sudo /etc/init.d/darkstat start
Any computer on your network will then be able to view Darkstat’s HTML output by pointing a web browser to the IP address (and port 666) of the machine Darkstat is installed on.
In my case, I had to enter “10.0.0.119:666″ in my browser’s address bar to see this page:

Darkstat can present your traffic data in several views:



The Darkstat daemon should stay running if you want it to collect network statistics, but if you need to turn it off you can use this command:
sudo /etc/init.d/darkstat stop
24
Jan
2009
Author: willem
In: tools, web development
If you’ve ever seen text in an image or on a website and wanted to find the name of the font or similar fonts, you”ll find myfonts.com’s What The Font tool very useful. Simply upload an image or enter a URL, and What The Font will analyze the content and show you possibilities of what the font could be.
23
Jan
2009
Author: willem
In: tools
If you occasionally need to configure Internet access for people who want to tether their cellphone to their laptop on a South African network, you might want to keep this list of connection settings for South African mobile providers close by:
Cell-C
APN: internet
Username: guest
Password: guest
DNS: 196.7.0.138, 196.7.142.132
SMTP: -
MTN
APN: internet
Username: guest
Password: guest
DNS: 196.11.240.241
SMTP: mail.mtn.co.za
Vodacom
APN: internet
Username: guest
Password: guest
DNS: 196.207.40.165, 196.43.46.190
SMTP: smtp.vodamail.co.za
Vodacom (VPN)
APN: internetvpn
Username: guest
Password: guest
DNS: 196.207.40.165, 196.43.46.190
SMTP: smtp.vodamail.co.za
Virgin Mobile
APN: vdata
Username: guest
Password: guest
DNS: 196.7.0.138, 196.7.142.132
SMTP: mail.cmobile.co.za
22
Jan
2009
Author: willem
In: linux, tools, unix
I’ve heard great things about TrueCrypt, the free open source encryption software that’s available for Windows Vista / XP, Mac OS X, and most distributions of Linux.
TrueCrypt has several features, including:
- Automatic, real-time, transparent encryption
- Creating a virtual encrypted disk within a file and mounting it as a real disk
- Encrypting an entire partition or storage device such as a USB flash drive or hard drive
- Encrypting a partition or drive where Windows is already installed
- Hidden volumes (steganography) and hidden operating systems
- TrueCrypt volume data cannot be distinguished from random data on the storage device
- AES-256, Serpent, and Twofish encryption algorithms in XTS mode of operation
Their steganography and hidden operating systems features are especially useful for sensitive data: You can install a real and a dummy OS and hide the real one with TrueCrypt so it looks like random data on the storage device. When you turn the computer on, you will be prompted for a password, and if someone forces you to enter your password, you simply enter the password for the dummy operating system (which contains no sensitive files). Without the password for the real operating system, no-one can get access to your data or even know that it is on the machine.
For more information or to download the software, visit their website here.