Skip to content
Customer Testimonials

"We are very happy to recommend the service … installation and support of the highest quality."

- Donncha Cody – Transport Manager in Managh Transport Ltd.

"Before you came we were having all sorts of problems with our systems."

- Phlip Joyce – Partner in Joyce & Barry Solicitors, and former Law Society President.

Remote & Onsite Support

Enables you to:

  • Get 4 working hour response to business critical failures.

  • Enjoy 1 hour response to most issues through remote support.

  • Take advantage of out of band appliance support using Serial Over LAN.

  • Fix your PC with a double click.

  • Remove malware in safe mode.

  • Free Trial!

SMB Server Appliances

Enables you to:

  • Integrate all services and software packages on one, flexible, appliance.

  • Host Windows only apps through virtualisation.

  • Fix server boot problems using SOL.

  • Take care of your server requirements from as little as €1000 ex VAT.

  • Eliminate licensing costs.

  • Buy Now

Secure Connectivity

Enables you to:

  • Get secure remote access using Microsoft compatible technology.

  • Get and edit office email/files anywhere.

  • Access client/server apps anywhere.

  • Eliminate licensing costs.

  • Combine services on one low cost appliance.

  • Buy Now

File & Printer Sharing

Enables you to:

  • Share files and printers using tried and trusted Microsoft compatible technology.

  • Deploy a primary domain controller.

  • Provide access to network printers reducing client configuration burden.

  • Eliminate licensing costs.

  • Combine services on one low cost appliance.

  • Buy Now

Web Content Filtering

Enables you to:

  • Filter web access using tried and trusted Microsoft compatible technology.

  • Filter content and viruses.

  • Reduce exposure to malware.

  • Restrict employee internet access.

  • Eliminate licensing costs.

  • Combine services on one low cost appliance.

  • Buy Now

SPAM Filtering

Enables you to:

  • Filter email using tried and tested Microsoft compatible technology.

  • Reduce SPAM by at least 99% with no false positives versus unfiltered mail.

  • Filter external mail accounts.

  • Eliminate licensing costs.

  • Combine services on one low cost applicance.

  • Buy Now

Monitoring

Enables:

  • Remote System Monitoring.
  • Appliance resource usage and service availability monitoring.
  • Daily log summaries to capture non specific problems.
  • Evidence of virus/malware infection on Windows PCs, independent of AV solutions.
  • Elimination of licensing cost.
  • Service combination on one low cost appliance.
  • Buy Now
Backup

Enables:

  • Quick disaster recovery using a mirrored drive on-site.
  • File archival for up to 12 months.
  • Backups to be encrypted and compressed in transit.
  • Backup monitoring on a daily basis as part of monthly maintenance package.
  • Elimination of licensing cost.
  • Buy Now

Iptables-apply or how to avoid unnecessary site visits when changing firewall configuration

Today’s post is definitely of the short and sweet variety. I happened across the file list for iptables the other day and noticed a binary I had not come across before “iptables-apply”. Iptables-apply is a script that applies firewall rules and then waits a configurable amount of time, for user input, to confirm the changes were successful. In other words if you aren’t a perfect admin (who is right!) and manage to accidentally lock yourself out by putting an iptables rule in wrong, iptables-apply will automatically revert back to the previous set of rules and you’ll get access again.

Could’ve saved me literally some diesel over the past few years that one!

From the iptables-apply man page:

iptables-apply   will  try  to  apply  a  new  ruleset  (as  output  by
iptables-save/read by iptables-restore) to iptables,  then  prompt  the
user  whether the changes are okay. If the new ruleset cut the existing
connection, the user will not be able to answer affirmatively. In  this
case,  the  script rolls back to the previous ruleset after the timeout
expired. The timeout can be set with -t.

This has the advantage over Shorewall in that Shorewall will only keep existing connections open when new rules are applied. If you happen to lose connectivity, tough luck, Shorewall will obediently block further connections on your borked firewall.

Transparent bridging firewalls

The commands in this article can be used on any Ubuntu/Debian machine.

A transparent bridging firewall is a firewall which can be inserted anywhere on a network, but usually between the network segment containing internet access and the rest of a LAN. Generally they are used to silently police and log traffic from the network to the internet and vice versa, the main advantage being that they can easily be inserted and removed without any network reconfiguration.

