Author Archives: dave
Author Archives: dave
For the last 9 months, I've been silently working on a little pet project. It's finally ready to be released in to the wild and to be used by one and all for creating Python-based SDN Applications for the HP VAN SDN Controller.
When I started working with the HP VAN SDN Controller (while it still had a cool code name) it became immediately apparent to me that extending the controller with Java applications is not for everyone. There's lots of heavy lifting to be done with things like Maven, OSGi and Remote Debugging. Not only that, but I am not a "Java guy" (or was not until recently to be more exact) and being able to rapidly prototype applications in Python appealed to me.
The HP VAN SDN Controller's REST API exposes a large amount of the functionality available to the Java API with the exception of handling OpenFlow Packet-In, Packet-Out events. For a large number of applications this is absolutely fine, and this is where I hope this library will be useful.
The library is licensed under the Apache 2.0 license so it's free for all to use. The source is hosted on GitHub Continue reading
Part 2 of a this 3 part series examines how I created my Pelican blog and migrated my Wordpress content with me.
If you haven't read Part 1 already, it will give you some background as to what I'm doing and why I'm doing it.
Assuming you already have a working Python, starting a new blog is as easy as installing a few dependencies and using the pelican-quickstart
pip install pelican Markdown
mkdir blog
cd blog
pelican-quickstart
Welcome to pelican-quickstart v3.3.0.
This script will help you create a new Pelican-based website.
Please answer the following questions so this script can generate the files
needed by Pelican.
> Where do you want to create your new web site? [.]
> What will be the title of this web site? Dave's Blog
> Who will be the author of this web site? Dave Tucker
> What will be the default language of this web site? [en]
> Do you want to specify a URL prefix? e.g., http://example.com (Y/n) Y
> What is your URL prefix? (see Continue reading
I've been blogging with Wordpress for the last 5 years on and off. It has some great features and is very easy to use, but it's not for me. This series of posts documents my transition from Wordpress to Pelican.
There are a few things about Wordpress that have been bothering me lately
As with anything that relies on server-side scripting, there is performance hit when loading pages. I've been running my blog on a Linode 1024 VPS ($20 per month) and had found that I had to move from Apache to Nginx to get decent performance with Wordpress. Adding Caching to the equation with one of the many caching plugins available has also helped, but this is a rather complex solution. Another performance bottleneck is the database...
Wordpress requires a MySQL database in the back end. I am not a big MySQL fan and would prefer to run Postgres or MariaDB but this isn't officially supported in Wordpress right now. Not only is a performance bottleneck, but it is also another thing that needs to be backed up.
The Backup/Restore capabilities of Wordpress are decent, Continue reading
A list of links for getting started to use Python to develop application with the HP VAN SDN Controller.
Python 2 Tutorial
Python 3 Tutorial
Codeacademy
Sublime Text
Setting up Sublime Text for Python
PyCharm - A Python IDE
Remote Debugging OpenDaylight with IntelliJ is as easy as 1, 2, 3
1) Go to Run
> Edit Configurations
2) Add a new Remote Configuration
3) Configure it as follows:
While setting up my OpenDaylight OVSDB and Devstack following the awesome instructions from Kyle Mestery, I thought it would be fun to run the latest OVS from source on my compute nodes...
To do this, execute the following commands on one of your compute nodes
before running stack.sh
sudo apt-get -y --force-yes install build-essential devscripts
gcc dkms make automake autoconf debhelper libssl-dev
pkg-config python-all python-qt4 python-zopeinterface
python-twisted-conch gdebi-core dh-autoreconf hardening-wrapper
libtool graphviz ipsec-tools module-assistant python-twisted-web
racoon git
git clone git://git.openvswitch.org/openvswitch
cd openvswitch
./boot.sh
dpkg-buildpackage -b -us -uc -nc
cd ..
Once you’ve built the .deb
’s you can copy these to your other compute
nodes using scp
:
scp *.deb ubuntu@devstack-compute2:
Replace ubuntu
with your username and devstack-compute2
with the
name or IP address of your other compute nodes.
Finally we can install the packages as follows:
sudo dpkg -i *.deb
At the time of writing this will build Open vSwitch 2.1.90. You can check the version as follows:
sudo ovs-vsctl --version
Which will give the following output
ovs-vsctl (Open vSwitch) 2.1.90
Compiled Jan 16 2014 15:18:45
Huge thanks to @FlorianOtel for his help with Devstack!
@dave_tucker
When I’m writing code, I’m usually in OSX. When I want to try things out, or check for compatibility between certain versions of Python, it’s handy to have them all accessible… enter Pyenv. Pyenv is based on Rbenv, which for you non-Rubyists is a tools that allows you to set up Ruby environments that are scoped either globally, per-shell or per-folder!
If you aren’t using Homebrew already, which I highly recommend you should, then install it.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Before you start brewing you should run “brew doctor”. This will check that everything is ok with your installation.
brew doctor
Hopefully you will get a message “Your system is ready to brew”, otherwise doctor brew will oftentimes tell you what to do.
brew install python
brew install pyenv
The above commands will, install homebrew’s Python 2.7 (to replace the system pyhton) and install pyenv. Replacing the system Pyhton fixes issues with needing “sudo” for easy_install and others documented here
Now Pyenv is installed, you should edit your “~/.bash_profile” and add the following:
export PYENV_ROOT=/usr/local/opt/pyenv
eval "$(pyenv init -)"
This changes the Pyenv root path and makes sure pyenv is initialized.
$SHELL -l
When my new HP ML10 arrived I was ready to install ESXi… until I realised that my 32GB of RAM wouldn’t be on its way for a week! To get around the memory check in ESXi 5.5, I found the awesome instructions here and with a few tweaks was able to get this working. Here are the 20 steps that I followed…
Using a few guides on the web and a little bit of ingenuity I was able to get my FTDI-based, USB to 2x Serial adapter working in Mac OSX 10.9 Mavericks with iTerm 2. This post documents the process and resources used in the hope of becoming the definitive guide to setting up a USB serial adapter in OSX and using iTerm2 as the terminal emulator. Even if it isn’t quite definitive, it should at least be useful to others - I hope!
The dual serial adapter above is my weapon of choice. You can pick one up for about £20 on Amazon(not an affiliate link). Generally speaking, I’ve had better experience with FTDI chipsets so if you are in the market for an adapter, I’d recommend checking the chipset first…
Most likely you have used a USB-serial adapter in Windows. When installed It appears as a COM port, you point TeraTerm or HyperTerminal to that COM port and everything automagically works. In Continue reading
Every week I see somebody ask “will all Network Engineers be programmers” on Twitter, LinkedIn, at a trade show or just to be antagonistic and for no other reason than to start an argument.
The anger inside has been brewing for over 12 months until the pressure valve finally released in the form of this blog post. Expect snark.
Lets clear something up. IF YOU CAN WRITE ONE LINE OF RUBY YOU ARE NOT A PROGRAMMER. The Programmers of myth and legend are these days referred to as “Software Engineers”, “Software Architects” and sometimes even “Hackers”, “Coders” or “Code Monkeys”. What they “do” - is build software for a living.
The networking industry can be broken in to four main segments:
Network Operations - These folk keep networks running. They eat support tickets and are seldom let out of their cages.
Network Architects - These folk run around data centers with whiteboards and sharpies and draw clouds. Consultants fall under this designation too. Occasionally these guys get their hands dirty and pick up a console cable but most times they are cooking up the most complicated solution to a simple Continue reading
As things are sometime hard to find on HP.com, I thought I’d consolidate them here.
HP VAN SDN Controller Download
After trying in vain to make my BT Home Hub 3 work as a Proper Router™ for my home lab I decided to take the plunge and get something better. Seeing as I work at HP, I thought I’d try the HP MSR 930
First step is to get your Fundamentals configured. The config below is a snippet from my configuration. This will enable SSH, SFTP, and HTTPS access from local IP addresses only.
sysname <Your Hostname>
#
# Change some web timeouts
#
web https-authorization mode auto
web idle-timeout 3
#
# ACL for Local Access
#
acl number 2000
description *** Local Only ***
rule 0 permit source 192.168.1.0 0.0.0.255
rule 5 permit source 10.0.0.0 0.255.255.255
#
# Secure Web Interface
#
undo ip http enable
ip https enable
ip https port 443
ip https acl 2000
#
# SSH Setup
#
ssh server enable
ssh server authentication-timeout 10
sftp server enable
#
# Restrict VTY to SSH from Local IP's
#
user-interface vty 0 4
acl 2000 in
authentication-mode scheme
protocol inbound ssh
Once we have our fundamentals done, we can get our firewall ready. Continue reading
Lifehacker suggested“Learning to Code by Breaking Someone Else’s Code” and I wanted to share my personal experiences with this method….
When I was young, 7ish, my parents bought a Packard Bell 486 machine (a DX with goofy speakers that hook on the side of the monitor IIRC). It was supposed to be for school, but as far as I was concerned it was for playing games! While the PC ran Windows 3.11, all of my games ran on DOS. DOS, as many of you probably know, has no UI, so in order to install or run a game you were at the mercy of the manual. Typically, the manual would instruct you to “cd” to a removable disk drive and run an “.exe”. This taught me some basic DOS and that an “exe” was an application that I could run.
Upon running the “exe” in DOS you would be lucky if the game would run correctly first time. Sometimes you would have graphics issues, other times no sound and sometimes your joystick wouldn’t work. To get a game to work you had to select the correct drivers for graphics Continue reading
I saw Scott Lowe’s post on how he is making JSON more readable in BBEdit and I thought I’d share how I’m doing this in Sublime Text.
If you aren’t using Package Control, you should be, so install it using the instructions here.
Open the prompt with ^⌘P
then type Install
and press Enter Then type
Pretty JSON
and press enter on more time.
Then to make your JSON pretty, you can simply ^⌘J
or ^⌘P
and type
pretty
Continuning on this week's theme of Markdown, I'll be explaining how to add Markdown to your blog in 3 easy steps.
From your Wordpress dashboard, head over to the Plugins
tab and click
Add New
. Search for "WP-Markdown" and install
Once your plugin has been installed, head on down to Settings >
Writing
and scroll to the Markdown
section pictured below.
Enable Markdown wherever you like, but I'd recommend pages and posts
WARNING: Enabling Markdown will affect your existing posts/pages. I noticed that while my posts didn't look any different on the outside, behind the scenes they were a mess and required a little trying up.
Create a new post or page and practice your Markdown-Fu. Not sure where to start? Here's an example
# This is a first level heading
Here is some body text
## Second level of heading here
### And a Third
#### And so on and so forth
- Now some bullets
- Hopefully you are getting the hang of this now
- It's pretty easy
> Blockquotes are easy with Markdown Continue reading
For the last 6 months I've been using Markdown where I can. Since embarking on the path towards a more Agile approach to writing, it has been necessary to use Markdown more and more. This has led me towards using Pandoc Markdown rather than MultMarkdown as my dialect of choice and I hope to explain why.
If you haven't used Markdown already, you might be wondering what the fuss is about. Basically it is a way of writing markup in an easy-to-read, easy-to-write fashion. It decouples the act of writing from formatting/layout so the same source text can be used to produce multiple formats.
So what are the barriers to Markdown adoption? Personally I have found only two.
While I use Markdown, the rest of the company uses Microsoft Word - All of our corporate templates are in MS Word format - Neither Markdown or MultiMarkdown reliably export to MS Word format (yes MMD does ODF, but it doesn't handle images well)
The next issue is that Markdown to PDF conversion uses LaTeX. Unfortunately I neither have the time nor inclination to learn LaTeX. While it can be a powerful Continue reading
I recently changed from MultiMarkdown to Pandoc. But I still wanted to use Marked app to preview my work…
Thankfully the author of Marked allowed for such an eventuality with the "Custom Processor" option.
To use this tick the box, put in your fully qualified path to pandoc and add your arguments and bob is your proverbial uncle. The quickest way to find out where pandoc is installed on your Mac is to type the following from the terminal.
which pandoc
@dave_tucker
I finished reading The Phoenix Project at the beginning of May and it has had a profound affect on my outlook towards work. Not only was this a great read, but while I was reading I kept getting ideas on how I could implement the three ways at work. This diary documents the transition to an Agile Writing workflow.
Before I start covering the how, I thought I would spend a little time on the why. Agile is something that is usually associated with Software Development and you might be thinking "What has this got to do with writing?". I write technical documentation for a living, but I've been a long time have-a-go programmer and I recently had the pleasure of working on a professional software project. One of the things that amazed me was how Agile mad them so much more efficient.
It is actually quite easy to draw parallels between application development and writing technical documentation. A Continue reading
As part of a small robotics project I've been working on this weekend (affectionately called CoBe1, there will be a follow up blog on that soon) I decided to give by robot some personality in the form a a voice, and uploaded some of my code to GitHub.
While Arduino is capable of playing music and sounds from an SD Card I wanted something a little more authentic… something similar to R2-D2's chirps from Star Wars. I had a mini 8Ohm speaker lying around and following the tutorials here it was easy to get it hooked up to my Arduino Uno and start making sounds. By adjusting the default melody and timings I got part way to achieving my R2-D2 style attitude, but notes on their own just didn't cut it. What I needed was some articulations. I got coding and whipped up a library that makes it easy to use glissando and tremolo. Want to give it a try? Grab the code on GitHub Here's a simple example sketch:
#include <pitches.h>;
void setup()
{
MelodyUtils mel(8);
mel.Glis(NOTE_C3, NOTE_C4, 5);
delay(1000);
mel.Trem(NOTE_C3, Continue reading
Once I had got my iTunes library downgraded to 10.7 and liberated some of my DRM'd media I thought it would be awesome to use my Raspberry Pi as an Airplay Receiver...
Head over to http://www.raspbmc.com/download/ and follow the instructions to download and install Raspbmc. Once you've prepped your SD card, popped it in your Pi hole and got it booted it should start the installation… at this point you can grab a coffee
In older versions of Raspbmc you had to SSH in and enable the web server
in /home/pi/.xbmc/userdata/guisettings.xml
In the latest version this was already enabled, so I just picked up my phone, downloaded the official XBMC remote app from the Android marketplace (or iTunes store if you are that way inclined).
A couple of points of note when adding your host in the XBMC remote app.
If you don't know your IP address and your Pi is not automatically found
you can find this from your local router. The HTTP port is 80 by default
in Raspbmc (not 8080) and the password is blank, although I configured
username xbmc
and password xbmc
and this works just fine!
Once set up it Continue reading