Sunday, September 28, 2014

HA-HeartBeat on Raspberry PI

High Availability HeartBeat is a clustering daemon. It allows to setup virtual IP addresses on network interfaces in order to provide redundancy in service availability. (It can also be used to automatically start/stop services)
In this post, we take a look at the basic HA usage, with two nodes.

Tuesday, September 16, 2014

mpd console player and ncmpcpp

For long time I've searched for a good music player. I've settled with mpd (music player daemon) and as a graphical frontend I use ncmpcpp. This post shows how to install and configure mpd and ncmpcpp.

Saturday, August 2, 2014

i3wm: change QT/GTK theme

If you'd like to change your window appearance, you can use systemsettings utility for QT windows and .gtkrc conf for GTK windows.

systemsettings is part of the KDE (included in kdebase-workspace package). Navigate to Application Appearance to change window theme:


GPIO 05-pwm

Raspberry PI has the ability to use PWM (pulse width modulation) to control width of the pulse sent on the GPIO pin, which provides better granularity to control connected devices, in this case LED.
This feature allows to control LEDs intensity, which can be used with RGB LED to mix colors.

Sunday, July 20, 2014

GPIO 04-rgb

I finally got to the RGB LED and tried to connect it to Raspberry PI.
This first script (04-rgb.sh) is a modification of previous one. It uses one new feature though, associative fields in bash to distinguish between the three basic colors (RGB) and their combinations (Yellow, Purple, Light Blue, White) as shown on the figure:


The following figure shows how the LED is connected to GPIO.

owncloud: Authentication error

This issue has been bothering me from version 5. After some investigation, it turned out the owncloud's authentication was "compromised" by other services running on the same web server (nginx) using the same fastcgi processor.

Monday, July 14, 2014

Installing GitLab on Odroid (ArchlinuxARM)

This post summarizes all steps necessary to install GitLab on odroid. The steps are basically the same as in the official guide.
Additionally I show my nginx and HA Proxy configuration for gitlab with changed docroot (relative url root) and explain how to successfully install bundle packages without libv8 dependency.

Sunday, July 6, 2014

keepalive.sh: send keepalive to remote server

This script is deployed on my odroid. It serves to keep track if the odroid has internet access and if it is alive. It uses simple keepalive sending via HTTPS protocol to a remote server. The remote server watches keepalive signals and will notify if they stop comming.

Monday, June 30, 2014

GPIO 03-leds

This script controls LEDs connected to the GPIO, however, it uses different approach. Instead of using python library to handle GPIO pins, is uses direct calls from shell. It is written in bash.

Wednesday, June 25, 2014

pingcheck.sh: restore wlan connection

Another simple script I used on my Raspberry PI and now use on odroid. It is simple, ping based check of IP address availability.
It has been designed to restore wlan0 connection, as from time to time I get disconnected from my network.
During the time I've added few features, like pingcheck of default GW and pingcheck of other IP addresses and network notifications which will send popup to my desktop PC.

Monday, June 23, 2014

GPIO 02-leds

This is a slightly modified 01-leds python script. It can turn on/off group of LEDs (all red, green or yellow) defined in the LEDret(color) function.
This post shows scheme of how the LEDs are connected to GPIO.


Saturday, June 21, 2014

GPIO 01-leds

This is my first post regarding Raspberry's GPIO pins. This is very basic scheme consisting of ten LEDs, which are controlled by python script, providing several effects for LEDs.

Wednesday, June 18, 2014

Setting up NFSv4

This is a short how to for setting up NFS version 4.

NFSv4 can handle several connections via one port (2049), this is much simpler to enable in firewall, than several ports for NFSv3. It has a bit different approach for how to setup exports.

Sunday, June 15, 2014

Replacing crontab with systemd timers

As of systemd version 212, you can use timers to schedule regular jobs. Systemd timers offer more functionality compared to crontab. See systemd.time for more details.

Saturday, June 14, 2014

Changing I/O Scheduler for HDD

If you are using SSD disk or you are running system from SD Card, it's a good practice to change kernel I/O schedulers for your HDD/Storage, to get better performance and better lifetime.

Thursday, June 12, 2014

New device

Recently I've bought odroid-u3 to play with. I has replaced my Raspberry PI, which is now free to become XBMC on my TV :)
It offers tremendously more CPU performance compared to Raspberry, so all services, mainly owncloud, are now pretty swift and responsible.
I'll post odroid posts in the Raspberry PI section.

Enigmail doesn't remember key password

I've been using enigmail for some time and it had one annoying bug, or perhaps this was caused by some misconfiguration in my system, each time I've tried to open an encrypted email a password prompt appeared.

Monday, June 9, 2014

SSL Termination with HA Proxy, session storing with memcached

This post describes updated architecture of loadbalancing-owncloud-with-ha-proxy. I use HA Proxy in version 1.5 now, which can do SSL termination and I use memcached for owncloud's sessions.

Monday, May 26, 2014

IGMP (SAP Stream) forwarding with iptables

