LXC 2.x/ LXD Cheat Sheet

Here are some of the most used commands for creating and managing an LXC/ LXD host and containers. It’s assumed that you have a working environment and a privileged SSH connection to the LXC server for issuing the commands. Basics Start and Stop a LXC Container Starting out with the basics here – starting and

Setting CPU Resource Limits With LXC

Linux Container (LXC) management is now often dealt with by LXD, the Canonical lead project built on top of LXC. LXD offers a suite of options for controlling Linux Container resources and setting limits where appropriate. This post will talk about setting constraints on CPU, however other options are available for limiting almost any sort

Add systemd Startup Script For CouchDB

Currently, version 2.0 of CouchDB doesn’t come with any form of startup script. I’m sure that as the CouchDB 2 branch becomes more mature and it’s added to the various software repositories startup scripts will be shipped as standard, but until then we have to make do. The below script is a systemd startup script

Basic IPTable Rules

Here are some basic IPTable rules to enable essential connectivity from the host. Outbound connectivity such as ping, DNS and HTTP are all enabled, along with inbound SSH. All external sources are enabled for SSH so it’s advisable to restrict this further once you’re up and running. This IPTables script is intended to be a starting point

Skip Certificate Checks with Wget

This is a reminder for myself more than anything else. I don’t know why the wget developers couldn’t have chosen a switch that’s easier to remember. Anyway, if you haven’t installed or updated your certificate Authority certificates on your box and try and download something from an SSL URL with wget you’re going to run into trouble. This

Apt-get error: E: The method driver /usr/lib/apt/methods/https could not be found

I’ve been getting the following error when using apt-get update with Debian Wheezy recently. [crayon-578cc50f4f2f7166336499/] It seems that apt-get only supports HTTP connections by default, and throws an error with any HTTPS URLs.  You’ll likely see this error message if you add a new apt source URL that starts with https. What’s most annoying is that apt doesn’t simply ignore

Oracle Database INTERVAL Partitioning and Virtual Columns

I bumped into this issue recently which prevents you INSERTING a date of 31-12-9999 into an INTERVAL partitioned table due to the fact that the LESS THAN partition value would be larger than an Oracle Date. After speaking with Jeff Moss he mentioned that we might be able to get round the problem by using a virtual

Oracle Database Interval Partition Set Up Script

This script is used to set up the test table for the following blog posts: Oracle Database INTERVAL Partitioning Date Error With 31-12-9999 Oracle Database INTERVAL Partitioning and Virtual Columns [crayon-578913d2a047f830082062/]  

Oracle Database INTERVAL Partitioning Date Error With 31-12-9999

You may have seen the below error when using dates at the extremes with an Oracle Database. This post focuses on the scenario where you’re inserting a high date, such as 31-12-9999 into an INTERVAL partitioned table. High dates such as this are often used in warehouse environments where from and to dates are specified

On "random" CI failures

I closed a bug yesterday that's been kicking around for almost a year as a sometimes fails on CI but no-one can figure out why frustration.

Sooner or later you'll hear someone suspect it must be a problem with CI. Which is ironically funny in a shoot-the-messenger kind of way!

Thankfully our "CI issue" turned into a for-real bug. In short, the code involved many classes with near 100% test coverage. It had been read (more...)

LittleArduinoProjects#204 Type K Temperature Logger

I'm working on an idea where I need to measure temperatures to around 500°C - above those typically supported with semiconductor sensors or thermistors.

This project demonstrates the basic approach using an Arduino as the "temperature logger". I'm using a K Type thermocouple that's rated up to 700°C. Since thermocouples only measure a differential temperature, I'm also using an LM35 to provide the cold-junction baseline. The temperature measurement is displayed on a 5110 LCD.

As (more...)

阿部真央 Don’t let me down

One of the best finds in the racks at Tower Records Fukuoka福岡市. It's been years since I last got to browse a record store in Japan; I'm glad they still exist, with stacks of CD players queued up to sample. And a huge relief to see the indie rock scene is just as vibrant as I remember!

LittleArduinoProjects#203 Homopolar Motor

What happens when electric fields cut across magnetic fields? A force is generated, and the homopolor motor is the classic demonstration.

As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub.


LittleArduinoProjects#202 LM3915 Audio Level Kit

The LM3915 is a useful IC for simple audio level displays. This is a cheap kit build which largely follows the reference circuits in the datasheet.

As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub.

Generating Diceware Passwords in Python

Today I’m going back to a theme from a post last year and looking at generating passwords with my favourite programming language. A tweet from Simon Brunning pointed me to Micah Lee’s article at The Intercept and my first thought was to write a function to do this in Python. So here it is;

def generate_diceware_password(word_count=6):
    import random
    word_dict = {}
    passphrase = []
    with open('diceware.wordlist.andy.txt') as f:
        for line in f. (more...)

Teaching an old dog to Fish

Inspired by the recent furore around Shellshock I decided that it was time to try an alternative to bash. By the very grown up process of shutting my eyes and poking my finger at the results of a search for “shell” I ended up at fish shell, described by the project as “a command line shell for the 90s”. I’m presuming that this means the 1990s and is not a minimum age requirement.

I’m (more...)

Generating Reasonable Passwords with Python

Thanks to a certain recent Open SSL bug there’s been a lot of attention paid to passwords in the media. I’ve been using KeePassX to manage my passwords for the last few years so it’s easy for me to find accounts that I should update. It’s also a good opportunity to use stronger passwords than ‘banana’.

My problem is that I have always resisted the generation function in KeePassX because the resulting strings are very (more...)

My Career

The next time anyone asks me what I do for a living I’m just going to point them to this YouTube video.

Found on the twitters thanks to Nick Hodge and Jess Dodson.

Howto debug Mendix java actions

To debug Java Actions used in a Mendix Microflow you need to make some configuration changes to the way you start the Mendix runtime.

Add the following in your project settings, in server configuration add the following to Extra JVM parameters:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Mendix Project Settings

Start your application in Mendix.

In your Java IDE you need to configure remote debugging. The following screenshot shows my configuration in IntelliJ

Mendix Intellij remote debugging

Start the debugger, put some breakpoints in your (more...)

Profiling Mendix using JProfiler

JProfiler is a Java profiler which can give you insight into what a running application is doing: which methods are consuming the most cpu, how many objects are created, etc. Jprofiler also shows you information about jdbc calls and sql statements executed by your java application.

Setting up Jprofiler to profile a Mendix runtime is easy, you can start profiling a running Mendix runtime, without reconfiguration or restarting the application.

The installation guide provides a (more...)