Sid Carter

Vagrant and Fedora 22

I’ve used Vagrant previously for testing something and forgot about it. Now, I need a Fedora server to test something. So, I thought, why not use Vagrant to do what I want. And as I’m wont to do, I wanted to document it. So here goes nothing and everything.

I’m using a Mac, so I’m obviously going to use Homebrew to install everything I need. Before we proceed, let’s first install cask, cause we’ll need that to install our packages.

$ brew install caskroom/cask/brew-cask

That’s done. Let’s install vagrant and virtualbox next.

$ brew cask install virtualbox
$ brew cask install vagrant

Next, let’s get the Fedora images. Make sure you get the image for vagrant. Here’s the one I downloaded:

~/Downloads $ du -h *.box
~/Downloads $ shasum -a 256

To be able to use our downloaded image, we’ll need to add it to Vagrant.

~/Cave/Fedora22 $ vagrant box add ~/Downloads/ --name fedora-22
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'fedora-22' (v0) for provider:
    box: Unpacking necessary files from: file:///Users/sidcarter/Downloads/
==> box: Successfully added box 'fedora-22' (v0) for 'virtualbox'!

After adding the image to vagrant, create a Vagrantfile that’ll use this image.

$ cat Vagrantfile
Vagrant.configure(2) do |config| = "fedora-22"

Let’s start them engines now, shall we? In the directory with the Vagrantfile, you can do a vagrant up and you should see this:

~/Cave/Fedora22 $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'fedora-22'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: Fedora22_default_1444702096982_14160
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Installing rsync to the VM...
==> default: Rsyncing folder: /Users/sidcarter/Cave/Fedora22/ => /vagrant

That’s looking good so far. Let’s login to the box now and look at what we got, shall we?

~/Cave/Fedora22 $ vagrant ssh
Last login: Tue Oct 13 02:10:25 2015 from
[vagrant@ip-10-0-2-15 ~]$
[vagrant@ip-10-0-2-15 ~]$ cat /etc/fedora-release
Fedora release 22 (Twenty Two)

Fantastic! We’re done here. I hope you find this useful.

String formatting in Python

Python has had awesome string formatters for many years but the documentation on them is far too theoretic and technical. With this site we try to show you the most common use-cases covered by the old and new style string formatting API with practical examples.

Porting code from Python 2 to Python 3

This page documents all the little changes between Python 2 and Python 3. Useful, so you can already start programming for the future and dropping the old ways of doing things.

So much has changed between Python 2 and Python 3, there are vanishingly few programs that will run unmodified under both. But don’t despair! To help with this transition, Python 3 comes with a utility script called 2to3, which takes your actual Python 2 source code as input and auto-converts as much as it can to Python 3.

Also, generators are awesome.

On Simplicity

A must-watch talk by Clojure creator Rich Hickey on simplicity.

Computers and Me

I first programmed on a computer, in LOGO and BASIC, almost 25 years ago. I loved it back then for the things I could do with it and the future possibilities. I love it even more now for all amazing fantastic creations you can make from it. It changed my world then and continues to change it every single day of my life.

I’ve been through some interesting times and there’s more to come. Everything I’ve learnt has been through many successes and failures. When I first started playing with Linux, I would reinstall it almost every day cause I wanted to try something new. Then I started recompiling my own kernels to make it lighter, faster, betterer. So many failed boots. I even used to run only on development versions. That stopped after a while, of course.

I loved getting onto Debian. Then, I got introducted to FreeBSD and the ports system. Magic!

Now, I exclusively use a Mac because it has a FreeBSD kernel and a beautifully designed operating system that just works. I’m learning things, things that didn’t exist almost a decade ago, things that are changing the world as we know it.

I love it. I love the feeling that comes with all of this. There is so much to do and miles to go, many many miles to go.

The future’s bright and this is just the beginning….