Archives for: October 2011

How to make any webpage your Mail signature

29/10/11 | by admin [mail] | Categories: Mac OS X

This works for Apple Mail in 10.5 and 10.6 at least, not tested on other versions. You might have issues with Lion, because the Library folder is now hidden by default.

Mail stores its signatures as Safari webarchive bundles. This means that you can save any Safari readable page (including all the images, links, text, CSS, etc) as a webarchive and use it as a signature in Mail. This is very handy, as it means you don't need to use the somewhat limited built in signature editor to create your signatures. It also means that for a large deployment of signatures, you can create webpage that takes variable input and use that to create standard signatures across all users. As simple as a basic form asking for Name, Job Title, Phone or whatever, that then gets output in a pretty webpage that can be saved as a webarchive.

Now, how to do this more or less easily.

Step 1. Open Mail
Step 2. Go to the Mail menu, and select Preferences
Step 3. Click the Signature tab
Step 4. Click the Plus button at the bottom left of the window to create a new signature (this is just a place holder file which we will replace with the webarchive). It will show up under "All Signatures" and you can optionally rename it from "Signature #1" (or whatever) to 'anything you like'.
Step 5. Assign the new signature to an email account or accounts by dragging and dropping it from the "All Signatures" list to an account or accounts in the pane on the left.
Step 6. Optionally set it as the default signature for an account, by clicking on the account in the pane on the left, then using the "Choose Signature" selector to set it as the default signature.
Step 7. Close the Preferences window.
Step 8. Quit Mail

Step 9. Open Safari
Step 10. Browse to the webpage you wish to use as your signature
Step 11. Go to the File menu in Safari and select Save As
Step 12. Now this is the slightly tricky bit, we need to find the placeholder signature file we created in Step 4, and save over the top of it. So, navigate to ~/Library/Mail/Signatures, sort by date and select the newest file signature (NOT THE PLIST FILE, that will screw up your signature settings), make sure the format is set as webarchive and click save.
a. Click the arrow next to the filename until it is pointing down.
b. Click your home folder from the list in the pane at the left
c. In the middle pane, double click Library
d. double click Mail
e. double click Signatures
f. click the list view (the button with the horizontal lines, middle of the set of three buttons to the right of where it says "Signatures")
g. click the "Date Modified" column to sort by date
h. click the file with the gibberish name (a set of random letters and numbers which is the GUID for the signature) with the most recent date. DO NOT CLICK THE SignaturesByAccount.plist file.
i. Make sure the format is set as "Web Archive"
j. Click save
Step 13. Reopen Mail
Step 14. Create a new Mail message and check that the webpage you have just saved as a signature shows up correctly.

Bonus extra information. When you create a new signature in Mail, it is assigned a GUID as the filename (well, GUID.webarchive to be precise), and this GUID is used as the reference in the SignaturesByAccount.plist. It is possible to modify the plist directly to point at any file, to use that as a signature. This can be useful for automating mass deployments, you just need to write the scripts. However, this method of just saving over the top of an existing signature works well for a one off.

SSH Port forwarding

16/10/11 | by admin [mail] | Categories: Networking

There is this article that attempts to explain the basics of SSH port forwarding. I find it a little hard to follow, I think because it lacks concrete examples. So, I'm putting a few here

There's two main flavours: forwarding and remote forwarding.

You can use forwarding to forwarding incoming requests to a local port (a port on your computer) to a port on a remote computer. So, you can do something like:

ssh -T -L 5900:localhost:15900

This will allow you to connect to a local port (15900) to access port 5900 on the remote machine. This port is for VNC, so what it means is if you have SSH access to a remote machine, and perhaps only SSH access, you can connect to localhost:15900 to access the VNC service on that computer. Very useful when dealing with firewalled or natted remote computers.

Now, remote forwarding does the opposite. Imagine that you have console access on a remote box, and it is sitting behind a NAT or firewall. It can SSH out to another computer, but you can't SSH in. Not an uncommon situation for a typical client box. What this computer can do however is a remote forward, so that requests to port 15900 on the server are sent to port 5900 on the local box.

ssh -T -R 15900:localhost:5900

You could package that up as a script, send it to a friend to run so that they connect to your server, and then access port 15900 on your server to in fact VNC into their computer. Very handy for providing remote support.

You can add these together, so that a server out there on the internet which both you and your friend have SSH access to can act as relay.

Alternatively, by specifying a public IP, or hostname, which works in all cases (locally and remotely) before the first port, and adding the -g flag, you should be able to access that port from outside. To use the -g flag, GatewayPorts Yes needs to be in your sshd_config

ssh -T -R -g

The only other thing you might need to remember, is if you are running ssh on a nonstandard port, you will need to add the -p flag with the port at the beginning (before the user@host bit) eg:

ssh -p10022 -T -R 15900:localhost:5900

And an example with a web service, where on a NATed box, we tunnel port 80 to a remote server.

ssh -T -R -g

Of course, to do that you won't want to be running anything on port 80 on It's a cool way to quickly swap over to a test website from the internet. Killing Apache on and then starting up your port forward, but probably of limited use.

System Administration

October 2011
Mon Tue Wed Thu Fri Sat Sun
 << < Current> >>
          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 28 29 30


XML Feeds

What is RSS?

powered by b2evolution free blog software