Category Archives: Linux

Raspberry Pi 3 Model B+ 4 USB Ports

Connecting a Raspberry Pi 3 to Wifi and add defaults

  1. Connect the Raspberry to an existing local area network by cable.
    –  I used the Ubuntu “Shared to other computers”-Network manager Setting to bridge my eth0 to my wlan0 connection providing internet access.
  2. Connect via ssh to this device
    username: pi
    password: raspberry
    – usually you don’t now the ip of the device use nmap 10.42.0.0/24 -p 22  to search for open ssh devices
  3. Scan for local wifi networks: sudo iwlist wlan0 scan 
  4. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf  and add your wifi connection data:

  5. restart the wifi and bring it to connection sudo ifdown wlan0 && sudo ifup wlan0
  6. Get the latest software status lists: sudo apt-get update
  7. Update all installed software: sudo apt-get upgrade -y
  8. Install common software to harden the system:
    sudo apt-get install x11vnc htop bmon fail2ban vnstat ufw
    x11vnc: nice tool to use VNC connections on the main x session
    htop: visualizes processes and load in color
    bmon: visualizes network traffic
    fail2ban: handles bruteforce attacks by banning Ips for a certain amount of time
    vnstat: counts network traffic over time
    ufw: makes it easier to handle ipables and configure your firewall
  9. Start the Raspberry Pi 3 Configuration Programm: raspi-config
    – expand file system to match your sd card size
    – set hostname in advanced settings
  10. enjoy your new Raspberry Pi 3 \o/

Building tinc1.1pre11 on Ubuntu

Because local package sources currently only offers tinc 1.0* versions we need to compile tinc ourselfs to use the features like invite or join of 1.1.

 

Controlling ws2812b with an esp8266 by open-pixel-control protocol

Harder than it looks but controlling an 5m led stripe using the esp8266 by the open pixel control protocol took me a night (and might be the reason for extra bad english as i write this post directly after it). But it’s real fun!

There are several ways to make the controller blink, the easiest way is shown here:

For the duration of infintiy, it sends the static header consisting of 4 bytes ( prio, command and checksum) followed by 8bit red 8bit green and 8bit blue for each led of the stripe. It gets the blinking values by asking the source of random in linux.  It lacks a bit of white as my power source got to its limits, so if you reimplement this use 5V and 1A per 30 leds.

Another thing to mention is the data length field which are bytes 3-4 of the header or \x02\xA6 as in the command above. This length needs to equal the amount of leds times three, so in this example 226 Leds where controlled as the bytes in network order end up to be 678.

This results in that little animation:

Another possibility is to send these packets by a small python script like that:

Code for the controller at github.

docker-compose wordpress with rerun-able volumes

There are several tutorials and files for running wordpress in docker. For me nearly none of them worked, therefore i wrote my own rerunable docker-compose file, which I like to share here now:

Just put this code into docker-compose.yml, change the passwords accordingly and run a new wordpress simply by:

Howto use docker volumes containing remote sshfs mounts

For my audiobook-feeds github repository I needed docker to be able to use a host volume mount which contained a remote  sshfs mount located on my local raspberry pi with a attached external hard drive. For my own sake of documentation and to offer you something to profit from, I created this small howto:

First of all, connect to your server and mount your remote device via sshfs using the -o allow_root flag. The allow_other option I tried first didn’t work for some reason.

Then run the container using the –privileged flag.

After that the root user of the container is able to list and to server the remote files.