Further to this the segment between and including the bridged firewall and internet router can be considered a DMZ where internet facing servers can be placed. Personally I think it is a good idea to place all servers in this no mans land as they are as likely to come under attack from Windows clients on their own LAN as any hacker from the internet. The bridged firewall provides protection for both sides.

In my own usage scenario bridged firewalls are a “have my cake and eat it” solution. In order to use Serial Over LAN for out of band access to servers you need to have a separate router which forwards IPMI traffic, even if the server is down. Generally broadband routers don’t come with robust firewalls i.e. which implement egress filtering, access by exception or logging, so to provide a robust firewall in my config, the transparent bridging firewall is part of the server we want out of band access to.

In this example I have bridged a wireless and ethernet device together but generally it would be 2 ethernet cards i.e. eth0 and eth1 so you should change the config accordingly.

/etc/network/interfaces:


auto br0
iface br0 inet static
address 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.252
pre-up ifconfig eth0 down
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
pre-up brctl addif br0 wlan1
pre-up ifconfig eth0 0.0.0.0
pre-up ifconfig wlan1 0.0.0.0
post-down ifconfig eth0 down
post-down ifconfig wlan1 down
post-down ifconfig br0 down
post-down brctl delif br0 eth0
post-down brctl delif br0 wlan1
post-down brctl delbr br0

/etc/rules-save:


# Generated by iptables-save v1.4.4 on Fri Aug  6 20:53:42 2010
*filter
:INPUT ACCEPT [33394:2816896]
:FORWARD ACCEPT [73745:4845726]
:OUTPUT ACCEPT [18134:2282560]
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -p tcp -m physdev --physdev-in wlan1 --physdev-out eth0 -m multiport --dports 20:22,25,43,80:81,443,465,587,873,995,3389,5900,8008 -j ACCEPT
-A FORWARD -p tcp -m physdev --physdev-in wlan1 --physdev-out eth0 -m multiport --dports 8080,9002,11371,18990 -j ACCEPT
-A FORWARD -p udp -m physdev --physdev-in wlan1 --physdev-out eth0 -m multiport --dports 123,623,5060 -j ACCEPT
-A FORWARD -p icmp -m physdev --physdev-in wlan1 --physdev-out eth0 -j ACCEPT
-A FORWARD -m physdev --physdev-in wlan1 --physdev-out eth0 -j LOG --log-prefix "iptables denied: "
-A FORWARD -m physdev --physdev-in eth0 --physdev-out wlan1 -j LOG --log-prefix "iptables denied: "
-A FORWARD -m physdev --physdev-in wlan1 --physdev-out eth0 -j DROP
-A FORWARD -m physdev --physdev-in eth0 --physdev-out wlan1 -j DROP
COMMIT
# Completed on Fri Aug  6 20:53:42 2010

Ok, so some other things to note. Add “iptables-restore /etc/rules-save” to “/etc/rc.local” so that the firewall starts on boot. This script doesn’t block any traffic to the firewall itself or to other interfaces which may be in the bridge. For instance I have an LXC container which has it’s own dynamically created and destroyed interface which is part of the bridge and since this container serves my network I also use the DMZ feature of my router to direct all internet traffic to it. To make it truely transparent, if the firewall weren’t doing other things, you could remove the ip address from the bridge.

Think that’s it TTFN.

Parprouted your friendly network spanning friend

Following on from the previous article about Linux as a wireless access point, I had another special usage scenario:

I sometimes fix machines upstairs that don’t have wireless connectivity and an nl80211 hostapd doesn’t support WDS repeater mode (not that any of the routers I have lying around support that anyway), so I couldn’t simply connect it to another access point. The choice was stark either resign myself to working on such machines downstairs (along with 3 boys and associated noise) or scrap my lovely Linux access point and bridge, and go back to the old setup.

In comes parprouted, which is a layer 3 bridging daemon. Parprouted gets around the Linux wireless bridging when in managed mode limitation and is specifically designed for this usage scenario, allowing me to connect the wired machine to my laptop via the ethernet port, and bridge traffic to and from the wireless network, effectively using the laptop as a 1 port wireless switch.

In a nutshell to use it ensure the wired and wireless interfaces have IP addresses in separate subnets, then start parprouted telling it which interfaces you want to bridge:


sudo parprouted eth0 eth1

Then plug the wired only machine into the laptop via Ethernet and configure a static ip in the same subnet as the Ethernet card on the laptop, giving the IP address of the laptop Ethernet card as the gateway.

