Tagged vs. Untagged VLANs

I finally got it through my head today the difference between adding a port to a VLAN in tagged vs. untagged mode.

Tagged means that traffic with the VLAN ID already attached—that is tagged traffic—will be passed. Untagged means that traffic without the VLAN ID already attached will have the VLAN ID inserted—that is, it will be tagged—and then passed. That way if there is a device that you want to be on a particular VLAN, put the port the device is connected to into untagged mode for whatever VLAN you want, and the traffic from that device will be tagged with the VLAN ID. Tagged ports are trunked ports, that is you can assign multiple VLANs to a port and it will allow all traffic with the appropriate tags to pass.

Please feel free to correct me in the comments if you think this is incorrect.


Reset Profile Manager in OS X El Capitan

If you’ve needed to fully reset Profile Manager and you’re running OS X El Capitan and the server app version 5.1.5, you’ll not find a whole lot of information. Luckily the process is almost exactly the same as outlined for Mavericks in this official Apple support page. We only have to change the last line, because the shell script it refers to has moved in El Capitan. Follow these steps to fully reset the Profile Manager:

sudo serveradmin stop devicemgr
sudo serverctl disable service=com.apple.DeviceManagement.devicemgrd
sudo serverctl disable service=com.apple.DeviceManagement.postgres
sudo mv /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL ~/.Trash
sudo mv /Library/Server/ProfileManager/Config/ServiceData/Data/backup ~/.Trash
sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/deviceManagerCommon.sh

I hope this helps you out. Let me know if there are any problems.

Executing an arbitrary function from a PHP file on pfSense

I accidentally overwrote the bind service’s startup script in /usr/local/etc/rc.d/. I had no backup, and I couldn’t remember the contents of the file. I had a look at the pfSense github packages repository and had a look through the bind section. I found bind.inc which had a function called bind_write_rcfile(). I toyed around with the idea of copying and pasting the code by hand, replacing the variables with their values (or what I thought were the values). I remembered that pfSense has a developer shell which allows you to execute PHP code. You type in the PHP and then type exec and press enter. The code gets executed. Yay. I required_once('bind.inc') and then pressed enter, then typed exec and again pressed enter. I jumped into the shell and checked the contents of the file, and hey presto! it was fixed.

This post is for my future reference. I hope it helps you too!

Manny in Hospital

Relay for Life

Some months ago, almost my entire family took part in the Relay for Life, a 24-hour fundraising event. I posted about it beforehand. We raised over AU$20,000. Below is a speech I gave during the formalities.

On Fighting Back

Since my son Emmanuel was diagnosed with liver cancer when he was 11 months old, I have been reflecting on the idea of the ‘battle with cancer’ and how it could apply to one so young. Was he too young to be able to battle anything, let alone cancer? Does he even know what is going on? Is he capable of fighting back? I am not sure if Little Manny is in the way you or I are, but that doesn’t matter because I am not really a good fighter, I give up too easily. But Manny has shown me what it means to be a good fighter. He has shown me to always be positive, to keep keeping on, not lie down and let things overwhelm me, to walk forward with my head held high and my eyes on the horizon. Live in the moment, don’t wallow in misery for too long or you’ll miss out on what’s happening now, which you may never be able to get back. After our experiences with Manny, I know that if I ever have to go through what he has, I will know what to do. He has been the example for me.

He has been poked, pricked, prodded, pushed, pulled, and pumped full of more drugs than I care to remember. He has had major surgery which has left him with half a liver (the only organ that is capable of regenerating). I’ve never had a general anaesthetic; Manny’s had about 5. He’s been through the wash, wrung out and hung to dry. Multiple times. But he’s not let that stop him. Cancer? Pah, he says! Chemotherapy? Bring it on, he cries! All Manny cares about are his broom-brooms and throwing balls around the house. And milk from Mummy, but that’s another story. Nothing has stopped him smiling and laughing up at us for too long, or waving at the nurses and doctors, or at any random person for that matter. He still gets sick with excitement when he gets his favourite truck to play with, or when its time to read ‘Where is the Green Sheep?’ or any of his other favourite books (again). Manny has the resilience of children, but he also has a friendly and outgoing nature that makes the battles faced by friends and family more easy to bear.

