FreeNAS Corral and Docker

This post was written before FreeNAS Corral got memory-holed. I’ve not decided on my course of action yet. I like running my services in Docker far more than I ever liked JAILS and the LinuxVM, so going backwards is not really an option.

 

I recently upgraded my FreeNAS 9.3 box to FreeNAS 10, FreeNAS Corral. The upgrade was very smooth, although I did panic at one point when it took 500 years to boot back up.

I knew that the old Plugin system had been removed, and that Docker Support was the new way to get your plugins working. I had several plugins I needed:

-Owncloud

-Transmission

-LinuxVM

The Linux VM plugin, or Jail, was what was letting me run an Ubuntu Server to host Squeeze Server. The Linux VM VirtualBox was not available any more, so the Squeeze Server would have to find a new home. Fortunately, there is a Docker Image for Squeeze Server.

Owncloud

Getting an Owncloud container running was pretty trivial. I did the following:

Create a new Dataset, for Owncloud Data to live in

Screenshot_2017-04-03_13-48-56I gave ownership of it to “www” user and group.

Create the Owncloud Docker Container

Screenshot_2017-04-03_13-51-38I needed to do the following:

  • Give it a name
  • Map the Dataset to the container path
  • Set the Container to Bridged Mode. This is definitely possible with NAT, but I prefer having unique IP addresses for each container.
  • Save the container, and start it up.

Once Owncloud has started up, I let it do a first time setup, letting it host the database itself, etc.

Migrating the Data from the Owncloud Jail

I needed to use the command line for this.

First, stop the container.

Copy the owncloud Jail data to the new Dataset.

My owncloud data was in /mnt/<Pool>/jails/owncloud/media

This location contained the User’s directories and the database, but not the config file.

Copy everything in here to your new Dataset, into the “data” folder:

/mnt/<Pool>/<Dataset>/data

That’s the data, but you need to edit the Config file as well. The config file for the new owncloud install is here:

/mnt/pool1/ownclod_temp/config/config.php

You’ll need to replace this with the older config file from the plugin, which is here on my setup:

/mnt/<Pool>/jails/owncloud/usr/pbi/owncloud-amd64/www/owncloud/config/config.php

You might need to update the trusted domains to include your new Owncloud Docker IP (or the FreeNAS IP and Docker Port, if you’re using NAT).

After you’ve done this, you should be able to start the Owncloud Container and log in using your original credentials.

SSL, Let’s Encrypt, Reverse Proxies

This was hard work. The actual solution is not complicated, but there’s no single guide to tell you how to do it.

Nextcloud recommends that you use a Reverse Proxy to get SSL working for your NextCloud container. Owncloud is pracitcally the same thing, so it seems like the thing to do in both cases.

I use Letsencrypt for my certs, and previously I ran certbot from inside the Owncloud Jail. I initially assumed I would do the same thing here, but luckily for me the FreeNAS docker collection includes a Letsencrypt Image that includes NGINIX, which would let me set up a reverse proxy as well.

Things to keep in mind before you start:

-Port forwarding on your Router should already be set up for the domain name you want to create the Certificate for.

-you need a writeable area for the certificates. I have a dataset setup with “www” permissions specifically for this.

 

 

Nixie things

With my missus’s birthday rapidly approaching, I have decided to manufacture her something neat.

To that end…
A NIXIE CLOCK.

“Nixie” tubes are a brand-name for a cold cathode glow discharge device used for a relatively short period around the 80’s to display numbers, letters and symbols (before LED technology reached maturity). They are only in production by a few die-hard enthusiasts, but ex-Soviet stock is reasonably readily available on the Internet.

They look something like this:

Nixie

The purpose of this post however, is as follows.
As a byproduct of the majority of available Nixies being Soviet-made, their datasheets are Cyrillic.

And I have translated the one for an INS-1 ‘indicator’ point (not a true Nixie lamp, but a start).

So here it is, take from two documents- one that ships with each batch (firing voltages and current), the physical properties taken from another:

INS-1

Gas discharge lamp unit is designed to display information in the form of a point in the information display.
The body is cylindrical glass. Weight no more than 1.5g

Cathode marked with a dot (NOTE- this contradicts most of what I have read on various forums! However,  the datasheet clearly has “анод”  (anode) and “катод” (cathode) marked, with the dot on the cathode)

 

