In my spare time, I have created some (hopefully) handy scripts and styles:
A slimmed down StackExchange
To get rid of the distracting side bar on some of the StackExchange sites, I have created the StackWatchers user style. This also improves the reading experience on narrow windows.
Better UX with NxFilter
To have a better visual distinction for blocked requests by the DNS filtering tool NxFilter, I have created NxFilterColorizer, a user script that colorizes the table row depending on the block indicator text. It also applies a CSS class that allows further styling with a user style.
Global wait indicator
Having a wait indicator is often useful. The waitin.user.js script gives you a global wait indicator for any website at once. (This is in ALPHA state, use with caution).
It served me well over all these years, both with Windows and Ubuntu Linux. But, getting tired of replacing empty or clogged ink cartridges all too often I considered buying a laser printer. I chose the Samsung Xpress C480W A4 Color Laser Printer.
Installing a printer on Linux – a nightmare. Or is it?
Not with this one, I can say. The “Easy printer installation” does not promise too much. Here’s what it took me:
Attach the printer to the mains and the local LAN. Switch it on.
Download the appropriate driver package from the Samsung setup page with the Linux box. The website presents the Linux driver package (probably guessed from the User Agent string) right away.
Extract the package.
Run sudo ./install.sh
Accept the EULA (This is the most inconvenient part as you are required to accept it line by line…)
Install the printer using the Ubuntu printer Dialog. It will automatically get recognized on the network.
Done. Feel the relief and joy of printing and scanning using your favorite OS.
Here’s how my first test page looks – scanned with the same printer again. 🙂
One of my sons recently received this fine, Infrared (IR) remote controlled crane model as a gift. Would it be possible to rebuild the IR remote control with a Raspberry Pi?
Catching the signal
To build the IR-Transmitter I used the well-known LIRC library and this small IR receiver sensor from Adafruit. For emitting back the IR I just recycled an IR-Diode from an old JVC remote control unit and directly attached it to one of the GPIO ports the Raspberry Pi.
The Playmobil crane remote control seems to use none of the standard protocols like NEC or MD-5. It also has a long sequence, as the output of the raw recording shows.
sudo /etc/init.d/lirc stop
mode2 -d /dev/lirc0
The “Left Turn” button, when using channel “D”, gives:
A quick analysis using a spreadsheet and a bar chart shows some interesting features. See below. The y-axis shows the numbers from the raw output as values.
There are 13 blocks, of which the later 12 are similar. A test showed that the signal consists of a first, single action code, followed by a repeated stop or terminating code. The clock seems to be at a value of about 473, which is the average duration for a pulse of basic width.
Getting a working lircd.conf file
Now the tricky part was creating the lircd.conf file with the irrecord application. The tool resorted to record what it calls a raw format. By following the on-screen instructions, I managed to get a working file, however, only with the action codes for each direction. I then manually created a stop code and added that to the end of the file.
# Stop lirc to free up /dev/lirc0
sudo /etc/init.d/lirc stop
# Get the configuration file from sourceforge
wget -qO- -O large-crane.lircd.conf 'https://sourceforge.net/p/lirc-remotes/code/ci/c1a9403dec74d2b3d90ff507d63a1cd7d8aa6a3b/tree/remotes/playmobil/large-crane.lircd.conf?format=raw'
# Make a backup of the original lircd.conf file
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf
# Copy over your new configuration file
sudo cp large-crane.lircd.conf /etc/lirc/lircd.conf
# Start up lirc again
sudo /etc/init.d/lirc start
# Show the available codes
irsend LIST "playmobil" ""
# Get the bash control script for easy keyboard control
wget -qO- -O tmp.zip 'https://qrys.ch/wp-content/uploads/2016/01/cranecontrol.sh_.zip' && unzip -o tmp.zip && rm tmp.zip
# Start the control script
NxFilter is the best free solution for a self-hosted DNS server/filter I have found so far. Today I got my Raspberry Pi, so how about running NxFilter on a headless Raspberry Pi in a family’s home network?
The current version of Raspbian, the default Debian-based Operating System for the Raspberry Pi already comes with all required packages (Java, unzip, wget)