Jul 242015

I’ve been searching for a while on how to centre the Nav bar in a bootstrap fluid container.
Finally after hours of Googling, I came across this CSS snippet –

.navbar-nav {
width: 100%;
text-align: center;
.navbar-nav > li {
float: none;
display: inline-block;

Source: http://codepen.io/davidcochran/pen/rcHae

Applying this to my Navbar allows me to centre it as per the source example.

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="pull-left"><a class="navbar-brand" href="/"><img src="/img/navbar/logo.png" /></a></li>
<li><a class="navbar-brand" href="/blog">Blog</a></li>
<li><a class="navbar-brand" href="/archives">Archives</a></li>
<li><a class="navbar-brand" href="/contact">Contact Us</a></li>

This present me with a nicely centered navbar like this –

Nicely Centred Navigation with a logo on the left

Nicely Centred Navigation with a logo on the left

Jul 162015

I recently had a thought…I wonder if Zabbix can graph the fuel prices near me.
This thought was triggered by a news article I read about how the petrol station cycles have changed so that the cheapest fuel is on a Monday rather than a Wednesday like it used to be.
Continue reading »

Jul 092015

So after poking around with the bootloader, I decided to go look for the stock firmware to see if I could upload that with some modifications so I could play around with the stock system.

After a night of Googling, I couldn’t find any links to the original firmware. I tried to discover if I could download the firmware from the NAS, but that didn’t get me anywhere either. All the Googling did point me in the direction of SnakeOS however, which is replacement firmware for some NASes. However, it hadn’t been maintained in quite a few years so I was initially a bit hesitant.
Continue reading »

Jul 062015

I received my USB to TTL adapter today, so decided to have a look at the NAS and see if I could get root access to it.

The Serial console is actually under where the drive is, so I’ve gotten access to it from the bottom as there’s some plastic between where the drive goes and the port itself.

NAS Connected via Serial

NAS Connected via Serial

As you can see from the picture, I’ve stuck some jumper cords into the serial console port. The Yellow wire is actually the white wire on my USB->TTL converter, the green is still green, and black is still black. With the jumper leads plugged in, I turned the NAS On with screen listening on /dev/ttyUSB0 with a baud rate of 38400.
Continue reading »

Jul 022015

I’ve just started working with Powershell recently and wanted to create a CSV file from scratch.
I thought it’d be as simple as piping a string to Export-CSV, however Export-CSV only takes objects.
This meant that I had to create my own objects to then dump into Export-CSV.
This wasn’t immediately obvious to me initially, as I’ve little experience with Powershell, but since I’ve worked out how to do it, I’m going to document it here for reference.

$csvContents = @() # Create the empty array that will eventually be the CSV file

$row = New-Object System.Object # Create an object to append to the array
$row | Add-Member -MemberType NoteProperty -Name "User" -Value "John Doe" # create a property called User. This will be the User column
$row | Add-Member -MemberType NoteProperty -Name "UserID" -Value "JD01" # create a property called UserID. This will be the UserID column
$row | Add-Member -MemberType NoteProperty -Name "PC" -Value "PC01" # create a property called PC. This will be the PC column

$csvContents += $row # append the new data to the array

$csvContents | Export-CSV -Path C:\tmp\user.csv

The code above will result in the following output

#TYPE System.Object
"John Doe","JD01","PC01"