Instructions for Use

Firing voltage, V, Min (Max) .  .  .  .  .   .  .  .  .  .  .  .  .  .  65 (90)

Sustaining Voltage, V, Max .  .  .   .  .  .  .  .  .  .  .  .  .  .  .  .  .  55

Current, mA .  .  .  .  .  .  .  .  .  .   .  .  .  .  .  .  .  .  .   .  .  .  .  .  0.5

Vibration loads:

Frequencies, Hz  .  .  .  .  .   .  .  .  .  .  .  .  .  .  .  .  .   .  .  . 1-1000
Acceleration, m/s² (g), no more  .  .  .  .  .  .  .  .  .  .  .  .  98 (10)

Multiple impacts:

Acceleration, m/s² (g), no more  .  .  .  .  . .  .  .  .  .  .  .  147 (15)
Impact duration, m/s  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 2-15

Single shock:

Acceleration, m/s² (g), no more   .  .  .  .  .  .  .  .  .  . 1472 (150)
Impact duration, m/s  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 13

Temperature (environment), ° C.  .  .  .  .  .  .  .  .  .  . -60 /+ 85
Relative humidity,%, not more   .  .  .  .  .  .  .  .   .  .  .  .  .  .  98
The increased air pressure, Pa (kg/cm²) .  .  .  .  .  .294 198 (3)

 

Half-Life 2: Point Insertion Part II

#ABANDON POINTLESS PROJECT. I lost the screenshots I was taking for this, and then found this post in my drafts folder. I cannot be arsed to continue this.

Christ on a bike, it was 2 years since I last thought about doing anything with this.

his flesh is jelly!

He partially melted

We last left our hero GORDON FREEMAN standing in front of a turnstile. Gordon felt threatened by the irregular gate, and remained motionless for some time.

As Gordon watched, a man walked through the gate. And when I say through the gate, I don’t mean that the turnstile turned around him, as is proper.

I mean we walked THROUGH the gate. He warped through it. He phased through it. He ignored everyday physical laws.

Gordon, being a theoretical physicist, calms down and stops trying to worry so much. He realises that the man in question is in possession of alien technology. Or he is possessed.

On the other side of the gate is the main station arrivals / departures area. It’s got a few people in it to interact with, all of which inform the setting, all of whom I’ll talk about in a moment.

Looking at this room 9 years later is strange. These days, you’d generally expect it to hold a dozen people or more, to make it seem busier, and make the world seem more real. However this can be a detriment in some ways – if you populate a room with that many people, you’d want each one to have at least SOMETHING to say, and it becomes harder and harder to avoid problems such as – NPCs standing around doing nothing. Not interacting, not talking, not going anywhere. Even here, with these few NPCs, that problem is not totally avoided.

Each of the NPCs has a specific task, an action they must perform. They are mere puppets, condemned to play out the same stage directions over and over again, with no variations.

Paranoid Guy

Paranoid Guy looks a little older than most of the people we talk to here. His line delivery is twitch, and furtive; he doesn’t want to be seen talking to you, but still feels obliged to warn you.

According to him, They have been putting something in the water, to sap the precious bodily fluids to make everyone forget. If this is true, and not just the paranoid delusions of an old man, we never get a hint of it. For all Gordon knows, he could have been talking about stuff in the water even before the Combine invasion, and he probably believed in chemtrails and the Illuminate.

However, it wouldn’t really be out of character for the combine to be drugging the population into submissiveness and compliance. If people can’t recall a time before the combine so easily, then they’d be less likely to rebel?

Of course – history (and 1984) shows us that there are much subtler ways to achieve this. Mass propaganda and fear can accomplish much the same thing.

Muttering Guy

Muttering guy paces back and forth in front of the departures/arrivals board

Petulant Guy

Guys Soon To be Dragged Away By Secret Police and Shot

 

Terry Pratchett was born in 1948 and is still not dead.

….Is the very first thing printed in my copy of Reaper Man.  I suppose it’s fitting, that Reaper Man was the first one that came to hand. It’s Reaper man that contains one of the more profound insights into the duration of a single human life:

no-one is finally dead until the ripples they cause in the world die away

So in a sense, the title of this post is still true, and will always be true – it will be a very long time before the ripples of Sir Terry’s work finally die away.

