unix logo

I found that there are some people on GitHub that collect source codes from early UNIX ages, like first compilers, first shells, or PDP7-UNIX. Just to made them available in one place (slightly decentralize access to them) – I decided to create gitlab.com account `UNIX-history` for them.

You can find there source codes from 1970, nicely commented and manually formatted, before this all happened.

Also, enjoy this presentation about future of programming:

Sudo has an easter-egg that’s disabled by default. It can insult you each time you provide incorrect password. Just like that:

[sudo] password for agilob: 
You can't come in. Our tiger has got flu

[sudo] password for agilob: 
You do that again and see what happens...

[sudo] password for agilob: 
You can't get the wood, you know.

[sudo] password for agilob: 
Speak English you fool --- there are no subtitles in this scene.

[sudo] password for agilob: 
I think ... err ... I think ... I think I'll go home

[sudo] password for agilob: 
Where did you learn to type?

[sudo] password for agilob: 
stty: unknown mode: doofus

[sudo] password for agilob: 
Listen, burrito brains, I don't have time to listen to this trash.

[sudo] password for agilob: 
sudo: 3 incorrect password attempts

Continue reading

Script for Omnia Turris making your router light with random colour every second.

 

 

 

#!/bin/bash
 
colors=('red' 'blue' 'green' 'white');
leds=('lan0' 'lan1' 'lan2' 'lan3' 'lan4' 'pwr' 'wan' 'pci1' 'pci2' 'pci3' 'usr1' 'usr2');
 
while true; do
    for led in "${leds[@]}"
    do
        rand_color=$[$RANDOM % 5]
        rainbow ${led} ${colors[rand_color]}
    done
    sleep 1;
done

To get this quickly working:

  1. login on your Turris router
  2. wget https://gitlab.com/snippets/34184/raw -O random_rainbow.sh
  3. bash random_rainbow.sh &
  4. you can logout now, script will be working in background

In my spare time I develop applications on Android. I also “maintain” F-Droid repository for some of my public projects. I wanted to automatically publish each build after:

  1. Compilation passed
  2. Test on a connected device passed
  3. Signed build completed

So I made a simple setup with help of GitLabCI and own F-Droid repository. This post does not describe how to configure F-Droid repository or configuration of GItLabCI-runner, because official documentation is much better than I could write it. This post just describes how I use both services to automate boring deployment.

GtiLabCI is run on your own hardware, so it can have access to your files, configuration etc. It’s an advantage over Travis, as you can run any custom command, like testing on connected device or on pre-configured emulator, connected to remote hosts where CI slave is on a trusted machine.

Continue reading

I like to automate some boring and easy tasks we all have to do often, so I would like to share with you an easy but not too widely known trick in Debian/Ubuntu for automated upgrades, that can be performed without any manual actions.

This post describes the following configurations for a server:

  1. Installation and configuration of unattended upgrades on Debian
  2. Setup of Tor service that will be used for Debian upgrades
  3. Removal of unused dependencies

Unattended upgrades are well described on Debian wiki, but to keep those steps in one place, I’ll copy some parts of it here.

First, you have to install the following packages:

apt-get install unattended-upgrades apt-listchanges

Installation process should create new file /etc/apt/apt.conf.d/50unattended-upgrades where we configure how automated upgrades work and what can be upgraded.

Continue reading

I made a timelapse video using Raspberry Pi from my sea-front flat in Aberystwyth where I studied for 4 years.

Bash script was called every 30 seconds to take a picture for 4 days. To prevent running out of space on a SD card there was another cron job setup to move all existing images to my laptop using scp. After some selection (removed some first and some last images) I got 17.4GB of pictures which were composed into this timelapse without any scaling.

Timelapse from sea-front in Aberystwyth

…that’s why we published our product on OSI-compatible license! We <3 open-source!

Well, does Microsoft/Google/Apple/Netflix/XXX really love open-source?

No, they don’t. In fact they do more to extinguish open source by fighting them with patent wars, you don’t hear about, developing DRM, you hear about when it’s too late and dropping support for some key-products on open source platforms. Skype on Linux, anyone? Google Drive client on Linux? DRM enabled by default in browsers, anyone?

Continue reading

…that works in nginx:

add_header Content-Security-Policy
    "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' agilob.disqus.com disqus.com a.disquscdn.com referrer.disqus.com;
      img-src 'self' agilob.disqus.com disqus.com a.disquscdn.com referrer.disqus.com;
      style-src 'self' 'unsafe-inline' agilob.disqus.com disqus.com a.disquscdn.com referrer.disqus.com;
      font-src 'self';
      frame-src 'self' 'unsafe-inline' agilob.disqus.com disqus.com a.disquscdn.com referrer.disqus.com;
      object-src 'none'";

For a reason FreeBSD doesn’t support Qt5 build tools out of box. There are a few problems that have to be solved before you can run qmake && make to build a project. Firstly, my default setup didn’t have QMAKESPEC specified, add this line to your .bashrc/.zshrc:

export QMAKESPEC=freebsd-g++

Also add this line to specify Qt5 theme:

export QT_QPA_PLATFORMTHEME=qt5ct

Continue reading

I recently acquired “new” netbook, it’s so old that most people would call it ancient. Its CPU is only 32 bit architecture, it’s not capable of playing 2k videos in 30fps, its computing power is lesser than my ARM tablet, but it still works, so why not use it for something.

I got it from a friend who was using Fedora. It was slow, even with openbox. dnf update was taking from a few to several minutes, I had to install something faster. At first, Debian with LXDE. First installation attempt failed with some problem with GRUB, it wasn’t a good sign, I didn’t investigate the problem to get it working asap. I restarted bootloader installation with LILO which succeeded. Debian was still slow. Package installation was taking long, deb processing was taking long and I was sitting there and waiting for it to finish. Launching Firefox was taking even 30 seconds, videos on youtube were lagging even on 30fps. I really expected more from this 10 years old hardware. I decided to use it for my experiments and try something new. I decided to look at BSDs. OpenBSD would work here, it’s fast, secure and it like ideology behind it, but I don’t think it would work on semi-destkop netbook for me. I read about DragonFlyBSD and was impressed what creators did with kernel and distribution, wanted to give it a try, but they don’t support i386. There are two BSD distributions dedicated for desktop computers, DesktopBSD and PC-BSD, I didn’t know with which one to go, so I took FreeBSD, they provide i386 memstick installer, so it was easy since beginning, or at least it was specific which image should be used.

Continue reading