About Brandon

I was born to make it work.

How to mount a local directory or volume with lxd

1. expand the range of uid and gid available by editing /etc/subuid and /etc/subgid

[email protected]:~$ sudo cat /etc/subuid

[email protected]:~$ sudo cat /etc/subgid

2. restart lxd to apply those changes
[email protected]:~$ sudo /etc/init.d/lxd restart
[ ok ] Restarting lxd (via systemctl): lxd.service.

3. launch your container
[email protected]:~$ lxc create :ubuntu $your_container
where you replace the $your_container value with whatever you would like to call your lxd container

4. enable an isolated idmap for your container
[email protected]:~$ lxc config set $your_container security.idmap.isolated true

5. map the local user ids and group ids to the in container uid and gid
[email protected]:~$ lxc config set bootybox raw.idmap "both 1000-2000 3000-4000"
where the parameters being passed in this example mean both (uid, and gid) in the range of 1000-2000 on the local host will be mapped to the range of 3000-4000 inside of the lxd container.

ex: uid 1001 on the local host = uid 3001 inside of the container

6. add your media
[email protected]:~$ lxc config device add $your_container media disk source=/zpool1/media/ path=/media
media = the name you would like to give this attachment
source = the source on the local host of the directory you would like to share
path = the path inside the container you would like to mount the source (make sure this exists)

7. restart your container for the new mappings to kick in
[email protected]:~$ lxc restart bootybox

8. exec into your container and check that all is well
[email protected]:~$ lxc exec bootybox bash
[email protected]:~# ls -l /media/
total 76
drwxrwx--- 2 3000 3001 2 Jun 2 21:22 games

9. profit.

1st official release of my home automation software: cloverleaf


I had some time to kill this evening while waiting on a flight and decided that I may as well show the world my terrible code. Introducing cloverleaf version 0.3 aka “gort”. Rather than go down the long list of things that are not yet functional I will stay positive and list the things that are.

  • toggling insteon or z-wave devices via an ISY home automation controller
  • support for some low cost color LEDs
  • control of any IR device via LIRC
  • various API: for text to speech, playing of files, notifications…
  • each of the above via the provided sample web interface or api calls
  • scheduling of repeated tasks via a cron like interface
  • and a dent has been made on documentation

Please test, submit issues, and above all; have fun.


Open source home automation, now with *ruby*

I started some work on a new project over the weekend. I had been fiddling with misterhouse for a bit, gotten a few things to work, joined the mailing list, asked a few questions, tried to answer a few, and generally had fun. I decided to try my hand at writing a RESTful open source home automation API to act as an abstraction layer between any of the many home automation protocols, insteon, z-wave, zigbee, IP, … and developers. Introducing cloverleaf. So far it can schedule repeating tasks ‘a-la-cron’, do text to speech conversion from an http request, and toggle a light on or off via insteon. I guess the beauty here is that anything can be done via an http request. The next steps are a working configuration file and parser. Any tips on getting ruby to parse a yaml config and spit out the result within the sinatra framework?

$49 Cubieboard is a raspberry pi competitor.

The $49 Cubieboard is a slightly more expensive, but better suited for duty as an HTPC option to the raspberry pi. It even has an IR receiver built in. Specifications below.

  • 1G ARM cortex-A8 processor, NEON, VFPv3, 512KB L2 cache
  • Mali400, OpenGL ES GPU
  • 1GB DDR3 @480MHz
  • HDMI 1080p Output
  • 100M Ethernet
  • 4GB Nand Flash
  • 2 USB Host, 1 MMC slot, 1 SATA, 1 ir
  • 96 extend pin including i2c, spi, lcd, sensors, ..
  • Running Android, Ubuntu and other Linux distributions
  • NO WIFI included

via liliputing