Archive for the ‘Bubba’ Category

tmux for bubba2

September 17, 2011

There are various replacements for the traditional screen command in Linux, Byobu and tmux being two good ones. Byobu is good, but after trying tmux on various Linux machines I really wanted it also on the bubba2.

As tmux doesn’t seems to be in the bubba2 or etch repositories, the next option is to build it from source. Below follow some ideas for doing this.

Note: you may need to install/upgrade gcc and other tools to complete the steps below, if you have a standard, out-of-the-box bubba2 system.

  1. Switch to su and create a directory for source & resulting binaries
    mkdir ~/project
    cd ~/project
  2. Compile proper libevent version
    tmux needs a more recent version of libevent than installed as part of bubba2 standard setup. First remove current libevent, then compile the new one:
    apt-get remove libevent1
    mkdir ~/project/libevent
    cd ~/project/libevent
    gunzip libevent-1.4.14b-stable.tar.gz
    tar xvf libevent-1.4.14b-stable.tar
    cd libevent-1.4.14b-stable
    make install
  3. Register the new libevent
    Edit /etc/, e.g. by “vim /etc/”, add the line “/usr/local/lib/” (no quotes) at the end.
  4. Reload the new libevent
    Simply run “ldconfig”.
  5. Compile and install tmux
    mkdir ~/project/tmux
    cd ~/project/tmux
    tar xvf
    cd tmux-1.5
    make install
  6. Configure tmux and start using it
    First, exit from superuser mode by typing “exit”. Then, you probably want to customize tmux, try googling “tmux config file” or similar for samples. I currently use the following:# Make it use C-a, similar to screen..
    unbind C-b
    unbind l
    set -g prefix C-a
    bind-key C-a last-window
    # key bindings for splitting
    unbind %
    bind | split-window -h
    bind h split-window -h
    unbind ‘”‘
    bind – split-window -v
    bind v split-window -v# Reload key
    bind r source-file ~/.tmux.conf#set -g default-terminal “screen-256color”
    set -g default-terminal “xterm”
    set -g history-limit 4096
    # Terminal emulator window title
    set -g set-titles on
    set -g set-titles-string ‘#S:#I.#P #W’# THEME
    set -g status-bg black
    set -g status-fg white
    set -g status-interval 60
    set -g status-left-length 30
    set -g status-left ‘#[fg=green](#S) #(whoami)@#H#[default]’
    # set -g status-right ‘#[fg=yellow]#(cut -d ” ” -f 1-3 /proc/loadavg)#[default] #[fg=blue]%H:%M#[default]’
    set -g status-right-length 75
    set -g status-right ‘#[fg=red]Up #(uptime | cut -f 4-5 -d ” ” | cut -f 1 -d “,”) #[fg=black]#[fg=yellow]#(cut -d ” ” -f 1-4 /proc/loadavg) #[fg=cyan,bold]%Y-%m-%d %H:%M:%
  7. Start using tmux
    “tmux” starts tmux. Now you can create new windows/panes, and kill the sessions whenever you want. When you reconnect to the bubba2 over ssh, just type tmux attach and you can continue where you left off.

Wiring the house, part 3: Planning the 1-wire sensor network

September 2, 2009

When ordering the needed hardware new possibilities came to mind, as they so often do when you are browsing catalogs of companies selling cool gadgets…

The first version of the 1-wire network will look something like this, possibly with some of the sensors furthest away from the server installed at a later time. Some of these sensors are after all pretty expensive (just the humidity sensor, HIH-4000-001, got it from Digikey, that is attached to the DS2438 AD converter cost around €20). Getting the all the cables in place have also turned out to be a bit tricky, the tubing in the walls back in –65 just weren’t made with cat-6 networks, phone lines and 1-wire networks in mind…

SP53 1-wire network

The Linux server will run either temploggerd and owfs (if I can get it to work on the small Bubba Linux server that I am using, so far it compiles ok but doesn’t seem to respond properly to the sensors), or thermd.

I verified thermd runs (it does work as expected but it takes 15-20 seconds or so to update the graphs) on the Bubba server as long as you install the perl runtimes and quite a few Perl packages, but as owfs offers a better client-server approach it would be the preferred solution.

Tweaking Bubba

September 27, 2007

I realized the other day that it is only a matter of time before I loose track of what changes have been made to the Bubba’s original configuration. What applications have been installed? What config files are being used? If I ever had to re-install the Bubba, or were to configure a Bubba for someone else, it would take a lot of time to get it going.

