mcwhirter.com.au
RSS Atom Add a new post titled:
Satanic Shed of Geeveston

I've walked this trail "around the block" through the dense pine and eucalypt plantations many times before but it was only yesterday that a shape embedded in a pine plantation caught my eye:

Shed, long shot

Whomever had planted this particular planation had just left the old shed where it was and planted the plantation around it. How had I missed this before?

Shed, short shot

So I headed in for a closer look and the tin on the roof was much younger than the shed itself.

Shed, through shot

After crunching my way across the moss and pine needle carpeted forest floor, this spooky scene greated me as I stepped gingerly inside the shed:

Shed, inside shot

Admittedly the lack of evidence of actual satanic ritual was an anti-climax but I enjoyed the find none-the-less.

Shed, rear shot

Enlightenment 0.18 Won't Suspend on Debian

I recently switched my Debian (Sid) laptop from Enlightenment 0.17 to 0.18. After the upgrade my laptop would no longer suspend. A minor but inconvenient problem for which there were many possible rabbit holes to run down and I ran down a few.

Enlightenemnt

All of the leads were dead ends for me but one thing I kept reading was how Enlightenment hooks into systemd if it's installed. Installing systemd was on my ToDo list, so I opted to install it and see if that brought me any E18 suspend love.

Debian

My Debian (Sid) installation already had systemd installed:

$ dpkg -l | grep -i systemd
ii  systemd     204-7   amd64   system and service manager

but it wasn't active:

$ cat /proc/1/comm
init

So I hit up the Debian wiki entry for systemd and saw that I just needed to install systemd-sysv and reboot:

$ sudo apt-get install systemd-sysv
$ sudo reboot

After the reboot, E18 suspended perfectly and systemd was the default:

$ cat /proc/1/comm
systemd

Can't get much more elegant than that :-)

A Script for Broken Links

The Scenario:

Imagine that there's been a tumultuous cut over from one website to another that's left you with over 6,000+ broken links ruining your search engine foo. As a sysadmin you can't fix the missing content but you can bring some peace to those 404s.

You programatically converted a report of those 6,000+ URLs into an Apache redirect file, reloaded Apache tested a couple of redirects manually and they were fine but you're not going to manually test those 6,000+ URLs are you? (the answer's "no", in case you're unsure).

My Nasty Hack Solution

I wrote broken_links.sh to address testing workload (available from my git repo or via github). When run, broken_links.sh asks for where the file of raw URLs is and where you would like any links that are still broken saved to.

Sample Input File of URLs to be Tested

$ cat /tmp/URLs.txt
https://mcwhirter.com.au/
http://www.debian.org/
http://mcwhirter.com.au/broken.html

When you run broken_links.sh, your output will be similar to the below:

$ ./broken_links.sh
Enter the path and file name that contains the broken URLs:
/tmp/URLs.txt
Enter the full or relative path & file name for the list of still broken URLs:
/tmp/broken.txt
Now checking: https://mcwhirter.com.au/
Now checking: http://www.debian.org/
Now checking: http://mcwhirter.com.au.au/broken.html

Total URLs in the file: 3
Total URLs still broken: 1 /tmp/broken.txt

The output to the requested broken.txt looks like this:

http://mcwhirter.com.au.au/broken.html

Happy hunting still broken URLs :-)

That's Not a Zuccini...

Most of the work we've done on the farm since we moved there has been around livestock, planting hedges and wildlife corridors but no food. Late last year I built Kristina a rose bed out of goat bedding, alpaca and horse manure which was promptly planted with tomatoes, pumpkins and zuccinis instead.

it's now zuccini harvest time and we thought we'd found a monster yesterday:

THAT's not a zuccini:

THAT's not a zuccini Then we found this one today:

THIS is a zuccini:

THIS is a zuccini

Hamish and Sen - Explorers

Another magical Summer's day in the Huon Valley:

Roaring Beach

The cave at Roaring Beach: The cave at Roaring Beach Intrepid explorers: Intrepid explorers: Glad their mothers didn't see them climb this: Glad their mothers didn't see them climb this The eagles over looking the beach: The eagles over looking the beach When too much fun is not enough: When too much fun is not enough: Panoramas are thing now: Panoramas are thing now

Geeveston Car Show