I really like this because:

  1. It’s quick and easy.
  2. Running Parprouted is a one liner.

I suppose it’s analogous to the bridging functionality in Windows except that it works reliably.

References:

http://freshmeat.net/projects/parprouted/

Ubuntu as a wireless 80211g/n access point/router

Following relatively recent improvements in the Linux wireless stack and driver support it is now possible to setup a Linux machine as an access point, even if you don’t have an Atheros chipset (which was historically the case). Support is patchy but I would say there is a good chance you can do this if you have purchased a laptop with built in wireless in the last 2 years. It is even possible to set one up with a USB wireless adapter (which even Madwifi couldn’t do) if you have an Ralink chipset.

Why would you want to do this? Well, there aren’t that many reasons considering ISP’s routinely hand out wireless routers these days, but I will give you a couple:-

  1. A Linux based AP is going to be more flexible than a dedicated router, even if it is running a wireless Linux distribution such as DD-WRT. For instance I have a HG556a as provided by Vodafone, which runs a form of Linux, and as routers go is pretty configurable. However I was trying to route one network to another and get the router to NAT both networks and couldn’t. Setting up static routes on it was easy enough, so all devices on both networks could talk to each other, but that is where it ended. In Linux you would just add an extra MASQUERADE rule and away you go.
  2. If you want “decent” firewalling i.e. access by exception, egress filtering and logging, don’t rely on a wireless router to do it for you, in most routers it will be difficult/impossible to achieve.

My personal reason for wanting to do this was that as a side effect of using hostapd, the wireless interface is bridged, and I wanted to set-up a transparent bridge firewall as a test bed for customer use cases. To my knowledge it is the only way of bridging a wireless interface in Linux. Wpa_supplicant has a bridge option but online reading suggests it doesn’t work due to managed mode limitations in the mac80211 stack.

So onwards and upwards, according to the mac80211 website there are a number of wireless chip-sets which support AP mode, which I am in possession of:-

  • Broadcom BCM4312
  • Ralink rt73usb
  • Ralink rt2570usb
  • Atheros AR5008

Basically there are only 2 wireless chipsets that I have purchased in the last 5 years which don’t support AP mode at the moment, the Intel 3945ABG and Zidas 1211B.

The laptop I wanted to setup as an AP has the aforementioned Intel chip, so of the cards I had available instead, the AR5008 was the best choice for the job, being express card compatible, and therefore relatively unobtrusive.

Once the card is installed, and your laptop/machine rebooted if necessary, the first thing to do is configure the bridge. See the relevant excerpt for /etc/network/interfaces below:-


auto br0
iface br0 inet static
address 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.252
pre-up ifconfig eth0 down
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
pre-up brctl addif br0 wlan1
pre-up ifconfig eth0 0.0.0.0
pre-up ifconfig wlan1 0.0.0.0
post-down ifconfig eth0 down
post-down ifconfig wlan1 down
post-down ifconfig br0 down
post-down brctl delif br0 eth0
post-down brctl delif br0 wlan1
post-down brctl delbr br0

Be aware that you will probably need to change the wireless interface “wlan1″ to either “eth1″ or “wlan0″ depending on what Ubuntu has named it (ifconfig -a will show you all available interfaces). And, or course, you will need to make the IP/gateway relevant to your own network. Restart networking by typing:


/etc/init.d/networking restart

Once that is done install hostapd:


apt-get install hostapd

Then edit /etc/hostapd/hostapd.conf and change accordingly. In order to be succinct I only post the options I changed from default here:


interface=wlan1

bridge=br0

driver=nl80211

ssid=johnlewis

hw_mode=g

channel=10

wpa_passphrase=yourpassphrase

“Interface” and “bridge” are self explanatory. “Driver” is the hostapd driver you are going to use with the card. For all mac80211 compatible cards this will be the same. “Ssid” is the wireless network id you want to use and “hw_mode” sets whether you are trying to use 5Ghz or not. For some reason this defaults to 5Ghz mode “a” in Ubuntu (a bit crazy since most cards will be 2.4Ghz only). Likewise the channel was set to “60″ by default, which I am assuming is a 5Ghz channel since 2.4Ghz in Europe has a maximum of 13 channels AFAIK. “Wpa_passphrase” is the wireless key you want to use with your shiny new wireless network.

Now you are ready to test the AP. Start the daemon initially from the command line to test like so:


hostapd -d /etc/hostapd/hostapd.conf

