Containers May Save Me From Myself

Over on the Aus Mastodon instance (where I choose to Toot, rather than Tweet) I posted that I’m frustrated over and over again that my Linux experience goes like this:

  1. Install a new Linux distro. Be amazed and surprised just how smooth the experience is, and how little effort there was to get it working.

  2. Get excited for more “Linux” and think “Great, time to try compiling something from scratch for the experience” or “Now I can install that technology stack I was reading about”

  3. Install said stack, or attempt to compile said something.

  4. Fail - due to having picked the wrong distro with the wrong version of Python, or having picked a desktop that runs on Wayland instead of X.

  5. Find workarounds, tutorials on how to compile around the issue, or just instructions on how to install another version of Python. Be successful or not.

  6. Get a notification that the Next Version of my distro is available - and look at all the neat new features and stability it has!

  7. Install the new version and discover some new hellish torment that means that the rock solid stability I’ve b1een enjoying up until this version is gone and no amount of scouring the internet, or trawling the logs will help me figure out how to restore my OS and with it, my sanity.

I’m not sure if step seven happens because of my tinkering in step five. The frequency with which it happens is makes me think it has to be me.

So I find another distro, or I download the installer for the new version, and I backup all my files and I rebuild my machine and repeat from step one. It’s getting tiresome.

So having pinned the problem on myself, I’ve decided this time around I’m going to containerise everything. For those only slightly behind me on the discovery of new technology concepts, containers (or sandboxes (or jails Rubenerd has been using for years)) are a way to put applications in their own little bubbles without access to anything else on your computer2. They help keep everything from rubbing up against each other and getting computer juices everywhere - sort of like social distancing for computer software. Fedora Silverblue is container-based and looks amazing. I have loved using Fedora and learning how to sandbox everything is probably a good skill to learn moving forward. Also, @shlee generously gave me his time to teach me Docker and now I want to keep using it for everything.

BUT… Fedora (and Silverblue) have some downsides for me. Remeber step five? Almost every Linux tutorial or piece of software I’ve ever found anywhere assumes two things: you’re using apt as your package manager, and you’re using Xorg not Wayland as your display server. I was constantly hunting for the ‘dnf’ package, or checking to ensure that the new clipboard manager I was about to use could handle Wayland3. Critically, Docker is a second class citizen in Fedora in favour of Podman, and while Podman might be better in some ways - like Wayland: it’s not what everyone is using. In the end the perpetual dream I have [to use the “superior” technology over the “winning” technology]({{< ref “moving-to-hugo” >}}) had to be put aside, and I’ve settled on Cinnamon flavoured Debian.

Debian is not containered. But it doesn’t insist on making me use Podman instead of Docker like Fedora does, and it’s the closest thing Linux has to a “default” distribution, so I’m making do. The first thing I did was install Flatpak to start my container journey and… immediately failed.

  • Flatpak Firefox looks like shit. I spend almost all my computer time in Firefox and I want it to match my theme and the container version didn’t. That’s a really shallow reason not to use it though, so I’m going to try that again4.

  • Docker is complex enough for a Docker n00b to learn. Trying to run a Sandboxed containerised Docker instance of some sort is right out, so it got a full install.

  • The Flatpak version of VS Code is so isolated it can’t see Docker. I want to use the Docker plugin. I switched to the fully integrated version immediately.

So my ideals took a small beating when the rubber hit the road, but I swear to Woz that I will only use Docker and Flatpak for everything else. And one day when I’m more comfortable translating distro specific nonsense into my preferred flavour, I will give Silverblue or a fully containered distro a much better go.

And maybe one day my desktop will go more than a single major version without being replaced.


  1. While writing this post, this is the literal point that Gnome took one final shit on the bed and decided to freeze within seconds of loading after every hard reboot. 

  2. To avoid the wrath of the pedants, there’s a difference between containers and sandboxes and containers aren’t built for security like sandboxes are, but for my purposes they serve roughly the same function. 

  3. Spolier: it could not. 

  4. Thanks to the Flatpak Theming instructions at OMG! Ubuntu! I was able to install the Adapta-Nokto theme for Flatpak apps and everything is right with the world. 