Enter this post. Ok, keeping track of all config files may be too ambitious, but it feels like a good idea to at least keep a log of what packages are installed. It will evolve over time, maybe some key config files/data will be included as well. And if it turns out to be a handy resource for other Bubba users – even better.

  1. Slimserver. If you have a Squeezebox media adapter, the Bubba is a fantastic match. Put your mp3s on the Bubba, install Slimserver (which is the server-side companion to the Squeezebox), hook up the Squeezebox to your stereo and you have a very nice, silent, always-on, low-power solution for listening to your mp3s. No more booting of the desktop PC, or having a power-hungry, loud server sitting in a corner somewhere. The guys at Excito has made a complete package available for download, including a Slimserver version that runs ok on the Bubba (the latest Slimserver versions are a bit too demanding for current generation Bubba, so you have to live without some of the latest features. I have never missed anything though, so it’s not a problem). More info here.
  2. Using SMART to monitor health of hard disk. Smartmontools is a very nice little package that monitors the health of your hard disk(s). Fairly small footprint, good feature set. Very flexible scheduling options allow you to do (for example) a basic test on a daily basis, and a more thorough test once a week, month or whatever. Once again, the Excito forums provide good info. More info here and here.

TODO list

With the Bubba having such limited memory and processing power, you really can’t put too many applications on it. So it is a bit of a balance act to decide which ones of the built-in features to enable, and what new packages to install. Below follows the current candidate list of nice-to-haves..

  1. Webmin. Very nice and extensible browser based server management solution. Kind of demanding on system resources, so it is likely to run slowly on Bubba. Also, it is a bit tricky to set up under Apache (by default it comes with its own web server, which in the case of Bubba just eats up precious resources). Some discussions (here and here) on Excito forums indicate it is indeed possible to use Webmin on Bubba.
  2. Some good, lightweight system monitoring server. With the limited process speed and amount of memory in the Bubba, it would be nice to have a way of monitoring system resource usage, and ideally warn by an email when some threshold is passed (too much swapping to disk, for example).
  3. Setting up secure tunneling to allow for access to Bubba (SSH, http, https) from very within very restrictive firewalls. Starting points for more info are found here and here (and many other places). Tinyproxy also seems to be a good, lightweight solution. Remains to be seen if it works on Bubba.
  4. Hardening of SSH. More info here and here (good one).
  5. Backup, backup of backup, and backup of backup of backup. So I am paranoid – I admit it. I want triple backups of my data, with the last backup being physically separated from the first two. My vision is to have the Bubba back up photos, documents and other valuable stuff normally residing on my desktop PC. The decTop then will backup the Bubba (decTop is another small, fan-less system, similar to Bubba). The decTop will then finally replicate its hard drive to some external site, possibly another Bubba placed at some friends house, maybe using this approach. Could also use a service like Mozy, I am however not sure what the backup performance would be like from Europe, and as they don’t have a Linux client it would require the PC to drive the backup.

Using Bubba as media server

September 6, 2007

After testing a lot of different media center solutions for the PC, as well as trying to convert an ASUS WL-500g Premium running OpenWRT into a media server, I realized I’d like to listen to some music and watch some movies, and not just try to get the underlying technology working.

So I bought a Bubba. Nice little box, I especially like that there is no fan and that power consumption is low. I have placed in the closet next to the wireless router and modem, so whatever little noise it makes no-one will hear it.

An important reason for choosing the Bubba was the very active and helpful community around it. I have several times been very pleasantly surprised at the speed with which Excito’s (the company behind Bubba) staff reply to questions. A bonus is that it runs pretty much a standard Debian, so there is plenty of software to play around with.

On the negative side… Well it only has 128 MB memory, which is really on the low side if you want to run a LAMP server together with some media streaming software. As I have a Squeezebox connected to the stereo, running Slimserver on the Bubba was high priority. Initial tests weren’t too successful, but the good people at Excito helped out and even put together a full Debian package with Slimserver and other needed software. The web interface to Slimserver is a bit sluggish and indexing of lot’s of mp3s isn’t lightning fast, but it works and does what you expect it to do.

As for media and other features the Bubba comes pre-configured with UPnP and DAAP, a real mail server, print server etc. Good stuff!

To sum things up, I now have a really small, energy efficient, secure, silent backup/file/media server that is running 24/7.

Oh yes, a bonus with the Bubba is that it is quite easy to set it up to automatically back up your PC (or Mac). With a 500 GB drive in the Bubba and using rsync to copy only changed files from the PC to the Bubba, backups are easy and invisible. I had a recent bad experience with some spyware that crippled the PC, and that got me thinking about good backup solutions.