Try to connect with a wireless client and check your are getting “hand shake completed” somewhere in the output, which indicates the client has connected successfully. When you are confident it is working correctly ctrl + c to exit the daemon and edit /etc/default/hostapd uncommenting “DAEMON=yes”. Type:


service hostapd start

And check hostapd is running:


ps -e |grep hostapd

Hopefully “Bob is your muvvas bruvva”. I have to say performance and reliability is comparable to the aforementioned HG556a. Further more you could try enabling 80211.n (ht) if you have an AR5008 as it is compatible. Apart from having to change the pairwise to CCMP I had no trouble enabling it and it is working well.

With thanks to Matt Rudge for bringing the whole “Linux as an AP” idea back into my head and giving me the onus to check how wireless support had quietly and assuredly moved on since the last time I tried.

References:

http://linuxwireless.org/en/users/Documentation/hostapd

http://linuxwireless.org/en/users/Drivers

SSL certificate warnings, power failures and worn out CMOS batteries

Are you experiencing SSL certificate error messages when you try to go into everyday sites such as Gmail, Facebook, etc?

Have you had a power cut recently?

What has happened is that the time is wrong on the PC and the SSL certificate is therefore either out of date or not in date yet.

It could just be that some nefarious force has changed the time on your PC (read: Malware or Malperson) or it could be that the CMOS battery has past it useful life, the PC is then losing all it’s BIOS settings and time whenever there is no power to the PSU.

Filtering POP3 mailboxes – an update

I’ve made an improvement to my previous POP3 mailbox filtering solution from http://www.johnlewis.ie/2010/01/16/effective-pop3-anti-spam-with-fdm-and-procmail-using-little-system-resource/. This will effectively extract the last IP address from the received headers, avoiding any addresses in the private address space and check it against zen.spamhaus.org.

The improvement comes from using a small perl script utilitising regexp::common::net which has all the bases covered in relation to address connotations. Additionally I’ve changed the “formail” command line to extract the “X-Originating-IP” header so the procmail recipe  will use the IP from that. All you Hotmail spammers better watch out, you know who you are!

Place the following in /usr/local/bin/extractlastip.pl and use the /etc/procmailrc below that to update to the latest version. Oh and don’t forget to make the perl script executable.


#!/usr/bin/perl

use Regexp::Common qw/net/;

while (<>) {
 /$RE{net}{IPv4}{dec}{-keep}/ and $last = $1 unless /127\.0\.0\.1|(10\.\d+|172\.(1[6-9]|2\d|3[0-1])|192\.168)(\.\d+){2}/;
}

print $last, "\n";