A Standing Challenge

About 6 months ago I read a Lifehacker article that advocated standing at your office desk to stay healthier. I thought it was a neat idea at the time but didn’t try very hard to make it happen. Then Lifehacker again linked to an article in the NY Times about standing at work, and this time I decided to do something about it.

My New Desk

My New Desk

Introducing my standing desk

It’s two different size filing cabinets which turn out to be exactly the right heights for my keyboard and monitors. It’s surprisingly comfortable from about my shins up, but my feet are already killing.1

I find it difficult to fit much exercise into my day. Hopefully this might get me using even a little energy.

PS. Read that article. It’s an eye opener, and a very quick read.

PPS. Hey Lifehackers! Welcome to the Geekorium! Browse around and have a look if you like. I also run a small site about Google Wave called First Waves. If you’re into your geekery, there’s nothing more geeky than Google Wave…


  1. perhaps I need more WiiFit to improve my centre of gravity 

"Web Guys"vs "Real Programmers"

Michael J. Braude wrote a post on why he’ll never be a “web guy”. The gist being, the annoyances of writing for the web are not the sort of challenges he wants to tackle as a programmer.

Then Jeff Atwood gave his two cents on why programming for the web is where it’s at — it’s fast, it gets seen by more people, and more and more great apps are being made on the web.

I’m sure Michael has a point. I think the way he said it got up Jeff’s nose a little (it certainly got up mine), but it’s valid. For some, the web just seems simple and trite. My lecturer thinks like this I suspect. I also agree with Jeff that it’s somewhat myopic — if you dismiss web apps, you dismiss a lot of clever, well written programs right out of the gate.

The debate got me thinking about why I’m studying programming. I’m a web guy, but not even “smart enough” to “throw an ASP.NET webpage together”. But I see the innovation in web pages. I also see how useful these technologies will be moving forward. While Michael is coding apps that will work on one type of system sitting on someone’s desk, programmers like Jeff are making universally accessible programs that are instantly available to anyone with access to the internet. I could learn to regurgitate borrowed code in half-arsed web pages and validate Michael’s argument, but I’d rather learn to do it properly.

When I was leaving high school and thinking about what to study, the web was just starting to become mainstream. One teacher I got advice from had been programming years earlier and painted a picture of a world of drudgery, typing pre-written code without chance for innovation or personal expression. It was not a nice picture. I probably let myself be swayed by it too much I’m sad to say now.

What I discovered in the years after, is how exciting the world of web programming can be. Instead of being a small cog in a giant programming machine, a web programmer can be a vital part of a small team who’s work can be seen instantly. Of course I know now the same can be said of non-web programming, but the web was what opened my eyes.

So I’m going back to study to do something I should have done all along. And I’m going so I can understand: “virtual methods, pointers, references, garbage collection, finalizers, pass-by-reference vs. pass-by-value, virtual C++ destructors, or the differences between C# structs and classes”. And then I’m going to use that knowledge to make the best web programs I can make. Maybe along the way I’ll learn enough that web programming seems trite to me too, but I’m not expecting to. I agree with Jeff, and strongly believe good web apps are only going to become more important.

I want a slice of that action.

setJavahackercoding(3.1)

I managed to code me up some of the exercises from chapter 4, and I’m all over classes. The final exercise was to create a Robot class that took a name, weight, bad habit(?), artificial intelligence level, and whether it could see. As an extension exercise, it could also have a “memory module” that allowed 5 mutations (changes) to either the bad habit, or the AI.

My Robot.java class is below:

public class Robot {
    private String name;
    private double weight;
    private String badHabit;
    private boolean hasVision;
    private int aiq;
    private int mutations;
    private boolean decommissioned;

    public Robot(String name, double weight, String badHabit, boolean
        hasVision, int aiq){
        this.name = name;
        if (weight &lt; 0){
            this.weight = Math.abs(weight);
        }
        else {
            this.weight = weight;
        }
        this.badHabit = badHabit;
        this.hasVision = hasVision;
        this.aiq = aiq;
        if (this.aiq &lt;= 0){
            this.aiq = 0;
        }
        if (this.aiq &gt;= 3){
            this.aiq = 3;
        }
        mutations = 0;
        decommissioned = false;
    }

