Twitter LinkedIn Github

Blog

  • How to migrate from WordPress to Tumblr

    Today, I’ve spent a large chunk of my day migrating my blog from WordPress to Tumblr and About.me.

    Before you ask why on earth I’d do this, let me just sum it up in a few bullet points:

    • I hate PHP and managing WordPress sites. Yes, it has gotten a lot better lately, but it’s still a big pain in the ass.
    • Most of the content I generate is either on other blogs, or fed via Twitter. As a result, I don’t blog too much.

    Now, you’re likely reading this post because you’re interested in the subject at hand, so let’s dive into it.

    Yet, before we start, there are a few pre-requisites for this to work:

    • You’re moving from one subdomain (or domain) to another. In my case, I’m moving from ‘viktorpetersson.com’ to ‘blog.viktorpetersson.com’
    • Your old blog will still be online (the redirect and images will still be served from here)
    • You use Nginx as your web server (but this can probably be changed pretty easily by adjusting the rewrite rules in the script).
    • You already have Tumblr up and running with your subdomain/domain.
    • You need a Tumblr API key. You can sign up for this here.

    The backbone of my migration was two WordPress plugins, so let’s get started by installing them:

    Start by installing these plug-ins into your WordPress site. Make sure to also activate them.

    Migrating the content to Tumblr

    Thanks to the plugin Tumblr Crosspostr, migrating the content over to Tumblr is a breeze. First, you need to configure the plug-in by adding your Tumblr API keys.

    Before we begin the migration/import, make sure you don’t have the setting in Tumblr that will automatically post to Twitter or Facebook. If you do, you’ll spam your own wall with all these posts.

    With that done, go to Tools -> Tumblrize Archive -> Tumblrize Everything!.

    Getting a list of source pages

    Once you’ve installed the sitemap-plugin, you should be able to go to http://your-site.com/sitemap.xml and copy and paste the content of into a text-file on your computer.

    It should look something like:

    http://viktorpetersson.com/ 100%    Daily   2013-08-02 13:21
    http://viktorpetersson.com/2013/08/02/are-they-using-google-apps/   20% Monthly 2013-08-02 13:21
    http://viktorpetersson.com/2013/06/15/my-presentation-from-pi-and-more-3/   20% Monthly 2013-06-16 09:03
    http://viktorpetersson.com/2013/06/01/join-me-on-pi-and-more-on-june-15/
    

    Generating redirects

    Next, let’s do put work some Python magic. Thanks to pytumblr, this part is a breeze.

    Start by fetching this file.

    You need to update the following:

    • tumblr_blog
    • wordpress_site
    • source_file
    • <consumer_key>
    • <consumer_secret>
    • <oauth_token>
    • <oauth_secret>

    With that done, you should be able to simply run the script. The script should spit out redirect rules that you can install on your Nginx configuration.

    After that you’re done. Happy hacking!

    07/24/14

  • My presentation from Zadara Summit

    Last month I spoke at Zadara Summit. I did however, I did forget to post the speaker deck here, so here we go.

    My presentation deck is available here.

    07/24/14

  • Installing Windows 7 on a MacBook Air

    It’s blasphemy, I know. Why would anyone in their right state of mind do such thing?

    Unfortunately, people outside the tech-world, and ISV who provides them with software, are still stuck with Windows (due to ignorance or lack of choice).

    If you want to equip someone in that world with a great and light laptop, a MacBook Air is a pretty good choice. It’s affordable, and since you will be installing a pure (i.e. non vendor/bloatware infected version) of Windows, it makes a pretty good Windows machine (an oxymoron, I know).

    In the process of preparing this MacBook Air, I was pretty close to going insane. To save you the agony I had to go through, here are the steps you need to take.

    • Make sure you have the following available: A Windows 7 installation DVD, a USB DVD drive, and a 8GB USB stick.
    • Insert the 32 or 64 bit version of Windows 7 into the USB DVD.
    • Fire up Disk Utility. Select the volume under the DVD drive. Click ‘New Image’ -> Select ‘DVD / CD Master’ as the image format and save it to disk.
    • Once the disk has been created, you need to convert it to an ISO image. This can be done using the Terminal by executing this command ‘hdiutil makehybrid -iso -joliet -o win7.iso win7.cdr’ (assuming you named the master image ‘win7.cdr’ and you’re in the directory you saved the image.
    • This next step is very important. You need to download Caffeine. This will prevent your machine from falling asleep during the Boot Camp Assistant run, which will take a while. Make sure you start Caffeine and that it is activated. If you fail to do this, your installation is most likely going to fail. You could of course disable all power saving features in OS X, but I find just running Caffeine faster.
    • Launch Disk Utility again and make sure you don’t have a Windows partition created from a prior installation attempt. If you do, make sure to delete it before continuing. If not, Boot Camp Assistant will behave differently.
    • Insert the USB stick directly into the laptop (i.e. don’t use a USB hub, as this can confuse the boot process later). Some people at various forum claims that it must be in the left USB port, but I’m not sure if that is true or not.
    • Launch Boot Camp Assistant. You need to make sure that you both create the USB drive and launch the installer. If not, the installation is most likely going to fail. You also need to select the ISO image we created earlier when the tool asks for the disk image.
    • Assuming you don’t run into any hiccups, you should be taken directly into the Windows installation.
    • After the installation, 12 hours of downloading security updates and 32 reboots, you should be up and running with your brand new Windows 7 machine.

    These notes will hopefully save you a bunch of hours, which I had to waste while learning these caveats.

    12/08/13

  • Are They Using Google Apps?

    Are they using Google Apps?

    In the past few months, I’ve started moved most of my conference calls from Skype to Google Hangout. The video and audio quality is a lot better, and it’s more convenient to manage. There is however one problem: If the other party isn’t using Google Apps or Gmail, they cannot join the Hangout. This has delayed many conferences calls for me.

    To resolve this issue, I wrote a simple web app called Are They Using Google Apps?. You can enter either the domain, or the email address, and the tool will tell you if the other party is using Google Apps (by simply checking the MX records).

    If they are using Google Apps, I will schedule a Google Hangout, and if not, I will schedule the conference call with UberConference.

    08/02/13

  • My presentation from Pi and More 3

    I just finished delivering presentation from Pi and More 3 in Trier, Germany. Here’s the slide deck.

    Update: As it turns out, the presentation was also recorded. You can find the video here.

    06/15/13

  • Join me on Pi and More on June 15

    On June 15 I will be speaking at Pi and More in at Trier University in Germany.

    The event is all about Raspberry Pi, and I’m really excited to be part of the event.

    My presentation will be about Screenly and how we built the most popular digital signage solution for the Raspberry Pi thanks to the awesome Raspberry Pi community.

    You can read more about the event here (German). The event is free to attend, and you can sign up here.

    See you there!

    06/01/13

  • Major update to Screenly

    Screenly_OSE_overview

    I’m excited to announce that we’ve released a major update to Screenly. As you can see in the screenshot above, we’ve given the user interface a major overhaul. The workflow is significantly more streamlined, and a lot prettier.

    You can take the new interface for a spin here. For upgrade instructions, please take a look here.

    More information about Screenly is available here.

    02/21/13

  • The world's shittiest monitor: Acer S235HLBII 23"

    Ok, this a long rant, but I just need to warn anyone else looking to buy this monitor. It’s the worst piece of garbage I’ve ever owned. If you’re thinking about buy one, just don’t. Pretty much anything else you can get your hands on is better.

    tl;dr

    On paper, it’s a pretty decent monitor. It’s a regular 23″ monitor with 2x HDMI input and one VGA. It seemed pretty ideal, since I was primarily looking to use it for my Raspberry Pi labs. For me, monitors are pretty disposable, and I don’t pay much attention to them these days.

    This monitor however must have been created by a bunch of either extremely incompetent engineers, or skilled engineers with an extreme hate for the human race.

    For instance, the input detector is so shitty that when you plug in a regular computer to it, you’ll be way into the operating bootup before it even detects the monitor (if at all). That means, there’s no way in you’ll be able to do access the BIOS with this monitor (unless you know the exact key combinations (and no, it’s not just ‘Delete’ as it used to be in the good old days)). When using this monitor with the Raspberry Pi, things gets way worse.

    In order for this piece of garbage to detect the Raspberry Pi, you need to carefully time when you power up the Raspberry Pi compared to the power up cycle for the monitor. If you either power up the Raspberry Pi too early, or too late, it won’t detect it at all and go to sleep.

    Then there’s the monitor’s menu system. You’d imagine that a feature like switching between inputs on a monitor with three inputs would be pressing one key. Nope, on the Acer S235HLBII, you need to dive into the menu and dive into a submenu to do this. Moreover, you can’t even get to the menu if the monitor can’t detect any input.

    If you could at least force the monitor to a given input, I guess I could live with this monitor, but you can’t. It will automatically jump back and fort in order to its own pathetic probing.

    For the above reasons, I want to congratulate Acer for designing the world’s shittiest monitor.

    02/19/13

  • Introducing Puppet-hosting -- host websites with sanity

    Since we started WireLoad, the number of websites we host have grown steadily. It’s a myriad of sites, ranging from product sites to websites belonging to friends and family. Many of them are WordPress-sites (just like this one), while others are more complicated. Some use databases, while others don’t. Since we’re often in a rush when we set up a site, documentation often suffers, and you have to spend time later on trying to decipher how things were set up.

    This past week I finally had enough and decided to resolve this issue once and for all. What we really needed was a template-based system that could take care of everything and provide us with a user friendly interface. Puppet felt like the best tool for the job so I got busy writing a custom module for this.

    The final result is a module I named Puppet-hosting. It allows you to manage all your websites using Puppet. To add a new site, all you need to do is to add a few lines to in your site.pp, and you’re all set.

    Here’s an example of how it can look:

    hosting::site { 'My Website':
      type        => 'wordpress',
      url         => 'mysite.net',
      url_aliases => ['mysite.*', 'www.mysite.net'],
      ip          => $ipaddress_eth0,
      contact     => 'Viktor Petersson ',
    }
    

    Not only does this make it much easier to manage all the sites, it also speeds things up and avoids human errors, such as typos (and if you do have a typo, it’s easy to spot, since it’s only a few lines in sites.pp).

    02/03/13

  • Screenly now has its own website

    I’m astonished by the amount of traction we’ve been seeing for Screenly. The Open Source-version is growing rapidly in traction, while the wait-list for the Pro-version is growing.

    Given the amount of traction, we’ve now allocated more resources from WireLoad towards Screenly. The first priority right now is a cleanup of the code base and to improve the user interface for Screenly OSE.

    Since I’ve been receiving a lot of emails from the contact form on my website about Screenly, we felt that it was important to push out a website for Screenly. We’ve now done this, and you can find it at ScreenlyApp.com. On the website, you’ll find more information about Screenly, along with a live-demo of Screenly OSE.

    01/22/13

Posts Tagged ‘KVM’

I’m a big fan of FreeBSD. However, as painful it is to admit, it isn’t always the best OS to run in the cloud. Compared to Linux, you will get worse network and disk performance even with Virtio installed. There are also other issues. For instance, it is likely that you won’t get CARP to fully work (while this works perfectly fine with OpenBSD’s CARP, and Linux’s VRRP). I have written about workarounds for this issue in the past, but they do not seem to work equally well in FreeBSD 9.0.

Luckily, there is a userland implementation of CARP called UCARP that works better than CARP. It’s also very similar to CARP when it comes to configuration.
more>>

In the previous post, I benchmarked three different virtual network drivers under FreeBSD. The clear winner was, perhaps not very surprisingly, the VirtIO network driver.

In this article I will do some further benchmarking and try to optimize the driver further. Similarly to in the last post, I will use two FreeBSD 9.0 boxes with 2GB RAM and 2GHz CPU. Both nodes are set up with a private network and running in a public cloud (at CloudSigma).

As many of you might know, running tests in a public cloud is difficult. For instance, you can’t control the load other nodes puts on the host resources and network architecture. To cope with this, I ran all tests five times with a 60 second sleep in between. This of course, isn’t perfect, but it is at least better than a single test.
more>>

With the launch of FreeBSD 9, I was curious to learn how the VirtIO driver performed. I’ve seen a significant boost in disk performance, but how about the network driver?

Luckily, that’s rather easy to find the answer to. I spun up two FreeBSD 9 nodes on CloudSigma and configured them with VirIO (just like in this guide) and a private network. Once they were up and running, I installed Iperf and started testing away.

I had three different network drivers that I wanted to benchmark:

  • Intel PRO/1000 (Intel 82540EM chipset)
  • RealTek RTL8139
  • VirtIO (QEMU/KVM)

more>>

Some time ago, I wrote about how to use Virtio with FreeBSD 8.2. As I pointed out in the article, the performance was not nearly as good in FreeBSD 8.2 as it was in 9.0-RC1. Hence I wanted to get all my nodes over to 9.0 as soon as possible to take use of the massive boost in I/O performance.

In this article I will walk you through the process of updating an existing system from FreeBSD 8.2 (without Virtio) to 9.0 with Virtio.

If you’re just curious on how to get Virtio working on a fresh FreeBSD 9.0 installation, skip to Step 2.
more>>

How to use Virtio on FreeBSD 8.2+

October 20, 2011 9:08 am    Posted by Viktor Petersson    Comments (7)

In the past few years, virtualization has been the big topic everybody keeps talking about. There are good reasons for that, but one thing that really annoys me as a hardcore FreeBSD-fan is how poorly FreeBSD performs virtualized.

For some time, the Linux-community have been using the Virtio-drivers to boost both I/O and network performance. Simply put, Virtio is a driver written to cut out any unnecessary emulation on the host and as a result both reduce load from the host and improve performance.

Unfortunately the FreeBSD-community haven’t been able to utilize this, as there were no port for this. Luckily that just changed and here’s how you enable it.

Just as a disclosure, I’ve only tried the I/O driver on CloudSigma, and it seems to be stable both on 8.2 and 9.0-RC1. According to other this post, the network driver should work too though. It should however be said that the I/O performance on 8.2 is significantly slower than on 9.0-RC1.
more>>