cURL SSLv3 calls failing

If you try and connect over HTTPS/SSL with cURL you may get an error similar to:

sslv3 alert handshake failure

Or:

Unknown SSL protocol error in connection

If you cannot see a descriptive error message, use –verbose to report everything.

The cause of this often that hosts have disabled SSLv3 because it has now been compromised. The solution is to use TLS, which is a newer more secure protocol.

curl --tlsv1 --verbose hostname

If you are using cURL in PHP you can change the SSL version to use TLSv1.2.

CURLOPT_SSLVERSION => 6

You should then be able to make the cURL request over SSL successfully.

Error resolving hostname on SSH tunnels

Lets say you are trying to create an SSH tunnel.

ssh -L 27017:somehost:27017 you@examplehost.net

You may get the following error message.

ssh: Error resolving hostname \342\200\223L: nodename nor servname provided, or not known

This is caused by using the wrong kind of minus symbol. If you have copied and pasted the command from somewhere, this is probably the case. This is easy to fix – simply paste the command into your terminal, then go through it, remove the existing minus symbol and put a new – in.

Speed up really slow SSH connections

Sometimes, you might find that when you try and SSH into another server, it seems to hang, but then after around 30 seconds or so, will suddenly start working again. You can diagnose where it is stopping by using verbose mode.

ssh -vv user@example-server

If you find it is to do with GSS API, you can disable this in your SSH configuration.

cd ~/.ssh/
vim config

Add the following to it.

GSSAPIAuthentication no

This should then speed the login up.

Guest network on Linksys E1000 router

If you’re using a Cisco Linksys E1000 router, you may have noticed that it creates a guest network – but there is no sign of how to control it or change it through the web interface!

Strangely, that is how it is – Linksys seem to have omitted any kind of control over it from the web interface. The only way you can modify it is to run the Cisco Connect software on your computer.

Launching this will bring up a control panel, of which the bottom left option will be “guest network” and from here, you can make changes.

It also appears, from the list of available wifi networks, that the guest network is not password protected. This isn’t the case if you have set a password, but it does not use the standard WPA or WEP encryption. Instead, it allows clients to connect, but them prompts them for a password before allowing them internet access.

Configuring PWS (Microsoft Personal Web Server)

Personal Web Server is pretty easy to configure. Even back in 1995 when it was all web based. However in this article I am looking at the PWS version which was shipped with Windows 98 and ME software.

The basic’s to it are very simply. In fact the only page of options we will be looking at is the advanced page. Open up your personal web server consol from the system tray and click advanced down the left hand side.

You should now be presented with a tree like view with the top root document and several sub folders. From here you can add virtual directories. Virtual directories are directories which aren’t really there but are instead linked to it.

For instance if you had two directories, your main website root C:\websites and a downloads directory which you wanted to be on your server at C:\downloads. Obviously you don’t want the move this folder into your other folder. And so you create a virtual directory so that http://localhost/downloads goes to C:\downloads rather than C:\websites\downloads.

Beware: Virtual directories override physical (normal) directories. So if you had both a virtual directory called downloads and a folder in your website root called downloads, the virtual directory would be used instead of the folder when using hyperlinks, etc.

In PWS you can create as many virtual directories as you like. Click add below the list of directories. You can also add virtual directories within virtual directories so you could set up http://localhost/downloads/games to go to C:\games rather than C:\downloads\games. To do this click on the downloads virtual directory before clicking new, rather than click the root directory and then clicking new.

You can change the properties of each of the directories including the root directory by clicking it and then click properties. Here you will probably be presented with a name for the directory (unless it is the root) as well as the file path to the directory.

You also have 3 tick boxes. Read which allows people to read the files in the server. You will almost always want to keep this ticked. The second one is script which allows the web server to run scripts. This is another one you will want to keep ticked.

The final one is write. This allows files such as text files and databases to have data added and removed this one. It’s a good idea to keep this one ticked if its your own server so you can run scripts such as ones that change database’s and is required if you want to alter any files.

There are also a few options on the main page of the advanced section at the bottom. One of these is “allow directory browsing.” This means that if a user goes to a folder, for example http://localhost, they will be presented with a list of the files and folders in the directory which they can click on.

Default document allows a file to be served as a kind of homepage when a user goes to a directory. For example if your default document file name was home.htm, when a user went to http://localhost, they would get home.htm if it existed.

The standards for default documents are default and index in which you should list several file formats. I use .asp .htm and .html though if you use other formats such as php and cfm you should list these too.

Conclusion

Personal Web Server has quite a few customisation options for each directory as well as the entire site and despite its problems with not being able to cope with high traffic or indeed anything above very little traffic, makes a great testing server especially for active server page developers.

Crossover network cables

Something that is weird and doesn’t make sense is the idea of crossover cables. Ok, they do make sense but I’m not going to get into that here. Crossover cables are just like regular network cables except, and here is the surprisingly bit, the wires inside them are crossed over.

When to use them

Crossover cables are used when you are linking two computers directly. When using hubs, switches, routers, etc you want regular network cables but if you are linking two computers from one network port to the other you need a crossover cable.

Alternatives

Of course one problem is if you have just wired everything up and taken up half the carpets in your house. Putting a new cable in doesn’t sound like something you will be wanting to do any time soon.

There are two ways to work round this (you could also buy a network hub but that’s expensive and pointless so I won’t be covering that solution). The first is to get a connector and stick two crossover cables together, so the wires crossover twice and therefore cancel each other out.

The second solution is to get a connector that does this for you. You plug one end of the connector into your computer and the other end has a port to slot your regular network cable into. It’s just like a little box that does the crossover for you.

Two routers on one network

Two routers on one network, that is crazy talk. It is indeed but the problem is that with everyone trying to provide out of the box home network solutions at cheap prices, routers are bundled in with everything. It seems these days you can’t buy a networking hub without getting a router with it.

Picture the situation. A few years ago you bought a Linksys 4 port switch / cable router so you could connect several computers to your internet connection. Now you want to go wireless with your laptop and so you buy a wireless access point. However it comes bundled 4 integrated wired ports and a router too. It happens, it happened to me.

They can co-exist quite peacefully though. That said it isn’t plug and play. I never expected it to be though. I thought when I got the first router it wouldn’t be but that plugged in and worked fine pretty much straight away. And to be honest, this wasn’t much harder.

First thing you want to do is to plug your new router into a separate computer disconnected from the network and head to setup. Here you want to change its address on the network.

The main problem I had was that both routers were trying to use port 192.168.1.1, which was not a good situation. So I connected the second router to my laptop and changed its port to 192.168.1.5.

Then you connect everything together. In this case I connected a cable into the uplink port of my first router and plugged the other end into one of the standard network ports on the second router. I’m guessing you can also plug a cable into a standard network port on the first one too, though I didn’t try that.

As only one actually needs to route internet traffic and such I then went to my second router and disabled the local DHCP server. This one was basically just acting as more ports to my main router.

And that is all you need to do? Simple huh? Well actually save the relaxation for when you actually have it working as you know how reliable technology is ;). Once done, sit back, log onto IM and brag about your advanced network.