    public void mutate(){
        mutations++;
        if (mutations &gt;= 5){
            decommissioned = true;
        }
    }

    public void setBadHabit(String badHabit){
        if (!decommissioned){
            this.badHabit = badHabit;
            mutate();
        }
    }

    public void addModule(){
        if (!decommissioned){
            if (aiq &lt; 3){
                aiq++;
            }
            else {
                aiq = 3;
            }
            mutate();
        }
    }

    public String getName(){
        return name;
    }

    public double getWeight(){
        return weight;
    }

    public boolean getSight(){
        return hasVision;
    }

    public String getAIQ(){
        if (aiq 0){ return "Non Existant"; } if (aiq 1){
            return "Low";
        }
        if (aiq == 2){
            return "Medium";
        }
        else {
            return "High";
        }
    }

    public String getBadHabit(){
        return badHabit;
    }

    public void displayDetails(){
        System.out.println("The robot's name is " + name);
        System.out.println("The robot's weight is " + weight);
        System.out.println("The robot has a bad habit of " + badHabit);
        System.out.println("The robot can see = " + hasVision);
        System.out.println("The robot's AIQ is " + getAIQ());
        System.out.println("The robot has undergone " + mutations + "
        mutations.");
        System.out.println();
    }
}

It’s long. It’s also full of stuff I didn’t end up using in the test class, as I hate typing out System.out.println(); over and over to test stuff, so I included the outputs in a displayDetails() method. Probably should add those as tests at least once, just to check my syntax, but that would make my test even longer. This is my RobotTest.java class:

public class RobotTest {
    public static void main(String[] args) {
        Robot robby = new Robot("Robby",104,"Smoking",false,1);
        Robot bender = new Robot("Bender",200,"Drinking",true,2);
        Robot vacuum = new Robot("Vacuulux",20,"Sucking",false,-1);
        Robot astro = new Robot("Toby",-80,"Playing too much",true,3);

        robby.displayDetails();
        robby.addModule();
        robby.setBadHabit("Spitting");
        robby.addModule();
        robby.addModule();
        robby.setBadHabit("eating before swimming");
        robby.setBadHabit("dying");
        robby.displayDetails();

        bender.displayDetails();

        vacuum.displayDetails();
        vacuum.setBadHabit("breaking down");
        vacuum.addModule();
        vacuum.displayDetails();

        astro.displayDetails();
        astro.addModule();
        astro.displayDetails();
    }
}

The test helped me to pick up that my coding was wrong in my Robot. Originally I had omitted line 20, and had the test on line 21 as if (aiq < = 0){this.aiq = 0;} if (aiq >= 3){this.aiq = 3;} else {this.aiq=aiq;}. I’m not sure why this doesn’t work – if AIQ is less than zero it still sets this.aiq to the retrieved value – but I presume the test cannot read aiq unless it has been retrieved and put into this.aiq. Its seems better to do it this way anyway, as it’s less typing and less ambiguous. But that’s something I can say I’ve learned.

As for my double trouble this morning, I’ve been reading up on why one of my values had some extra decimals, and I believe it’s a particular problem when you try and store 0.1 in a double. I still have no idea how to get around it though and it seems like Java should be able to handle something like that, but who am I to judge, with my Tomatoes.java and my RobotTest.java.

So on to class tonight!

Update: I’m sitting in class. Looking over an example from the lecturer, I’ve realised that my original code didn’t work because I missed else if. I added it, and the code I originally thought should work worked!

Javahackercoding 2: This time, it's personal

Last night was a wash Java wise. I’ll be writing another post soon, once I’ve gone through my text book1 , and dissecting what we covered last night. Until I do that, I’m completely lost. And not because I can’t understand it so much as the delivery was all over the place.

My lecturer complained a couple of times that the text and notes go into complicated areas that if he were to teach it, would not be covered yet — which is fair enough. But then time and again he himself would veer off into areas that I’m sure will be covered in a few weeks (ie. not now) and just makes things more confusing now.

And what is with using “Dog” as an example of a program? Every introduction to programming I’ve read uses dogs, cats, cars and pizza to explain classes. That’s useful for about as long as it takes for you to “get” that a class can have attributes and functions, but beyond that is completely meaningless in a practical sense. Using dogs for coding examples just makes my brain hurt, because I can’t see how you can perform arithmetic on a dog, or use a dog to perform a function for another dog. I get that it’s using simple things to explain new concepts, but to me it just clouds the issue. Give me a real example (a simple one) of how making a function and calling it generates a result, and I’ll be happy. Unless your example is int x = a+b; - that’s almost as meaningless as Dog().

I apologise if I’ve used the incorrect terms for things in the previous paragraph. I also stress that I can’t do better or think of more useful examples because I still can’t program yet. But I’m working on it. And I’m gonna’ read a chapter ahead this time, as I suspect my classmates are only ahead of me by a hair as I’m pretty sure all the questions they were asking would have been straight forward and obvious if they were reading the text (judging by the questions they asked about stuff even I knew).

Please correct me or share your thoughts about how Dog() is actually a useful thing to learn!


