Archive

Archive for September, 2009

SSH tunnelling to your home network

September 24th, 2009 No comments

SSH tunelling is no big secret, and there are loads of guides out there that explain how it is done in generic terms. This guide is slightly different, as it explains how to tunnel to hosts that are not publicly addressable.

For example, if you have a Linux server as your home network gateway then you can simply open ports on it, e.g. port 80 for a web server.

If you want to access a service on a computer on your network other than your server, you will have to set up port forwarding.

But there’s another way. Today while I was at work, I needed to change something on my home network printer’s web interface. The printer has a private IP address in the range 192.168.0.0/24 and there is no port forwarding set up (why would I want to share my printer’s control panel on the internet?).

Supposing my server is called jonathangazeley.com then I can enter a command like this from my work PC:

ssh -f jonathan@jonathangazeley.com -L 2000:192.168.0.105:80 -N

This command sets up port 2000 on localhost to point to port 80 on my printer at home.

Then I open my browser at work and navigate to http://localhost:2000

Hey presto, I can now see my printer’s config page remotely. As a nice by-product, the connection is also encrypted by the ssh protocol.

Configuring sendmail to use a Smart Host

September 24th, 2009 No comments

Chances are if you have a Linux server in your home, you’ll want it to be able to send you emails, e.g. its daily logwatch or the output from cron jobs.

But most ISPs block SMTP so you can’t directly send emails from your server to wherever they need to go, which is what the default config of sendmail does.

So you need to tell sendmail to forward its mail through something called a Smart Host, which is just an SMTP server that your ISP runs.

First, find out from your ISP what their Smart Host or SMTP server is called. This is usually available somewhere on their website.

Now open up /etc/mail/sendmail.mc for editing. Locate the following block, remove the dnl markers and change the name of the server to match your ISP’s.

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST', `mail.my-isp.com')

After editing, you have to run the /etc/mail/make program to write the sendmail config file. Then restart the sendmail daemon.

service sendmail restart

Your server is now capable of sending outoing mail through an external mail server. But there’s one final tweak. Open /etc/aliases and change the very last line so that you receive root’s mail.

# Person who should get root's mail
root:           me@jonathangazeley.com
Categories: Guides, Linux Tags: , , , ,

Information overload

September 23rd, 2009 1 comment

They are always talking about information overload when working in IT.

So imagine the explosion that nearly occurred in my head when I took a break from writing perl, stepped out of my office, and saw this…

Too many signs

Too many signs

Post Office woes

September 22nd, 2009 No comments

The Post Office really is an inconvenient organisation.

Last night I sold two items on eBay and consequently had two (fairly large) parcels to post. This was around 9pm so I put the parcels to one side, and decided to post them on my way to work in the morning – pushing my bike and carrying the parcels to the post office on Lodge Causeway – around half a mile away from my home.

When I got there, the post office was shut and there was no visible sign with the opening hours, because the shutters were opaque. Useless.

I didn’t know the whereabouts of any other post offices in the area, so I decided to proceed onwards on my bike, and post the parcels in Broadmead – which is on my route to work, although around 5 miles away.

So I cycled cautiously and slowly, and eventually arrived at Broadmead, thankfully not having dropped either of the parcels. I got to the post office around 9am, but according to the sign, it doesn’t open until 9:30am. Useless!

Of course these post offices both shut at the end of the working day too, so I have no way of posting anything unless I take time out of my working day – and since the Queens Road post office was closed last year, that involves a decent walk from my office. It also means taking all my parcels to work in the first place.

And while I’m on the topic, how about the opening hours of the Royal Mail parcel collection depots? Usually something like 8am until 12 noon. How come these open so early? Why can’t they open normal post offices at this time?

Why can’t they have any services open in the evening, when people actually want to use them? Because they’re useless.

</rant>

Categories: Uncategorized Tags: , ,

Plustek OpticFilm 7200 35mm scanner

September 15th, 2009 No comments

Today my new 35mm scanner arrived – a Plustek OpticFilm 7200.

