Monday, December 31, 2007

Mac OSX Server DNS and DNS Forwarding

Out of the box, Mac OSX Server sends all non-local queries to root DNS which is unfriendly, and also makes DNS lookups slower, since your ISP probably has the answer cached already.

To make OSX Server use your ISPs DNS as the next port of call for queries look for the 'options' section of the file 'named.conf' in '/etc' and add the 'forwarders' section. Restart DNS, from the Server Manager application if you want, and then look in the log window to see where DNS lookups are going.

options {
directory "/var/named";
recursion true;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
// ISP DNS

forwarders {
x.x.x.1;
x.x.x.2;
x.x.x.3;
};
};

Removing Duplicate lines in a file

Like many people I use Squid to:

- save bandwidth through caching

- controlling access to certain sites eg adware / tracking web sites by applying ACLs

A key 3rd purpose for me is to act as a concentrator / connector to an upstream service, Scansafe. Scansafe has the usual lists of web site categories, but the really useful (and desirable) element is that it does in-stream analysis of the pages the user requests.

This is critical because in the new web 2.0 world using lists simply won't work where anyone can upload content. In addition, lists do not work where a trustworthy site hosts link / content that has been compromised eg India Times.

One of the outcomes of this is that I have 2 sources of bad stuff I need to block: analysis of the squid logs, and analysis of the Scansafe realtime reports.

So what I do is copy them into the same file, and then use the following command to remove the duplicates:

awk '!x[$0]++' file > file.new

I got this command from nir_s on unix.com

(Hiding)The .app suffix extension in Apple Mac OSX

Logged on to OSX and saw that all the applications were for some reason showing a suffix eg firefox.app when it was never asked for.

In the finder, go to Finder > Preferences > Advanced, and toggle the "show all file extensions" setting.

Saturday, December 29, 2007

Apple Mac OSX with Bluetooth iGo Traveller Stowaway

Since the iGo Bluetooth keyboard is HID compliant, you can also use it with a Mac with OSX.

The process is quite straight forward. Start the discover process, and follow the instructions.

If it asks what kind of keyboard it is, if you take the instructions on finding the keys literally it will not complete the process.

Instead press the 'z' key and then instead of the '?' without a modifier, press 'shift + ?'.

The wizard asks what kind of keyboard it is, I selected 'ANSI (United States and Others)' and the wizard completed OK.

The keyboard works fine. The 'alt' key works exactly like a regular keyboard; the 'cmd' key is the 'apple' key. You even get a proper 'delete' key for forward delete.

Great!

Thursday, December 27, 2007

Apple Mac OSX, Darwine Font Problems, freetype

There is no doubt that running windows application under Mac OSX can be really useful. The commercial method is either to use Parallels or VMWare as virtual machines. An alternative is to use an API layer such as WINE.

Wine for OSX on Intel has two versions, Darwine and Crossover. Darwine is free (GPL) while Crossover is not. Darwine simply runs the API layer, Crossover has the concept of 'bottles' to keep some separation.

When I tried to use Darwine I got the following error, and my chosen test W32 application failed to launch:


'Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5. http://www.freetype.org'

So off I went to see if I can get freetype.

Turns out that an installer has been created which sorts all this out. THANKS!!

The reason this is not needed with Crossover is that Crossover uses its own X system.

UPDATE: well this got rid of most of the errors. After a bit more searching I decided to download and make the required freetype stuff:

1 - Download freetype: http://download.savannah.gnu.org/releases/freetype-2.1.10.tar.bz2.tar

2 - doubleclick in the finder and it extracts the tar and then the bz2

3 - CD into wherever you parked it and then

4 - ./configure && make && sudo make install

I restart X11 for good measure.

Wednesday, December 26, 2007

Apple Mac OSX Keyboard Mapping and NX Client

The combination of No Machine's Remote Desktop and thin clients is truly excellent. However using the OSX client has given people a lot of problems, specially keyboard mappings - basically the mapping is trashed and its impossible to use.

The workaround, tested with OSX v. 10.4.x and NX Client 3.0.x is to start X11 first then launch NX.

Tuesday, December 25, 2007

Using Sarg to convert Squid dates/time to readable form

Squid uses unix style date/times in its logs, which isn't human readable.

You can use SARG to convert these into regular dates and times:

1 - cd into the sarg logs directory:

cd /applications/sarg/logs

2 - run the command

/applications/sarg/bin/sarg -convert access.log > friendlydates.access.log

Thursday, December 20, 2007

Nokia N800 and iGo Traveller Stowaway Bluetooth Keyboard

I got my Nokia N800 the other day, and also purchased the iGo Stowaway bluetooth keyboard on Ebay. Their web site doesn't mention N800 compatibility, but enough resources suggested that both the iGo and the N800 are HID compliant that it was worth a go.

After unpacking and putting the batteries in, the next step was to pair the 2.

First you go into the control panel on the N800, and with 2007 firmware (2008 is different), select 'Hardware Keyboard'. Make sure 'Generic 105-key PC' and 'English USA' are selected. If you try to select a different keyboard layout (I tried initially tried English (United Kingdom)) when you pair you will get a 'pairing failed, device resources exceeded' message.

Then go to the Bluetooth panel of your N800 and search for new devices.

Make the keyboard is discoverable by pressing 'CTRL and BOTH Fn' Keys until the green LED flashes.

It finds the Stowaway keyboard, offers to pair and gives you a code. Click OK on the N800, and then on the keyboard, hold down Left FN + number keys to type in the code. Press Left FN + Enter.

The N800 is now paired.

The very nice thing about having a bluetooth keyboard is that when you want to enter text on the N800 it doesn't use 1/3 of the screen as a soft keyboard.

Update: You can also use the iGo with a bluetooth enabled Apple Mac. Instructions
from my Macbook Pro here