Mar 272013
 

My Raspberry Pi running Arch Linux didn’t get the proper time on system startup and here is the solution I came up with to solve this problem:

Create the file /etc/systemd/system/fix-time.service:

[Unit]
Description=Set the time using NTP time servers

[Service]
Type=simple
ExecStart=/usr/sbin/ntpd -s

and the file /etc/systemd/system/fix-time.timer:

[Unit]
Description=Runs fix-time every hour

[Timer]
# Time to wait after booting before we run first time
OnBootSec=10
# Time between running each consecutive time
OnUnitActiveSec=1h
Unit=fix-time.service

[Install]
WantedBy=multi-user.target

Now activate the whole thing:

systemctl daemon-reload
systemctl status fix-time.timer
systemctl start fix-time.timer
#Enable it to be started on bootup:
systemctl enable fix-time.timer
Mar 272013
 

I would recommend setting up the environment variables as well as activating the virtualenv in a Bash script and call that from systemd.

Working setup

Here is the bash script starting the bottle.py web app after setting up the virtualenv. It’s stored in /home/coltrims/MaxiGauge/webserver.sh:

#!/bin/bash

HOME=/home/coltrims
VENVDIR=$HOME/.virtualenvs/hhg
BINDIR=$HOME/MaxiGauge

cd $BINDIR
source $VENVDIR/bin/activate
$BINDIR/webserver.py

And here is the systemd configuration file /etc/systemd/system/bottle-web-app.service:

[Unit]
Description=Bottle Web App MaxiGauge
After=network.target

[Service]
Type=simple
User=coltrims
Group=users
ExecStart=/home/coltrims/MaxiGauge/webserver.sh

[Install]
WantedBy=multi-user.target

After creating the systemd .service file do:

Mar 272013
 

OK, here is how to start ssh on system startup (this is the content of the systemd .service configuration file /etc/systemd/system/autossh.service):

[Unit]
Description=AutoSSH service for a reverse tunnel from some.example.com to localhost
After=network.target

[Service]
ExecStart=/usr/bin/autossh -M 0 -q -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" someuser@some.example.com -R 1250:localhost:8080

[Install]
WantedBy=multi-user.target

After creating the systemd .service file do:

systemctl daemon-reload
systemctl status autossh.service
systemctl restart autossh.service
#Enable autossh.service to be started on bootup:
systemctl enable autossh.service

Resources

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Jan 202013
 

Ubuntu

Installation

sudo apt-get install vlan
sudo su -c 'echo "8021q" >> /etc/modules'
sudo modprobe 8021q

Usage and Configuration

# adding a vlan to a network interface:
ip link add link eth0 name eth0.10 type vlan id 10
# configuring the vlan:
ip addr add 10.0.0.1/24 brd 10.0.0.255 dev eth0.10
ip link set dev eth0.10 up

Make it permanent by adding the following lines to /etc/network/interfaces :

Nov 262012
 

This is how it shows up in the kernel log / dmesg on Ubuntu:

[712886.216957] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[712886.318980] usb 1-1.2: New USB device found, idVendor=7392, idProduct=7811
[712886.319014] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[712886.319034] usb 1-1.2: Product: 802.11n WLAN Adapter
[712886.319051] usb 1-1.2: Manufacturer: Realtek
[712886.319083] usb 1-1.2: SerialNumber: 00e04c000001
[712886.962139] usbcore: registered new interface driver rtl8192cu

Driver on Arch Linux

Doesn’t ship with it – you have to compile them yourself:

References

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
May 252012
 

Today my Raspberry Pi finally arrived! One of the projects I’m planning to use it for is out-of-band management for PCs.

This blog post will evolve as I’ll discover interesting things to do with my RPi.

About the hardware:

Arch Linux Essentials

Here are some of the steps that are most essential for me on the Arch Linux ARM image that I put on the SD card for my RPi:

Apr 162012
 

I used the built-in SD card reader to install Arch Linux from an SD card. The Arch Linux Wiki holds quite a few comments on what to take care of on the EEE PC 900.

The next steps were:

  • I upgraded to Grub2 (Yes, Arch Linux still uses Grub v1 as its standard bootloader).
  • Installed the command line tools htop, bmon, iperf.
  • Installed wicd, a network connection manager.
  • Installed Gnome (at least the most essential parts).
  • Installed GDM and set up the system to use it.
  • Installed Yaourt by adding the unofficial user repository [archlinuxfr] to my /etc/pacman.conf.
Apr 132012
 

Let’s suppose you have a device that has remote logging capabilities like the Switch TL-SG3210. In this case you may want to set up a machine on your local network to receive these log messages and store them permanently.

On Linux you have the choice between rsyslog and syslog-ng.

Syslog-ng Log Host on Arch Linux

https://wiki.archlinux.org/index.php/Syslog-ng#Configuring_as_a_loghost

With the following terminal commands you can set up your Arch Linux based machine as a log host. Log filenames will be based on the FQDN of the remote host, and located in /var/log/remote/:

Apr 292011
 
Attention! This is an advanced topic! Do not engage in any activity if you’re not cool with the Linux command line and ready to do something to your GoFlex Home that Seagate did not intend you to do! I’ve warned you.

This guide is a little bit out of date as of 2011-07-25. Please refer to http://archlinuxarm.org/platforms/armv5/seagate-goflex-home for up-to-date information.

The Hardware

Best image on the hardware:
The inside of the Seagate GoFlex Home
Full size: http://img641.imageshack.us/img641/3348/seagategoflexhomebasein.jpg | More images to be found in the Beyond Logic Wiki.

It’s a fairly standard hardware platform commonly found in many consumer NAS products:

Install ArchLinuxARM on the Seagate GoFlex Home