  1. yes I have it now! 

Snipplr.com vs Snipt.net - code snippet hosting comparison.

So I’m looking to start storing short bits of code online. With my Java course starting tonight, it might be nice to have a place to share and exchange code with my classmates, and store for later use. I’ve been checking out some online code snippet repositories, and narrowed it down to two of the best.

Snipt.net is very pretty. It has a lovely ajaxy interface that swooshes and swashes around when you add and edit code, and just exudes polish. It has an embed function that allows you to post to a website and have the code remain up-to-date no matter how many revisions you make. Someone has also made a Wordpress plugin that makes the embedding even easier (which is nice for my purposes). What it lacks right now is an API (they’ve asked for help from the community, but there doesn’t seem to be much there right now).

Snipplr.com on the other hand is all about the API. They have plugins for all sorts of IDEs, and like Snipt, a Wordpress plugin (which on the other hand won’t let me input my API key…). They offer a bookmarklet to quickly add code from your browser, and a Textmate bundle for those of you who like that sort of thing. Like Snipt, embedding snippets is a breeze but unlike Snipt, Snipplr keeps previous versions, so revising code never overwrites previous work completely.

Already Snipplr is in front for me — even though I’m a sucker for a pretty (inter)face — but what makes it most compelling for me is the ability to “watch” other users. While Snipt offers RSS feeds for every user, I’m used to the social networking idea of following people and keeping up-to-date from within the site. Because I’m learning from my classmates and people I already follow on sites like Twitter, I need an easy way to keep tabs on what they’re coding.

So in the end Snipplr wins. If Snipt develops some of these features, I might move to it (it’s so damn purdy), but until then Snipplr is the most feature rich of the tools I’ve looked at1. So I’ll be coding there. Watch me at joshnunn.

I’ve included embedded code from each site to show you how they look.


  1. I have looked at a few more, but none came close to matching even the rudimentary features of these two services 

Potential Google Game

Google Logo made of
        LEGO

google_logo by Gayle Laakmann McDowell.

OK, I haven’t Googled it so this game might already exist.

Two or more players - one player does a bit of research (if they need to) and declares some piece of information that the other players must find. Ideally it should be something that will only be found on one page on the net - not common info like you might find on Wikipedia, but rather some small factoid on some obscure website in the outer reaches of the internet.

Then the other players have to craft the perfect search phrase that will produce that page in the top result of a Google search - without using any of the actual words you’re searching for, or any prior knowledge of the page to your advantage. The player’s score decreases with every failed attempt to make it into the top spot.

I can’t think of anyone geeky enough to actually play this with me, so it’s purely hypothetical. And it’d probably need honing and crafting to make it playable. If you’re geeky enough you might also like Googlewhacking or you could check out this online archive of Google games.