I saw Sir Terry speak twice at the Hay Literature festival, once when I was about 7 years old, and again when I was 15. I’ve also met him in a different setting entirely.  When I was 7 the only books of his I had read were Truckers, Diggers and Wings – books I hope to introduce my own children to, one day. My dad had taken me, and he’d taken his copy of Maskerade to get it signed. He wasn’t able to, but I started to read it on the way home.

When I was 15, I’d gone with a friend to see him talk, and that was just around the release of Thud!. Afterwards, during the signings, he spoke to me at some length about Half-Life 2, because I was wearing a Half-Life 2 tshirt. It was incredible to have someone I looked up to so much just talk to me for a few minutes about a common interest.

The final time I met him, was a far more personal setting. He came into the bookshop I was working in. My boss was out to lunch, so I was manning the counter. I was sure it was him, but didn’t want to completely geek out at him while he was just doing some shopping. He bought several rare second hand books (And I can’t remember for the life of me what they were), and when the transaction was completed, I told him I was a big fan of his books. I’ve always wondered what it was like for celebrities to be pestered in public, but he didn’t mind at all, and we spoke for a few minutes about the Hay festival and Hay itself. I said that his descriptions of L-space had always reminded me of the second hand bookshops in Hay-on-Wye.

My boss came back, and brazenly capitalized on the situation by asking Sir Terry to sign some of our stock! He was quite happy to, but my boss barely waited for him to be out of the door before marking the prices up and sticking them in the window. (My boss apparently went to the same school as Bernard Black).

I’m going to go away and celebrate the life of Terry Pratchett, one of the greatest authors of all time, by reading Reaper Man. I’ll have a glass of whiskey, and I’ll light a candle.

“What I could do with right now is one of Mr Dibbler’s famous meat pies – ‘

And then he died.

The Archchancellor glanced at his fellow wizards, and then tiptoed across to the wheelchair and lifted a blue-veined wrist to check the pulse. He shook his head.

“That’s the way I want to go,” said the Dean.

“What, muttering about meat pies?” said the Bursar.

“No. Late.”

Goodbye, Sir Terry Pratchett. We’ll miss you.

And again with the coding…

Here’s a little Arduino code I’ve cooked up for the purposes of providing a nice crank signal to the FPGA-based ECU, for the purposes of bench testing the output. It’s a simulation of a nicely cleaned up, digital signal generated by a 36-1 toothed crank wheel on your typical Ford engine.

Essentially, a little throttle position sensor (read, potentiometer) is hooked up to adc pin 5. This is purely to give me something to twiddle to see if the FPGA is reacting quickly enough to the change in frequency (Not that I have any fear of this, really- damn thing is pretty fast- but alas, I must have something to fiddle with while testing, or it’s no fun!).

The LED flashing part is purely for visual effect; an ‘is it working’ before I had chance to hook it up to an oscilloscope for testing.

The code is simple enough, my written code is starting to look more user-friendly, and- importantly- it works. Onward with the FPGA testing, then?

Maybe after my exams; this was put together in my ‘evening off’. (Oh, ninjaedit- it only ‘works’ when debug = 1)

//-------------------------------------------------------------------------------
 
#include &lt;Wire.h&gt;
 
//-----------------------------------
// Calibration Values for TPS
float minimumReading = 48;
float maximumReading = 919;
//-----------------------------------
 
//Setttings for TPS
int analogPin = 5; // Throttle Position Sensor Wiper Pin
int throttleRead= 0; // variable to store the value read
int throttleCorrected= 0; // variable to store the corrected value
 
//LED flashy bit setup
const int ledPin = 13; // The number of the onboard LED pin
int ledState = LOW; // Used to store the LED state
 
//Variables for Pulse Generator
long pulseLength = 0; // Variable to store the generated pulse length
long gapLength = 0;
int toggle = 1; // Variable to act as a toggle
long lastMicros = 0; // Variable to act as timer function
int count = 1; // Variable to store the current tooth count
int calibrate = 92.59259259259; // Calibration for top speed = appx. 9k rpm
 
int rpm1 = 1; // Variable to store the RPM number
int debug = 1; // Debug setting- changes output from RPM &amp; pulse length to counter &amp; gap indicator
 
void setup()
{
Serial.begin(9600); // Setup serial
pinMode(ledPin, OUTPUT);
}
 
void loop()
{
tpsRead(); // Run TPS Read loop
pulseGenerate();
}
 