# Global procmail definitions
# Define a file for procmail to send it's log information.
LOGFILE=${HOME}/procmail.log
# Make sure procmail verbose logging is turned off.
VERBOSE=off
# Define a new line character for use in procmail LOG entries.
# note: the quote spanning two lines below is deliberate.
NL="
"
# Directory where we will store mail folders
# Note: This directory MUST exist!
MAILDIR=${HOME}/Maildir
#Mail folder for incoming whitelisted listmail
LISTMAILFOLDER=${MAILDIR}/listmail
# Location of formail on our system. (for use in procmail actions since
# those typically need a shell meta pattern in procmail action lines to work as intended)
FORMAIL=/usr/bin/formail
# Location of file containing From: addresses of people we correspond with on a regular basis
NOBOUNCE=${HOME}/.nobounce
#Location of a folder containing blacklisted email.
SPAMFOLDER=${MAILDIR}/spam
# Uncomment this if you would rather just delete the blacklisted email.
#SPAMFOLDER=/dev/null
# Location of a file containing regular expressions of patterns that we don't want.
# to see in the Subject: From: or Reply-to: headers
BLACKLIST_PATTERNS=${HOME}/.blacklist_regexp
# Location of file containing To: addresses we have given to news letters
# or web sites that map to my real account via sendmail aliases.
SUBAUTH=${HOME}/.authorized-subscription-aliases
# Capture the message ID string (if any) for future reference in log entries.
:0
* ^Message-ID:
{ MESSAGEID=`${FORMAIL} -cx "Message-ID:" |sed -e 's/[ \t]\{1,\}//g'` }
:0 E
{ MESSAGEID='none' }
# Sample procmail recipe to enumerate the Received: headers, and store them
# in the ${RECEIVEDHEAD} variable. Note the backtics that launch an embedded
# shell script.
:0 W
* H ?? 1^1 ^Received:
{
RECEIVEDCOUNT=$=
RECEIVEDHEAD=`${FORMAIL} -X "X-Originating-IP" -X "Received" | /usr/local/bin/extractlastip.pl`
LOG="[$$]$_: RECEIVEDHEAD=${RECEIVEDHEAD}${NL}"
LOG="[$$]$_: RECEIVEDCOUNT=${RECEIVEDCOUNT}${NL}"
}
# Sample procmail recipe which will extract the IPv4 address from the first
# Received: header. This could be adapted if you have several internal
# servers through which the mail passes.
# Also, the header IP extraction in this recipe is assuming that the header line was
# generated by sendmail. If you are using another server, you may need to adjust
# the regular expression to accommodate that.
# Initialize the SOURCEIP variable
SOURCEIP='000.000.000.000'
:0
* RECEIVEDHEAD ?? [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
{
SOURCEIP=${RECEIVEDHEAD}
LOG="[$$]$_: Extracted IP ${SOURCEIP} from Received: headers.${NL}"
}
:0 E
{ LOG="[$$]$_: Failed to find any source IP in the first Received: header.${NL}" }
# Sample procmail recipe which will generate the reverse IPv4 from
# the SOURCEIP, for use in blocklist lookups.
# It will also verify that the number we are looking at is a real Internet
# address.
# Initialize the SOURCEIPREV variable
SOURCEIPREV='000.000.000.000'
# Check for valid IPv4 address range.
# Then if the address is not an IANA non-routable address
# generate the reverse IP for use in subsequent DNS lookups.
# Build a procmail style regular expression to test for a valid IPv4 range.
OCTET='([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
IPV4RANGECHECK="(${OCTET}\.${OCTET}\.${OCTET}\.${OCTET})"
# Build a procmail style regular expression to test for IPv4 ranges that should not be used on the Internet.
# These are based on RFC-3330 Para 3 summary table.
# Note: These expressions should be periodically verified and updated as needed
CLASSA="((0|10|39|127|2(4[0-9]|5[0-5]))\.${OCTET}\.${OCTET}\.${OCTET})"
CLASSB="((169\.254|128\.0|172\.(1[6-9]|2[0-9]|3[0-1])|191\.255|192\.168|198\.1[8-9])\.${OCTET}\.${OCTET})"
CLASSC="((192\.0\.[02]|223\.255\.255)\.${OCTET})"
# Combine the above into one regular expression.
# Note: IP 255.255.255.255 is included in network 240.0.0.0/4 defined above
#       as part of the CLASSA regular expression variable.
RFC_3330_INVALID="(${CLASSA}|${CLASSB}|${CLASSC})"
:0
* ! SOURCEIP ?? ^(000\.000\.000\.000)$
* $ SOURCEIP ?? ^${IPV4RANGECHECK}$
{
:0
* $ ! SOURCEIP ?? ^${RFC_3330_INVALID}$
{
:0
* SOURCEIP ?? ^[0-9]+\.[0-9]+\.[0-9]+\.\/[0-9]+
{ QUAD4=${MATCH} }
:0
* SOURCEIP ?? ^[0-9]+\.[0-9]+\.\/[0-9]+
{ QUAD3=${MATCH} }
:0
* SOURCEIP ?? ^[0-9]+\.\/[0-9]+
{ QUAD2=${MATCH} }
:0
* SOURCEIP ?? ^\/[0-9]+
{ QUAD1=${MATCH} }
SOURCEIPREV="${QUAD4}.${QUAD3}.${QUAD2}.${QUAD1}"
LOG="[$$]$_: IP ${SOURCEIP} is a valid IPv4 address${NL}"
IPV4VALID=yes
}
:0 E
{
LOG="[$$]$_: IP ${SOURCEIP} is an IANA Non-Routable IPv4 address${NL}"
IPV4VALID=no
}
}
:0 E
{
LOG="[$$]$_: Error - ${SOURCEIP} has an invalid range for an IPv4 address.${NL}"
IPV4VALID=no
}
# Here is another example of a more complex blocklist lookup technique
# which will lookup an IP on zen.spamhaus.org, decode the response, and
# tag the email.
# References:
# http://www.spamhaus.org/zen/index.lasso
# http://www.spamhaus.org/faq/answers.lasso?section=DNSBL%20Technical#200
SPAMHAUSLISTED=no
SPAMHAUSLOOKUP=`host ${SOURCEIPREV}.zen.spamhaus.org`
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.([2-9]|1[01])$
{
# 127.0.0.2 SBL Spamhaus Maintained
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.2$
{ SPAMHAUSLOG="SBL, " }
# 127.0.0.3 --- reserved for future use
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.3$
{ SPAMHAUSLOG="${SPAMHAUSLOG}127.0.0.3, " }
# 127.0.0.4 XBL CBL Detected Address
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.4$
{ SPAMHAUSLOG="${SPAMHAUSLOG}CBL, " }
# 127.0.0.5 XBL NJABL Proxies (customized)
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.5$
{ SPAMHAUSLOG="${SPAMHAUSLOG}NJABL Proxies, " }
# 127.0.0.6 XBL reserved for future use
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.6$
{ SPAMHAUSLOG="${SPAMHAUSLOG}127.0.0.6, " }
# 127.0.0.7 XBL reserved for future use
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.7$
{ SPAMHAUSLOG="${SPAMHAUSLOG}127.0.0.7, " }
# 127.0.0.8 XBL reserved for future use
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.8$
{ SPAMHAUSLOG="${SPAMHAUSLOG}127.0.0.8, " }
# 127.0.0.9 --- reserved for future use
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.9$
{ SPAMHAUSLOG="${SPAMHAUSLOG}127.0.0.9, " }
# 127.0.0.10 PBL ISP Maintained
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.10$
{ SPAMHAUSLOG="${SPAMHAUSLOG}PBL-ISP Maintained, " }
# 127.0.0.11 PBL Spamhaus Maintained
:0
* SPAMHAUSLOOKUP ?? 127\.0\.0\.11$
{ SPAMHAUSLOG="${SPAMHAUSLOG}PBL-SpamHaus Maintained, " }
SPAMHAUSLOG=`echo "${SPAMHAUSLOG}" |sed -e "s/, $/\n\tSee: http:\/\/www\.spamhaus\.org\/query\/bl\?ip=${SOURCEIP}/"`
LOG="[$$]$_: Result codes: ${SPAMHAUSLOG}${NL}"
:0 f
|${FORMAIL} -A "X-blocklists: ${SOURCEIP} found in SpamHaus. Blocklist lookup results: ${SPAMHAUSLOG}"
SPAMHAUSLISTED=yes
}
:0
|

Obviously this is open to abuse because the spammer could add additional received headers to throw the recipe off the scent, however I can’t see that happening unless this becomes a popular way of filtering. Also if there are any non RFC compliant SMTP servers between the spammer and you they may mess with the headers which could screw the whole thing up also. You can’t please all the people all the time.

Boost your mobile broadband using an antenna – a definitive guide

It’s been a while since I wrote about boosting your mobile broadband signal using an external antenna. I thought I would write a guide in response to a call I got this AM from Joe Campbell. It took a few minutes even after the call for me to realise what he was looking for; What follows then is a list of the best ways to boost your mobile broadband signal versus the amount of effort required, in order of the most effort and best results to least:-

  1. Use an old satellite dish, outside, with a USB HSDPA modem taped to the spot the transponder is supposed to go, run a long USB cable back indoors to your router/PC. Waterproofing is an issue, upside down polystyrene cups and ingenuity are the order of the day. I haven’t actually tried this one but given the dishes are supposed to capture signals from outer space you would think it would give the best results.
  2. Buy an external high gain antenna (hopefully your modem has a suitable connector), mount it outdoors, use the shortest possible cable to connect the antenna to a USB HSDPA modem (to minimise attenuation) and a long USB cable from the modem back to your router/PC.
  3. Place your modem outdoors and waterproof it, run a long USB cable back indoors to your router/PC.
  4. Buy an external high gain antenna/place modem in middle of large saucepan, try to place as near to window as possible. Remember to keep antenna cable, if using, as short as possible because of attenuation.
  5. Buy an external high gain antenna/place modem in middle of large saucepan, put where convenient, again keeping antenna cable  as short as possible if using.

In all cases pointing in different directions and putting in different locations will make a difference, as the Americans say “Your Mileage May Vary”. Use whatever apps you have available to determine the signal strength at each location and find the best spot and orientation.

Being more aware of companies “branding” goals

I think a lot of people can atest to referring to a particular type of technology by using the brand name of the most widely popularised incarnations of same. I’m sure I have, though I cannot think of how at this moment. One particular example comes from Jeremy Clarkson. Whenever he refers to MP3 connectivity in a car test he uses “Ipod connectivity”. Apple must be very pleased when a product of theirs becomes so ubiquitous people use it’s name instead of using a generic term. Indeed I think this must be a goal of companies in general. It is the kind of publicity that cannot be paid for and leads to the less informed jumping to such a product before evaluating others in a “if it’s so popular it must be good” sort of way.  I’m sure I’ve been guilty of that one too.

Is it a good thing though?  At the end of the day it is only putting money in the coffers of share holders, driving corporate machines, faceless entities that seem to take on an ambivalent personality not present in the sum of their employees. Perhaps if more people referred to technologies in terms of standards (as in ISO, RFC’s, etc.) or generic names for a class of devices, it would provide a fairer market? This sort of thing doesn’t happen with all technologies. DVD players for example. Perhaps it is only products which have very strong marketing behind them which are elevated to “everyday speech” status.

There are more pressing and important issues in the world, but maybe by taking back ownership of such terms and not turning a blind eye to corporate hijacking of same would help to make the world a little bit fairer and therefore a little bit nicer. Then again who cares? I suppose capitalism, commercialism and consumerism are such endemic parts of western culture some people feel emotionally attached to things as personal as “branding”, to the point where it becomes more of a pet name; something that in some cases will not be let go of easily.

Remove residual config files in Ubuntu – A one liner

I have spent literally hours over the last year or two searching for an elegant way to remove configuration files left over from package installs, in a command line environment, with Ubuntu.

Googling would provide a frustrating list of solutions that would either involve installing extra packages, using a complicated command line, or script, solutions that I would never be happy with and would “redo” the search again, each time I wanted to perform the same task, in the hope of finding something better.

In the end Aptitude and Xargs were my friends. Without further ado ….

aptitude -F %p search '~c' | xargs dpkg -P

Please note this command is meant for server/cli environments only. Desktop users should use Synaptics and the “Not Installed (residual config)” status. Nanny out.

Remotely upgrading a server from 32 to 64 bit linux

This post isn’t designed to be a “how to” merely an overview of how I achieved the subject. It is possible to do this without any physical intervention but in practice I have had to visit site at least once to fix a boot error on every one I have done.

Disclaimer:- When attempting this having some sort of remote access solution that will give access to the server even when it won’t boot is desirable i.e. BMC, DRAC or KVM over IP. Obviously resizing and deleting partitions and file systems is very dangerous so you need to be ultra careful and ultra sure you understand the process and exactly what you are doing at each step. It may also be helpful to draw the partition layout at each stage so you have a clear view of what is happening. Don’t come crying to me when it all blows up in your face. You have been warned!

The steps to achieve this are:-

  1. Create a minimal 64 bit ubuntu install to fit inside 512MB (I used KVM and the Ubuntu alternate installer CD as I don’t have hardware virtualisation extensions in my CPU and purged un-needed packages and the apt cache). Resize the filesystem and partition as small as possible i.e. circa 480 MB to make sure it will fit inside the target swap partition space.
  2. Replace the swap partition on the target server with the disk image you have just created using dd. Use rsync with compression to upload the disk image file to the target server and save time.
  3. Copy the kernel from the created partition into the boot partition of the target server and update Grub accordingly. Don’t forget to put the correct root option onto the kernel command line.
  4. Boot from the new kernel and what was swap partition. Normally something goes wrong after changing Grub that involves a site visit.
  5. Resize the system partition of the target server to make room for a new partition. Not forgetting to make the filesystem and partition size as small as possible to speed copying with dd.
  6. Create a new partition and use dd to copy the existing system partition to the new partition.
  7. Erase the original system partition, resize the created partition (the one that was swap) reboot and do an online resize of the file system to take advantage of the extra space.
  8. Copy data and config files from copied system partition to the new (the one that was swap).
  9. Copy users and groups from /etc/passwd /etc/group and /etc/shadow, http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/ is very useful in that regard. Manually check the files created to delete any unnecessary groups and accounts.
  10. Install needed services checking each one works correctly. Most config files should migrate directly even if from a different distro.
  11. At some stage, when you’ve established everything is working, and you don’t need any data from the old install, delete the partition the original system partition was copied to in step 6 and create a new swap partition (preferably a big one in case you need to do something like this again in future).

Any questions? No? Good!