Getting in touch with her bourgeois side: Getting in touch with her bourgeious side We saw a lot of EH Holdens: We saw a lot of EH Holdens

Learning Python the Hard Way

I've recently started learning Python. In particular I've started Learning Python the Hard Way which I'm now half way through while I wait for O'Reilly's book Learning Python to arrive.

Python

The free HTML version has been enjoyable and well paced experience. I highly recommend it for anyone else interested in picking up python.

I've been punting my exercises up into my gitweb repo which I'm also mirroring to my github account. Yay for free backups.

Utilising VLANs in OpenWRT

There are many ways you can utilise VLANs in OpenWRT. This documents particularly how to configure a TP-Link WDR4300 running OpenWRT 12.09 to conform to an existing VLAN topology, where VLAN 1 is for data and VLAN 2 is for VOIP (voice) traffic.

OpenWRT logo - Wireless Freedom!

Create a third VLAN:

By default OpenWRT comes with VLANs disabled and when enabled, there are two VLANs. VLAN 1 is for the lan interface and VLAN 2 is for the wan interface. Here we have to enable VLANs, create a third VLAN and swap configurations between VLAN 2 and 3:

  • Click on Network.
  • Click on Switch.
  • Select Enable VLAN functionality.
  • Scroll down and click on Add - VLAN ID 3 should appear.
  • Make VLAN 3 settings the same as VLAN 2
    • Set CPU to tagged for VLAN 3
    • Set Port 1 to off for VLAN 2
    • Set Port 1 to untagged for VLAN 3
  • Press Save

Re-Configure the WAN Interface

Now we need to tell the WAN interface to use VLAN 3 instead of VLAN 2:

  • Click on Network.
  • Click on Interfaces.
  • Click on Edit for the WAN interface
  • Click on Physical Settings
    • In Interface select VLAN Interface: "eth0.3".
    • Press Save & Apply.
  • Check that wan is set to VLAN Interface: "eth0.3"
  • Re-check the Switch settings are as per the previous section.
  • Click on System then Reboot.
  • Click on Perform reboot.

It can take about a minute for services to return after this reboot.

Create the Voice VLAN Interface

Welcome back! Hopefully you didn't make any typos and haven't had to factory reset the box once or twice to get here. Now we're going to create the interface for voice traffic:

  • Click on Network.
  • Click on Interfaces.
  • Click on Add new interface...
  • Name the interface appropriately, I'll use Voice for this example.
  • Ensure the interface is set to Static address.
  • Set Cover the following interface to VLAN Interface: "eth0.2".
  • Press Submit.

You will now be taken to the page titled Interfaces - Voice.

Common Configuration

General Setup

Here we set the basic IPv4 configuration for this interface (did I mention I'm assuming IPv4?).

  • Set the IPv4 address as appropriate.
  • Select a class C netmask (255.255.255.0) if you have a class C network (most likely)
  • Press Save.

Firewall settings

After clicking on the Firewall Settings tab, we will assign the Voice interface to the lan firewall zone:

  • Select lan.
  • Press Save.

DHCP Server

General Setup

I required a DHCP server for the VOIP handsets, so here's what we set:

  • De-select Disable DHCP for this interface.
  • Set the Limit to 100
  • Press Save.

That's it. Everything else is automatically determined by the IPv4 address you set in Common Configuration. I set the limit 100 as that is the dedicated DHCP range for VOIP handsets on that LAN. You could probably safely leave it at 150 (the default) or set it to the range appropriate for your network.

Switch Configuration

Now we need to tell the OpenWRT switch which ports will be active on the Voice VLAN. In this example I select all 4 LAN ports on the WDR4300:

  • Click on Network.
  • Click on Switch.
  • Set Port 2 through to Port 5 as tagged for VLAN 2 (as per picture below)
  • Press Save & Apply.

This picture illustrates the connection between switch ports in OpentWRT and the physical ports on the WDR4300, as well as the final switch configuration: openWRT Switch to WDR4300 Ports

Send it live!

Okay, let's roill the dice and hope it comes back up:

  • Click on System then Reboot.
  • Click on Perform reboot.

If you've not made any typos, it should all came back up and you'll have a working VLAN 2 for voice. If you can't access the box, you've made typo. Factory reset and try again. Happy VLAN-ing!

This site is powered by ikiwiki.