void tpsRead()
{
throttleRead = analogRead(analogPin); // Read the input pin
throttleCorrected = ((throttleRead-minimumReading)/maximumReading)*100; // Subtract minimum from TPS. Calculate percentage of max
 
if (throttleCorrected&lt;1)
{
throttleCorrected=1;
}
if (debug == 0)
{
rpm1 = 60000000/(pulseLength*36);
Serial.print("Simulated RPM :");
Serial.print(rpm1);
Serial.print("RPM; Pulse Width :");
Serial.print(pulseLength);
Serial.println("uS");
}
}
void pulseGenerate()
{
pulseLength = (throttleCorrected*calibrate); // Calculate length of 'high' pulse (in microseconds)
gapLength = pulseLength*3;
 
if ( (micros() &gt; (lastMicros + pulseLength)) &amp;&amp; (toggle==HIGH) &amp;&amp; (count &lt;= 35) )
{
lastMicros = micros();
toggle = LOW;
}
if ( (micros() &gt; (lastMicros + pulseLength)) &amp;&amp; (toggle==LOW) &amp;&amp; (count &lt; 35) )
{
lastMicros = micros();
toggle = HIGH;
count += 1;
if (debug == 1)
{
Serial.print (count);
Serial.print (",");
}
}
if ( (micros() &gt; (lastMicros + gapLength)) &amp;&amp; (toggle==LOW) &amp;&amp; (count == 35) )
{
lastMicros = micros();
toggle = HIGH;
count = 1;
if (debug == 1)
{
Serial.println ("GAP");
Serial.print(count);
Serial.print (",");
}
}
digitalWrite(ledPin,toggle);
}

Rockpapershotgun, and Horace, the endless tech.

http://www.rockpapershotgun.com

RPS is down. Or maybe replaced. Instead, there is a text adventure game there:

503 – Service Unavailable
An Interactive Fiction by Horace The Endless Server Technician
Release 1 / Serial number 110707 / Inform 7 build 6E72 (I6/v6.31 lib 6/12N)

HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>refresh
That’s not a verb I recognise.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>go north
You can’t go that way.

>go south
You can’t go that way.

>go s
You can’t go that way.

>go up
You can’t go that way.

>sleep
You aren’t feeling especially drowsy.

>eat
What do you want to eat?

>eat shoes
You can’t see any such thing.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>eat cast,e
You can’t see any such thing.

>eat jim
(first taking Jim)
I don’t suppose Jim would care for that.

>eat John
(first taking John)
I don’t suppose John would care for that.

>eat Tim
(first taking Tim)
I don’t suppose Tim would care for that.

>eat Alec
(first taking Alec)
I don’t suppose Alec would care for that.

>look at Alec
On closer inspection, Alec appears to be gluing bits of Warhammer 40k model armour to his shoulders and chest.

He picks up a plastic lascannon and tries it out on his left nipple.

>look Jim
His top hat and procedurally-generated facial hair gives him away in a second – this is Jim Rossignol, wordsmith and crazed steampunk inventor.

Jim is hunched over an opening in the Castle Shotgun walls, from which various wires are trailing. There is the occasional spark and fizz as he rummages around.

>look John
John sits hunched over on a stone at the foot of Castle Shotgun’s walls, head in hands groaning to himself. There are several empty rum bottles nearby, one of which appears to have an Asda logo on it.

>drink rum
You can’t see any such thing.

>look Tim
Tim is standing on a small outcrop, binoculars in one hand, looking out eastwards. Unfortunately, east of here is just the M4 corridor, but east is the direction heroes look in, as evidenced by his stony glare.
He takes a deep breath. “I love the smell of Bath in the morning.”

>talk Tim
I didn’t understand that sentence.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>pickup Tim
That’s not a verb I recognise.

>pick up tim
I don’t suppose Tim would care for that.

>talk alec
I didn’t understand that sentence.

>look alec
On closer inspection, Alec appears to be gluing bits of Warhammer 40k model armour to his shoulders and chest.

Alec clears his throat and tests out his Librarian imitation. It’s not bad.

>help
That’s not a verb I recognise.

>die
That’s not a verb I recognise.

>kill
What do you want to kill?

>kill Alec
Violence isn’t the answer to this one.

>kill Jim
Violence isn’t the answer to this one.