The 7200 is the bottom of its range, but perfect for my needs. All of the scanners in the range have the same optical resolution, but some offer features such as iSRD infrared dust and scratch removal, or MultiExposure where the scanner makes 4 images and combines them to reduce noise.

As I’m scanning brand new negatives, I don’t plan to scratch them or let them get dusty. The MultiExposure might have been nice, but it nearly doubled the price of the basic 7200 model, which set me back just £115 from Amazon.

First impressions

Opening, the box I was impressed straight away. Obviously the basic were there: the scanner, power and USB cables but there was also a padded carry case.

The build quality of the scanner definitely puts it in the realm of home users but it’s perfectly fine.

There are two plastic trays: one that can take four slides and one that can take a strip of up to six negatives. I was a little disappointed by the negative tray, as it didn’t have the “dots” to help the film keep aligned and it can be tricky to get the film into it, especially if it’s new film that still has a tendency to curl.

When sliding the trays into the scanner, you can feel it “bump” into notches so it sits in the right place. These notches aren’t as precise as I would like and you can’t always tell if you are exactly in the right place until you’ve done a preview scan.

The software

According to this page, the OpticFilm 7200 is not supported by any SANE backend, and therefore cannot be used with Linux. Shame.

Installation on Windows was easy enough, although the supplied SilverFast software has a distinct “Windows 3.1″ look and feel about it. It works well enough though and after a few minutes of playing I worked out most of the important features.

Image quality

So far I’ve scanned two rolls of film and I’ve been impressed with the results. I’ve been scanning at 3600dpi which gives a resolution of round about 17-18 megapixels. Saved as a TIFF, this takes up about 55MB.

The built-in sharpening feature does a good job – I can’t tell that my scans have been sharpened which is a relief. Some sharpening software overdoes it and you end up with unsightly artefacts.

The colours are good so long as you’ve done all of these:

  • Chosen the right film manufacturer
  • Chosen the right film type
  • Chosen the right ISO film speed
  • Done a prescan to allow SilverFast to calibrate itself

In extremely over- or under-exposed photos, the software can do some funny things with the exposure. But I guess the moral of that story is to expose your photos properly…

The photos I’ve scanned so far have either been on old, grainy film or not focussed properly so it’s hard to tell how sharp the scans are. Except that some of my old negatives from a disposable camera had scratches, and these showed up lovely and sharp in the scans!

Conclusion

This scanner is fantastic value for the money.

Sharpness, colours and dynamic range are all very good.

Serious users should consider getting one of the higher scanners with iSRD and MultiExposure which will help with image quality even more. And they still don’t cost ridiculous amounts.

Sample

I took this picture recently with a Canon AE-1 Program 35mm SLR, using a 50mm prime lens and ISO400 Fuji Superia film.

Unfortunately the lab who processed the film also scratched it, which is pretty annoying. But it demonstrates how sharp the scanner is, and highlights the reason for buying a scanner with iSRD.

Flowers

Flowers

Forgetting something?

September 14th, 2009 No comments

Today I wrote an email in Thunderbird and clicked send. It gave me this message:

Forgetting something?

It has never asked me this before, so I wonder what prompted it to do so today. Turns out new builds of Thunderbird scan your email for keywords such as attachment or attached and reminds you to check for attachments if you used these words.

In my email I had said “It’s in my name because it’s attached to my account” so this must be what triggered it.

Pretty nifty – the number of times I’ve accidentally sent an email without its attachment…

Categories: Linux Tags: , , ,

Raising money for Marie Curie

September 14th, 2009 No comments
On the 4th October I am taking part in a cycle ride from Bristol to Bath (and back!) with my family and Hana, to raise money for Marie Curie Cancer Care.

We would really appreciate it if you could sponsor us via my JustGiving page so we can reach our fundraising target.

Thanks!

Categories: Cycling Tags: , ,

Photography for beginners: Filters

September 13th, 2009 No comments

Filters are pieces of glass that screw onto the front of your camera, and they can cause all sorts of unusual effects to your photos.

