09 February 2013

Installing Squid as a Proxy Server

Squid is a proxy server meaning it can be used for (amongst other things):
  • Caching pages to speed up client browsing experience.
  • Protect/prevent your users from visiting particular pages or domains.
  • Filtering/altering returned content e.g. replacing every instance of the word BBC with Auntie in web pages.
It can also be used as a Reverse Proxy meaning it can cache the response from (one or more) web server(s) thereby reducing the load on the server.

Prerequisite
One prerequisite for this guide is a Linux server. I’ll be using Ubuntu server 10.04 but you can use any distribution you feel comfortable with. I have written previously about installing Debian and the steps are much the same for Ubuntu as it’s based on that.

Install Squid
  1. Install Apache:
    sudo apt-get install apache2
  2. Install Squid:
    sudo apt-get install squid
  3. Edit the configuration file:
    vi /etc/squid/squid.conf
  4. Edit config:
    sudo vi /etc/squid/squid.conf
    1. /http_port 3[Enter] to search for the http_port
Ref: https://help.ubuntu.com/community/Squid

Working Off-line and Off-Grid

Things have come a long way in terms of devices and connectivity but in my opinion they still only really work well if they are online... As soon as you're offline everything seems to just say "you arent connected to the internet, please check connectivity and try again"... And yet the things i'm trying to do dont actually physically NEED the internet e.g. edit a text file on one device, then switch to another to carry on etc.

Last year I went on holiday to southern Spain and although I knew were I didn't have internet where I was staying I was expecting to be able to use my Mac to setup an ad hoc network and then connect to that from either of my Android devices (Samsung Galaxy SII and 10.1 tablet) but it doesnt seem to work: the Mac will 'create network' but neither andoid device sees it... Then I tried doing it from the tablet via 'tethering and portable hotspot' and all three connect to that ok but then they wont do anything usefull... Eg remote into the Mac from the tablet or move files via mtp or connect via the oh so poor kies. BUT if i'm in the local bar and connected to their wireless they will connect to the computer via kies and sync docs via the net.

Power
Another frustration I find is power: I only had one (swiss) travel charger and despite having everything on flight mode/wireless off unless I know i've got wifi I find I need to really think about what I'll need next and to manage the charging accordingly in advance so all are charged for a trip to the bar or my tablet is in advance of sitting by the pool reading in the afternoon. I also stupidly left the non USB bit at home. The more modern Swiss travel charger version has USB integrated and my USB bit has broken so I'll get one of those.

Temperature
The mac laptop gets SO hot on the bottom I find it unuseable on my lap: having bear skin it burns! Plus the screen is too reflective so its hard to see past my own reflection. I guess the ambient temp is around 30'C in the shade so this is probably a contributry factor to power as it needs the fan to be running to cope. It hasn't shut off due to overheating yet though which my previous Dell did even in the cold of the UK! The tablet is the best overall: the good length of usage from the on-board power, low running temperature, ability to use on screen or with bluetooth keyboard BUT falls down when trying to edit an open office doc (no app for this, only .doc via Polaris  or refer to one doc (old document) when writing another (new document).

Foreign Sim Card
I wanted to get a Spanish Sim wit data but the shop in the local village is very basic and the local town isn't much better so actually finding a place to get one is pretty tricky... I know u can get international ones (eg from iwantoneofthose.com) but they are very over priced.


In Conclusion
So no perfect solution overall yet but i think a tablet with more apps/better OS would be the key (eg android 4 which is imminent for my tablet: I have it on my phone already and love it). Perhaps with an ad hoc/network/mifi but not necessarily internet network with the laptop running in the cool of the room so i could remote in would be a good solution. If it weren't for things I can not do on the tablet eg programming which i still cant  do on the tablet (you cant compile things) then I wouldnt need the laptop.


So if you're taking a break this summer and don't have intrnet but want to have a seemless experience then you'll need to put some effort into it!

Windows Fix: Can't Select Obtain DNS Servers Automatically

Recently I had an issue where I couldn't set a network adapter's DNS servers to be obtained automatically. Whenever I set it it would get reset to 'Use the following DNS server addresses':

If I did an ipconfig /all it returned the following:
DNS Servers: 216.146.35.35 216.146.36.36 [list of other DNS servers that should be there]
I found the answer here. Thanks to Brian D Stewart. It was in the DynDNS's Updater, Configuration, Advanced: "Enable Dyn Internet Guide on this PC"

Deselect it and you will be able to set your DNS settings again. I will be contacting DynDNS about this seemingly inexplicable inclusion in their updater.