Wanted to quickly share some thoughts and links of software I’ve found recently and what I’ve been up to.

If you’re into home automation at all you have to check out Home Assistant. There is a bit of a learning curve initially but once you get an understanding of how to configure it you’ll find there is a lot of potential with it. I recently replaced my HomeBridge installation on my Raspberry Pi 3 with the prebuilt RPi3 image.

If you manage servers big or small take a look at Ansible. It isn’t new technology but it is something I’ve grown quite fond of recently. It’s easy to install on Linux, Mac and even Windows 10 if you have that oddly named Linux add-on. Even if you don’t use Ansible to manage servers you should use something.

If you enjoy Destiny or Destiny 2, checkout Guardian Theater. This is a project spearheaded by a friend of mine after collaborating with me on a Xbox GameDVR clip site (https://xboxrecord.us) and deciding it’d be way cooler if you could look up clips related to yours. Guardian Theater promises to show game clips recorded by other guardians while in the same activity as you. Lots of fun!

Does your WordPress site load in under a second? This one can despite running, for years, on one of the lower VPS tiers available at DigitalOcean thanks to Cloudflare. DigitalOcean’s server offerings are excellent for the price and I’ve always found the performance perfectly acceptable given what I’m paying each month. That said, Cloudflare offers a free CDN tier with just the right mix of features to be appealing and useful. No matter how good your server is you will always benefit from a CDN’s ability to cache content and get it physically closer to your audience. This post goes into detail about how to get the best possible performance from Cloudflare and WordPress by tweaking a few settings and installing a single plugin.

I have no association with Cloudflare and I’m not hear to sell it to you but for this post to make any sense you’ll need to have a WordPress site running through at least Cloudflare’s free CDN offering. If this sounds like you then lets continue.

Continue reading

 

Although I’m more than comfortable using command line tools to manage things there are times where a GUI is just more convenient. Pruning old containers, images and volumes in Docker are all things that are easier much to manage under a new tool I saw via twitter the other day. Portainer promises to make the task of managing Docker a bit easier and they’ve made good progress on delivering on that promise.  Getting up and running with it is incredibly simple because, as you’d expect, it’s available as a Docker image.  Simply issue the following this slightly Mac specific command:

docker run -d -p 9000:9000 -v "/var/run/docker.sock:/var/run/docker.sock" -v portainer:/data --name portainer portainer/portainer

This will get Portainer up and running on your system. If you’re on a Linux system you can skip mapping docker.sock. The other mapping just gives a persistent store for the little bit of data Portainer generates.  For full documentation visit their documentation site.

Found myself with an odd situation when running Jenkins using Docker. The time displayed was correct but claimed it was UTC which lead to some inconsistent behavior. The best way to resolve this is to force the Docker container to use the correct timezone from the host system.

To do so, add the following to your run command:

-v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime

screen-shot-2016-10-24-at-11-22-05-pm

Not too long ago a Raspberry Pi 3 found its way into my home and after looking around on the Internet for Raspberry Pi based projects I decided to turn it into a HomeKit hub using Homebridge. While installing Homebridge isn’t terribly difficult I decided I could make it even easier by utilizing puppet.

Using puppet to install Homebridge as well as any additional modules you want is beneficial because you can backup the puppet files and if you need to rebuild your Raspberry Pi for any reason you can quickly get back up and running by applying your existing puppet config. If you’re feeling adventurous you can manage all of your software and configs using puppet.

This post details how to get Homebridge installed on a Raspberry Pi running Raspbian Jessie and assumes you have already Raspbian installed, have gained access to it using ssh or are using the terminal application in PIXELS.

To install Homebridge, do the following (prefix all commands with sudo if you are not already logged in as root):

  1. apt-get update
  2. apt-get install puppet
  3. puppet module install puppetlabs-apt
  4. puppet module install puppet-nodejs
  5. puppet module install dustinrue-homebridgepi

With that out of the way you can create the puppet file that defines what software is installed on your system. To get started, all you need is the following:

include homebridgepi

Into a file called homebridge.pp using your favorite editor. You can now tell puppet to apply this to your system.

puppet apply homebridge.pp

This will install Homebridge and set it to start on system boot using systemd. Homebridge will be installed to run as root but you can change this behavior by editing /etc/systemd/system/homebridge.service and changing the User value. I choose to run it as root as some modules require root privileges to run helper programs. Know that if you do so you’ll need to manually move your .homebridge directory from /root to whatever user you choose.

You can view the logs of Homebridge by issuing:

journalctl -uf homebridge

You will find your config.json file located at /root/.homebridge/config.json. In it will be the default config that you can expand on. You can configure any additional modules you want to install (described below) in this file as well.

From here you can define additional Homebridge modules you want to install by editing your homebridge.pp file. As an example, here are some of the modules I install on my system to support what I’m using Homebridge for:

 

include homebridgepi

package {
  'vim':
    ensure => 'installed',
    provider => 'apt';

  'homebridge-wol':
    ensure => 'latest',
    install_options => '--unsafe-perms',
    provider => 'npm';

  'homebridge-xbox-one':
    ensure => 'latest',
    source => 'https://github.com/dustinrue/homebridge-xbox-one.git',
    install_options => '--unsafe-perms',
    provider => 'npm';
}

 

Valve recently released SteamOS into the wild in beta form and as soon as I could I downloaded it and got it installed on my low to mid range gaming PC.  My motherboard, CPU and RAM are newer but the GPU is a bit on the older and inexpensive side.  That said, it is very capable of running SteamOS and I imagine anyone who has built a gaming rig in the last few years will be able to run it.

Step One: Have a PC

Step One: Have a PC

Actual hardware requirements for SteamOS aren’t outlandish requiring any 64bit capable Intel/AMD CPU, 4GB memory and at least a 500GB HD.   The harder requirement is that the motherboard must support UEFI booting.  There are work arounds to this requirement but it’s beyond the scope of this post. 

Lets get started with the installation. I’m looking at this from the perspective of a Mac user to many of the tools to get things prepared are Mac based.  Here’s what you need:

  • PC meeting the above requirements
  • Flash drive larger than 1GB that can get partitioned/formatted
  • An empty hard drive or a really good backup of your current system
  • A machine to download and prepare the installer with, I’m using a Mac with OS X
  • The SteamOS installation files (http://store.steampowered.com/steamos/download/?ver=custom)

Preparing the flash drive

Insert the flash drive into an available USB port and start up Disk Utility.  Click once on your flash drive (it’ll be listed on the left side) and then click the Partition button.  From the partition layout menu choose  1 Partition.  Name the drive if you wish and ensure that the Format is set to MS-DOS (FAT).  Last, double check that the partition type is Master Boot Record by clicking on the Options… button.  Use the following screenshots as a reference:

Create 1 partition formatted in MS-DOS (FAT)

Create 1 partition formatted in MS-DOS (FAT)

 

Ensure the partition type is Master Boot Record

Ensure the partition type is Master Boot Record

 

When you are satisfied with the parameters click the Apply button and finally the Partition button.  Your flash drive is now ready to copy the SteamOS installation files to.

Copying files to the flash drive

Download the installer files and extract them if they aren’t already. I’m going to assume that the files were extracted into your Downloads directory.  If not, then you’ll need to adjust the paths used in the next command.  To copy the files to the flash drive I used rsync in terminal.  This ensures the files are copied including any hidden files. Use the following command:

rsync -av ~/Downloads/SteamOSInstaller/ /Volumes/UNTITLED\ 1/

Remember to adjust any paths depending on how you named your flash drive or if you didn’t extract the SteamOS Installer files in your Downloads directory. Also note that there IS a trailing slash on the SteamOSInstaller directory.  This is important!

Copying files to the flash drive can take some time

Copying files to the flash drive can take some time

Press enter and allow the rsync operation to finish.  Once done, eject the flash drive using Finder.

Prepare the target PC

To prepare my PC for SteamOS I unplugged all of my internal drives.  This absolutely vital if you don’t want to risk having your existing hard drives wiped clean! I happen to have an extra 500GB drive sitting around for this project and if you don’t or don’t have your PC backed up, then stop here because you’re about to lose everything.

If I haven’t scared you off, then we can continue.

In my BIOS I ensured that all of the UEFI boot options were either enabled or would occur first.  This step is going to be different on each motherboard so you’ll need to play around to make sure things are right.  Basically:

  • Ensure the system will boot using UEFI at all
  • Ensure that UEFI booting is enabled for USB ports and USB flash drives
  • Ensure the UEFI is used before any legacy option

Insert the flash drive into a USB port on your computer and boot it.  Enter your motherboards boot menu if you have one or set your system to boot from USB first.  My system allows me to bring up a boot menu and I pick the EUFI USB Hard Drive option:

Boot menu

Boot menu

You should then see the following:

I picked Express Install

I picked Automated Install

Pick Automated Install and the first phase of the SteamOS installation will get started.  You’ll be looking at a lot of these for awhile:

Progress bars

Progress bars

Allow this phase to complete.  Eventually you’ll be told the system is going to reboot. When it does, remove the flash drive. SteamOS will then reboot to a standard login screen.

Initial Configuration

At this point you are faced with a standard login screen.  Do the following:

  1. Enter steam for the username, press enter
  2. Enter steam for the password, press enter
  3. Click Activities in the upper left
  4. Click Applications
  5. Click Terminal
  6. Type in steam and press enter
  7. Accept the EULA
  8. When finished, log out
    1. Click steam in the upper right
    2. Click logout
    3. Click the logout button

Here are some screenshots for reference:

The login screen

The login screen

Starting terminal

Starting terminal

 

You must now login as the desktop user by doing the following:

  1. Enter desktop for the username, press enter
  2. Enter desktop for the password, press enter
  3. Click Activities in the upper left
  4. Click Applications
  5. Click Terminal
  6. Type ./post_logon.sh, press enter
  7. Enter in desktop as the password, press enter

The system will now perform a number of post phase 1 install routines and then reboot.  After rebooting the system will create the system restore partition. You simply answer yes to a question and the rest is automated.

Just say yes

Just say yes

Pick reboot and press enter

Pick reboot and press enter

Once completed the system will reboot again into SteamOS and finally into Big Picture Mode where you can create or log into your Steam account. The initial boot up can take some time so be patient.  You are now ready to go!

Just picked up Tomb Raider (2013) for PC and I thought I’d post the settings I’m using for others to try.  I don’t have the best card around so I attempted to dial in something the card was able to do while maintaining 30fps.  I’m running the latest Nvidia drivers as of 3/5/2013 and Nvidia has already stated that they were caught off guard so hopefully the framerate will improve with updated drivers and/or settings can be increased.

2GB 550 Ti Tomb Raider settings
 resolution: 1920x1080
 refresh: 60hz
 v-sync: double buffer
 fullscreen: on
 exclusive full: on
 display: 1
 monitor aspect auto
 quality custom,
 texture quality: ultra
 texture filter: anisotropic 4x
 hair quality: normal
 anti-aliasing: fxaa
 shadows: normal
 shadow resolution: high
 level of detail high: high
 reflections: high
 depth of field: normal
 ssao: normal
 post processing: on
 tessellation: off
 high precision: on
min: 30, max: 44.0, avg 33.2

One of the great things about tent.io is how it discovers where your server is.  This is important because it is possible for you to keep your tent entity URL indefinitely but change what server is actually responsible for acting on behalf of it.  http://tent.io/docs/server-protocol details how the process works so I won’t get into here.  I’m going to quickly cover how you add this header in Apache in a VirtualHost config file or .htaccess file.  If you only have access to change your .htaccess file go ahead and do so there, if you can edit your virtual host config file you can do it there as well.  The end result will be the same.

The format is the same in either the VirtualHost config file or .htaccess file.  It is simply:

<ifModule mod_headers.c>
  Header set Link "<https://controlplane.tent.is/tent/profile>; rel=\"https://tent.io/rels/profile\""
</ifModule>

Replace “https://controlplane.tent.is/tent/profile” with the location of YOUR profile.  Place the above text directly into your .htaccess or within the <VirtualHost></VirtualHost> stanza of your virtual host config file.

If you edit your virtual host config file, you’ll need to reload or restart Apache for the changes to take affect.  Keep in mind that you can’t add headers to a redirect so if you use a redirect to add www to your site address (for example) you can’t put it in the redirect stanza.

You can test the results using curl -I <hostname> or online using http://web-sniffer.net