The good news is that you can buy filters cheaply from eBay (and of course, less cheaply from the high street, if that’s how you like to buy). Before buying, you’ll need to know the diameter of your camera’s lens. This should be written somewhere on the lens barrel or often around the glass on the front of the lens. Look for something like Φ58mm, and then check that your lens has a fine screw thread inside the rim. You’ll need this for the filters to screw into.

Of course each camera (and potentially each lens, if you have an SLR) may have a different lens diameter. If you’ve built up a large collection of filters and you plan on changing camera, never fear! You can buy adapter rings that allows you to use the “wrong” size filters on your new camera.

So let’s have a look at the various kinds of filter you can buy. This list is by no means exhaustive!

Ultraviolet (UV) These filters are designed to filter out UV light, which is invisible to the eye but can cause haze in outdoor photos.

As they are so cheap, it’s worth keeping on one the front of your camera permanently to prevent the lens from scratches.

Infrared (IR) IR filters remove all light except infrared light. It can give an eerie night-vision type effect, or give interesting photos of hot objects – such as the sun or a light bulb. Example.
Neutral Density (ND) ND filters simply cut down the amount of light entering the camera. Think of them as sunglasses for your camera. With an ND, you can set a longer exposure in daylight, or it allows you to keep the same shutter and open the aperture a bit wider for increased depth of field.ND filters come in a variety of darknesses. The most common types are ND2, ND4 and ND8, which allow through 1/2, 1/4 and 1/8 of the light respectively. If you’re not sure which to buy, try an ND4 first.
Circular polariser (CPL) Polarisers cut glare from reflective surfaces such as glass or water, and enrich the colour of the sky.
Soft focus / diffuser These filters add a gentle blur which can improve the appearance of skin in portraits, or add a slightly dreamy feel.
Graduated ND (GND) These filters are almost clear at one edge, and dark at the other edge, fading slowly across. You can use a graduated ND to darken and enrich the sky while leaving the foreground unaffected.
Star These filters cause points of light to appear as stars. You can get them in 4-point or 6-point varieties.
Skylight Skylight filters reduce the bluish tinge that can occur when shooting in daylight.
Graduated colours These are graduated filters with a colour. The most common ones are blue and orange – for emphasising the colours if the sky during the day, or at sunset.

These are the rules of thumb that I’ve come up with through experimentation. Hopefully they’ll be useful:

  • Always keep a UV filter (or at least some other type of filter) on the lens to prevent scratches
  • Consider replacing the UV filter with a Skylight filter when shooting outdoors to avoid a blueish cast
  • Use an ND filter when shooting in very bright light to avoid overexposed areas
  • Use a CPL or a GND when shooting landscapes with large areas of sky, to make the sky dark and rich
  • Consider using a diffuser when taking close portraits to soften skin tones
  • Any of the other filters are generally for novelty effects and are not subtle
  • Try to use only one or two filters at any one time. Every filter you add can decrease the quality of the lens system, and if you stack up three or more filters, you can usually see the rim of the filters in the photo.

So if you fancy trying something different, I recommend getting some cheap filters from eBay and seeing what interesting effects you can come up with.

Next time, I will write about basic photo editing on a computer.

Photography for beginners: Camera basics

September 13th, 2009 No comments

Most cameras, even compacts, have at least some manual settings that you can adjust if you want to explore what your camera can do. As I mentioned in my introduction, the three most common settings to play with are the aperture, shutter speed and ISO.

What the settings do

Let me go into a little more detail about these.