We are all fighters, all of us here. Just by being here, taking part in an event such as this, we are all part of the global search, the fight for a cure for cancer. Everyone that donated or helped or supported is part of the fight. And the greatest weapon we have is hope. We must never lose hope. We must never lose hope.

Going Up Quickly


Time-saving Bash Techniques

If you are a nerd and love hacking away at your UNIX-like machine’s command line, then chances are you know that things can get really repetitive very quickly. One of my pet peeves is changing-directory upwards towards the root directory by typing cd ../../ or some such command. Some people alias two dots to the cd command to go up one level, 3 dots to go up 3 levels, or whatever. To me this is clunky. I wanted something more flexible. So up was born. up is a Bash function that takes one argument: the number of directories you want to go up. If you do not specify an argument, up will take you up one directory.

So if you are at /this/really/deep/directory/looking/around, instead of typing lots of dots and slashes to get to /this/really/deep, just type up 3. Simple and Quick. Unless you are really, really deep, you’ll probably only ever have to type a maximum of 5 keystrokes to go up to any level, whereas with cd, you’ll have to type ../ as many times as levels you want to go up. That’s at least 6 (5 if you leave off the trailing slash) if you want to go up only one level. There’s some Big-O notation just waiting to happen from that scenario.

Check out the code:

Include that in your .bashrc.

Very simple, but not without its problems. If you use the cd - command to go to the last directory you were in, this will break that because it cds multiple times. A solution to that is to build a string with the corresponding number of ../ entries you want to go up, then passing that as an argument to cd. I am sure there are more problems, and if you want to contribute to the betterment of nerdkind by improving the function, please fork my gist and issue a pull-request.

Help Find a Cure

No-one is safe from cancer, not even children, even very young children. I am no expert with anything medical, but I know this for a fact.

My 1-year-old son Emmanuel has a form of liver cancer called Hepatoblastoma. Thankfully this type of cancer is highly curable and he has a good prognosis. So many others don’t however. We have met many people over the last month whose children are back in hospital with their second bout of cancer. One of them was first diagnosed with cancer when he was 16 days old; he is now only 7 months and the cancer has returned. My heart goes out to all of them, and they inspire me, who are facing their difficulties with tremendous strength and courage.

We count ourselves as lucky that we are in such a good hospital, and that our country’s health care system means that we don’t have to pay for treatment. We have a huge support network consisting of friends, family, and people we don’t even know. We are lucky because Manny’s cancer is curable. We are most lucky because we have such a gorgeous little boy. Manny has been so good through the intrusiveness of all the tests before being diagnosed, and now through all his treatment. He is a little champion, and is an inspiration.

The Cancer Council holds an annual event: Relay for Life, a 24 hour fundraising walking event. I am taking part this year and need donations! You can do so by visiting my fundraising page and then clicking “Sponsor Me”. Anything is highly appreciated.

I’d love to hear from you especially if your child has had Hepatblastoma, or if you had it when you were younger.

Press All the Things…

So I finally managed to get my hands onto a nipping press. It is a lovely little cast iron baby, with a turn-wheel instead of a handle. It’s in pretty good nick: the paint is peeling in a couple of places and the screw is a bit rusty (luckily it only looks like surface rust).

You may remember that I was planning to make my own nipping press from wood. Well, that’s not going to happen any more is it? It’s probably a blessing in disguise so I’m not that worried about it. I may still build one and sell it. Would you be interested in buying a wooden nipping press? I have a few projects on at the moment, so one less is no worries.

I’ll post some more pictures once I’ve cleaned it up a bit.

Happy bookbinding!