In earlier post, I've shown how to setup internet connection sharing (ICS) with iptables. This is sufficient for standard services sharing, but it won't work for SAP Stream. If you want to setup multicast forwarding, you need to enable igmpproxy.

Thursday, May 22, 2014

Useful commands

This post summarizes few interesting and useful commands, some of them are from commandlinefu page.

Sunday, May 18, 2014

Replacing login manager with tty

This post describes how to disable login manager and use only tty to start desktop environment.
Also it shows how to create fancy image as welcome screen for tty login.

Wednesday, May 14, 2014

Setting up tor proxy

Tor is an anonymizing network, designed to enhance your privacy on internet. You can easily install an tor daemon and setup it as your proxy, to start private browsing. This post shows how to do this.

Saturday, May 3, 2014

Bash Specialities, part 3

This part shows examples for bash string manipulation: string matching and replacing, some substring operations and positional parameters operations.

Thursday, May 1, 2014

Loadbalancing owncloud with HA Proxy

This post shows more advanced loadbalancing for owncloud service. The primary concept is inspired by owncloud with dedicated php-fpm service post.
This architecture is more advanced and provides better scalability for load division and therefore better performance.
Performance is crucial factor for such a service providence and a single Raspberry Pi doesn't have much of it. This architecture (2 loadbalanced Raspberry Pi's) provides 33% performance increase and offers easily to connect more nodes.

Sunday, April 27, 2014

Custom i3-status bar and SLiM configuration

In this post, I'll show how to change theme and other configuration for SLiM login manager, how to setup conky to create customized i3-status bar and at the end I'll cleanup old unnecessary KDE packages, no longer needed in i3.

Tuesday, April 22, 2014

Bash Specialities, part 2

This post shows different examples of usage for file descriptors in bash and few interesting linux commands and features.

Thursday, April 10, 2014

Replacing KDE with i3 and basic i3wm setup

In this post I assume you have a standard KDE installation.
Following steps should guide you to replacing KDE's kdm with much faster and simpler SLiM login manager with i3 Desktop Environment. At the end my basic i3 configuration is shown.

Wednesday, April 9, 2014

Bash Specialities, part 1

This post shows some more or less frequently used features in bash, which might come handy in some situations.

Sunday, April 6, 2014

i3 window manager

Not long ago, I've switched from KDE window manager (kwin), which I've been using for years, to tiling window manager i3. So far I've tried several different WMs but none has suited my needs perfectly, until now.

What do I expect from window manager:
  • it should be highly customizable. It should provide ways to set keyboard and mouse shortcuts. In this way, kwin has been really great and that was the main reason I was using it.
  • it should be lightweight. This was the main issue, which kwin and KDE desktop had. On the other hand, i3wm with Slim is very simple and lightweight.
  • it should be fast. I don't say kwin was slow, but in comparison to i3, well, it is (:
  • eye-candy... yes good looking windows are sign of a modern WM, but for me eye-candy isn't very important.
In this section I'll post how I've replaced Kdm and kwin with Slim and i3 and I'll show my configuration of i3.

Saturday, April 5, 2014

Using caldav 0.2.1 with owncloud DAV services

New version caldav libraries was released recently. It didn't work from the scratch with my owncloud CalDAV. This post shows what I have changed to get it work.

Tuesday, April 1, 2014

ssh chroot jail

This post shows step by step how to create minimalistic ssh chroot jail. I use this for sharing files via scp/WinSCP.

Saturday, March 29, 2014

Disabling HDD Spindown

Recently I've noticed that my HDD stops and starts too frequently. Not only has this affect on performance (access time) but it has negative impact to it's lifetime. So I've turned off Advanced power management (APM) function.

Monday, March 17, 2014

Script for starting services and mouning filesystems

This script handles mounting of defined mountpoints and starts services via systemctl. I use it to start and mount all necessary services for my Raspberry PI.

Wednesday, March 12, 2014

Setting up fail2ban

Fail2ban is a program, that can prevent brute force attempts to your computer. Basically it counts failed login attempts and after given count is reached, it triggers an action, which usually is ban for IP address.

Thursday, January 23, 2014

Script for unmounting NFS mounts

I encountered an issue when shutting down or rebooting system with mounted NFS exports. It seems that systemd shuts down network service before all NFS mounts are unmounted and the system will hang, waiting for these mount points to be unmounted.
To prevent this, I've composed short script, which handles NFS unmounting before shutdown.

Friday, January 3, 2014

IRC notifications from remote server

Like many people, I use irssi client on remote server to connect to IRC chat. With tmux or GNU Screen you are able to be connected 24/7, and it would be great to be notified when someone is writing to you or has mentioned you on a channel.
Read more on how to setup such a scenario.

Thursday, January 2, 2014

Owncloud with dedicated php-fpm service

Owncloud on Raspberry PI is pretty slow. With Owncloud 6, takes the page loading from 20 to 60 seconds (this is much worse than with Owncloud 5). So there is an option to run php-fpm on other machine with more CPU power. Here is an howto to setup this scenario.