Setting Low value (approx) High value (approx)
Aperture f/3 – large aperture

  • Lets lots of light in – good for dark situations where you don’t want to increase exposure time or ISO
  • Large aperture increases the depth of field (makes things go out of focus more quickly as they move towards or away from the camera
f/12 – small aperture

  • Can be used to reduce the amount of light entering the camera
  • You can also use an ND filter1 to reduce the amount of light
  • Very small aperture of f/10 or smaller can make points of light become star-shaped
  • Smaller apertures increase the depth of field so more of the photo is in focus
Shutter speed 1/4000s – short exposure or fast shutter

  • Use a fast shutter in bright sunlight
  • Use a fast shutter to freeze a point in action, e.g. sports
30s – long exposure or slow shutter

  • Exposures of longer than 1/250s will probably need a tripod or at least a place to rest the camera on a firm surface
  • If you are increasing the exposure simply to capture more light, consider making the aperture larger instead
  • If you want to take a long exposure of a moving object in bright light, make the aperture small and use an ND filter
ISO 100 – low ISO

  • Camera less sensitive to light
  • Use low ISO in bright conditions or for long exposures
1600 – high ISO

  • Camera more sensitive to light
  • Use in darker situations where you don’t want a long exposure
  • Be aware that ISO 800 or more can cause speckly “noise”. This can happen with digital or film!

[1] Don’t worry – we will discuss filters in a later post.

How you can use the settings

So know you know a little bit of the basics, I can say something about the different modes on your camera.

Taking full manual control of the camera can be a little daunting and can produce unpredictable results until you are familiar with the camera. But most cameras semi-automatic modes known as shutter priority (or S for short) and aperture priority (or A for short). This allows you to set one value, either the shutter or the aperture, and the camera picks the other settings for you. Full manual is usually known as M.

This table shows what combinations of settings are available on my camera.

ISO Shutter Aperture
Auto Either auto, or you choose Auto Auto
S You choose You choose Auto
A You choose Auto You choose
M You choose You choose You choose

Examples

The best way to explain when you should choose a particular mode and what settings you should choose is by example – and experimentation, of course.

Blurred photo of moving cars on a sunny day


To achieve blur we need a relatively long shutter speed, and the challenge is compensating for this long exposure so the picture isn’t overexposed.

Mode M
ISO Choose the lowest available ISO
Shutter Choose the shortest shutter speed that you can get away with while still achieving the desired blurred effect. Maybe 2-5 seconds.
Aperture Choose the smallest available aperture (largest F number)
Notes You will need a tripod, and probably an ND filter to limit the amount of light.
A passing car

A car on the M32

Blurred photo of moving cars at night


This is actually much easier than blurred photos by day as compensating for the long exposure in low light conditions is easy.

I recommend… I used…
Mode S S
ISO Choose the lowest available ISO 80
Shutter Choose a really long shutter speed – 10 or 30 seconds perhaps 10s
Aperture Auto Auto: f/10.9
Notes You will need a tripod, and possibly an ND filter to limit the amount of light for very long exposures
M32 by night

M32 by night

A closeup of a flower


The primary objective here is to open the aperture wide to decrease the depth of field and cause the background to be out of focus.

I recommend… I used…
Mode A A
ISO Choose a medium ISO like 200. Adjust according for the daylight conditions. 80
Shutter Auto Auto: 1/340s
Aperture Choose a fairly large aperture f/2.8
Notes
Daffodils

Daffodils outside St Paul's Church, Nuneaton

Sports and action


The object here is to keep the shutter as fast as possible, to freeze the action without blur.

I recommend… I used…
Mode S S
ISO Choose a medium ISO like 200. Adjust according for the daylight conditions. 80
Shutter Choose a fast shutter such as 1/400s or less, according to the speed of the object you want to freeze, and the light conditions. 1/450s
Aperture Auto Auto: f/7.2
Notes
M32

M32 near Bristol

The best thing you can do is practice, and try new things. Chances are you’ll go to your local motorway bridge and take tens of photos. Some will be good, and some will be awful. But you’ll quickly learn what works for your camera.

If you can’t remember what settings you used to take each picture, you can find out on your computer later. If you’re on Windows, right-click on the image file, click Properties and click on the Details tab. Scroll down to Camera you’ll see the details, like in the screenshot below.

Properties

This isn't my computer - Hana likes pink on hers

Next time, we will go over how to choose and use filters in your pictures.

More O2 brokenness

September 13th, 2009 No comments

I just received my phone bill from O2 by email. See if you can spot the deliberate mistakes. Click for a bigger version.

O2 phone bill

O2 phone bill

Categories: Fail, Web Tags: , , , ,