>Kill seld
You can’t see any such thing.

>Kill self
Violence isn’t the answer to this one.

>kill me
Violence isn’t the answer to this one.

>talk me
I didn’t understand that sentence.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>talk to jim
Jim doesn’t take his head out of the hole in the wall. You hear him muttering to himself.

“Yes, it must be the… no, unless it’s the… Hmm.”

>talk to john
John looks up. “Hmm? No, I didn’t lock us out. We’re just having a bit of trouble with Horace. We’ll have it working again in a tick.”

He resumes nursing his headache.

>talk horace
I didn’t understand that sentence.

>talk jogn
I didn’t understand that sentence.

>talk to john
John looks up. “Hmm? No, I didn’t lock us out. We’re just having a bit of trouble with Horace. We’ll have it working again in a tick.”

He resumes nursing his headache.

>talk to tim
You don’t feel like talking tactics right now, and Tim is looking rather intense at the moment.

>look tim
Tim is standing on a small outcrop, binoculars in one hand, looking out eastwards. Unfortunately, east of here is just the M4 corridor, but east is the direction heroes look in, as evidenced by his stony glare.
He pulls out a script from “Patton” and flicks through it, mouthing a few lines to himself.

>talk to alec
Alec seems a bit involved with sticking plastic armour to himself to reply. It’s probably best to leave him alone when he’s arming up, anyway.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>pick up magazines
They’re not yours to take, really. I’m sure no-one would mind you looking at them though.

>look at magazines
You grab a magazine at random. It’s the latest issue of Your Cat magazine! You’ve read this issue at least four times though, so you put it back.
You notice an old copy of Amiga Power in the pile.

>look at amiga power
An old copy of some obscure, arcane tome. The glyphs on the front are mysterious, and appealing.

>look at glyphs
You can’t see any such thing.

>read glyphs
You can’t see any such thing.

>read amiga power
An old copy of some obscure, arcane tome. The glyphs on the front are mysterious, and appealing.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>look at wall
You peek at the hole in the wall. There is a mess of wiring and tubes, and what appears to be the midriff of a particularly long animal. You peer down the inside of the wall in both directions, but see no evidence of legs or a head. Weird.

>look at wires
You can’t see any such thing.

>look at mess
You can’t see any such thing.

>look at tubes
You can’t see any such thing.

>look at animal
You can’t see any such thing.

>look at midriff
You can’t see any such thing.

>look at wall
You peek at the hole in the wall. There is a mess of wiring and tubes, and what appears to be the midriff of a particularly long animal. You peer down the inside of the wall in both directions, but see no evidence of legs or a head. Weird.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Jim, John, Tim, Alec and a Refresh Button here.

>open gates
You can’t see any such thing.

>look at castle
You can’t see any such thing.

>look castle
You can’t see any such thing.

>look magazines
You pick up one of the magazines. It’s the latest issue of Guns And Conversation, John and Jim’s fanzine that they distribute around Bath. The cover story promises “Semi-autos and small talk” and an interview with a man who has invented a talking gun.
You notice an old copy of Amiga Power in the pile.

>pick up amiga power
You reach for the magazine, but as you touch it it disintegrates in front of your eyes. In its place are the feet of a man. That man is Kieron Gillen. He smiles down at you.

>talk kieron
I didn’t understand that sentence.

>look kieron
Kieron’s figure is hard to make out, as his very flesh appears to emanate a glowing white light. He floats approximately two inches off the ground, and is wearing glasses which, when peered into, appear to reflect visions of the future and past.
He still looks a bit like Jason Statham though.

>talk kieron
I didn’t understand that sentence.

>talk to kieron
You open your mouth but the words fail to come. Without speaking, Kieron’s voice echoes inside of your head. He mentions something about Thief. Everything is right with the world.

>look
HTTP Error
You are standing at the entrance to Castle Shotgun. The gates are securely locked, with an unappealing sign on the front. The sign reads “Whoops! RPS is having a bit of a wobbly. Don’t worry, we’ll be back soon!”

To the left of the gates is a large opening in the wall, which Jim is leaning into. John is perched on a small rock nearby, while Alec and Tim are standing on the other side of the gates. A pile of magazines is scattered in a corner.

You can see Kieron, Jim, John, Tim, Alec and a Refresh Button here.

This is the most fun I’ve ever had on a 404 page.