Category Archives: Software

Download an installation medium directly to your flash drive


For a longer time I was looking for a more direct and faster method to setup my Linux installation medium on an USB flash drive. Usally one would download an ISO image and wait for it to finish before copying to the drive. Both tasks could take some time, depending on your internet connection and USB speed.
Considering you’ll doing both at the same time, downloading and writing the image, you could save half the time. It took a while for me to figure out, that one of my favorite downloading tools for the command line, Aria2, could do exactly this job. It will download your file, supporting different protocols (sftp, https, bittorrent), and write it directly to any block device.
Of course not every installation image could be written directly without any modifications and thus will be bootable, but my favorite Linux distributions support this feature (e.g. ArchLinux, Ubuntu).
In this example, we’re going to download the most recent Archlinux iso using a Bittorrent magnet link (get the newest magnet link from here). Further we select only the iso-file in the torrent and write it to our flash drive at /dev/sdc:
aria2c "magnet:?xt=urn:btih:2d3b3d65b369ba519292dd8ce420afe95120df1e&dn=archlinux-2018.01.01-x86_64.iso&tr=udp://tracker.archlinux.org:6969&tr=http://tracker.archlinux.org:6969/announce" --select-file=1 --index-out=1=sdc --dir /dev --allow-overwrite=true --file-allocation=none --save-session=/tmp/tmp.aria2
We can also download a “*.torrent”-file to memory and start downloading it’s contents:
aria2c "http://torrent.ubuntu.com/xubuntu/releases/bionic/release/desktop/xubuntu-18.04-desktop-amd64.iso.torrent" --select-file=1 --index-out=1=sdc --dir /dev --allow-overwrite=true --file-allocation=none --save-session=/tmp/tmp.aria2 --follow-torrent=mem
Caution: Running this code with root is dangerous when you’re unsure about the destination path of your block device. You could easly overwrite, for example, your system partition, brick your system or lose important data!

Aria2 will start downloading the installation medium and write it directly to your installation medium :) The cool thing is, as long as you keep Aria2 open and your flash drive inserted, the iso will still be seeded from your device.

Stopwatch module for py3status

Whenever you use a tiled window manager like Dwm, Awesome or i3 on your linux desktop, you might also want to replace or modify the default behaviour of the status bar. Usually you’ll display some common information like date, battery level or informations about your network connection.

Compared to the quasi standard program i3status, you can also use py3status as an external program to generate the status bar text. It has even more modules you can use to display additional statistics or functions. One thing I was missing, was the ability to easily track time so I modified the included timer module and transformed it into a stopwatch.

You can run or pause the stopwatch with a left click and reset it with a right mouse click. That’s all … very easy but also very useful ;) You can check out the source code here or just wait until module gets upstream.

Open source powered GNU Casino slot machine

For our private party some weeks ago we prepared a fun slot machine in the spirit of GNU open source software (I’m aware that this might sound contradictory). We already had an old internet cafe terminal but had to change the internal hardware to more recent components. Then we were ready to install a most basic ArchLinux system and configured it to launch X and our PyGame application at startup.

A real slot machine needs some fancy colored buzzers for authentic gamble feeling. So we developed some in Blender and 3d printed them. They are wired to a tiny USB-Arduino and on key press, they will trigger generic key press events on the system.

 

Since we haven’t been able to get the “coin entry” machine working, we checked the credit with a barcode scanner which was further connected to our party payment system :)

Here’s a demo video:

And here you can get our unenhanced, hacky source code. Note that we removed all original sounds and graphics to avoid copyright infringement.

Update (December 2017): We are proud to note that our project got featured on the front page of Heise Online, one of the leading technology news sites in Germany. In addition to the online publication, an even longer article was printed in the C’t Make magazine of 6/2017 (page 104-105).

Easily setup a native instance of Onlyoffice documentserver on ArchLinux

For quite a time I was looking into an online office solution, espacially as an integration into my existing Nextcloud service. At first, there was a lot of publicity for the teamup of Collabora Online together with Nextcloud. It’s a more complex solution, which includes a LibreOffice backend and a LeafletJS frontend. On the one hand, I was impressed how feature rich and stable this first experimental version was but on the other hand, the demo instance was also a bit slow and laggy. Further I was unable to get the Docker image up and running on my own server. I always had connection and routing issues, which of course could be caused by my own custom server setup, but Docker made debugging quite difficult for me.

Onlyoffice documentserver Nextcloud integration

Onlyoffice documentserver was a real performance boost in online office editing compared to Collabora Online. I was able to create complex “Power Point” presentations and larger documents for my studies much faster, nearly as good as provided by Google Docs. I only had to install the Onlyoffice app for Nextcloud and find a public available Documentserver instance (the domain doc.onlyoffice.com worked for a while but with a little work you can also find other instances via Google). After that I could easily open any office document directly in Nextcloud.

Create power point presentations directly in Nextcloud

Collaborative editing of publicly shared documents is also planned feature.

Setup an own Documentserver instance

Since I also had no luck with the docker image provided by Onlyoffice, I decided to compile it from source and deploy it manually. Public available documentation on how to do this was sparse but a good start was the offical documentation. After some weeks of tweaking and patching the sources, I was able to create a working PKGBUILD for the ArchLinux AUR. This means, everything you need to do is a simple:

pacaur -S onlyoffice-documentserver

and the Documentserver is ready to go! You can find a more detailed setup instruction in the ArchLinux Wiki. Installing and configuring Redis, Postgresql, RabbitMQ and Nginx, which all are required dependencies, is easy and straightforward. Further assumed you also have a working domain and SSL setup, you can start using the document server in Nextcloud, providing the URL in the application’s preferences.

Onlyoffice Nextcloud app configuration

Alternative and extensive use cases

There are code examples available for all kind of popular programming languages in which you can embed and include the Onlyoffice document editor. If you just want to see the document editor in action, visit this demo page.

Pishare – Erster öffentlicher Webtorrent Index

Fasziniert von der Möglichkeit, sozusagen P2P Dateien von einem Browser zum anderen Browser zu transferieren, habe Ich mich vor kurzem umgeschaut, was es in dieser Hinsicht schon für Anwendungen und Implementierungen gibt. Webtorrent hat sich dabei als eine der am weitesten entwickelsten Bibliotheken herausgestellt, die direkt im Browser via Javascript verwendet werden kann, sowie auch in NodeJS-Applikationen.

Webtorrent tut genau das, was es verspricht: Eingebunden in eine hübsche graphische Oberfläche, kann eine lokale Datei ausgewählt und mit ein paar wenigen und einfachen Javascript Funktionen indexiert und geseedet werden. Die Datei wird dabei nur gehashed und bei verschiedenen, öffentlichen Webtorrent-Trackern eingetragen, sodass später andere Webtorrent-Peers unter Verwendung eines Magnet-Links die Datei wieder ausfindig machen können.

Was sich mit Webtorrent und dessen Verwendung von WebRTC auf Protokollebene in Zukunft alles bewerkstelligen lässt, ist noch nicht abzusehen. Gerade im OpenSource-Bereich ist die Anzahl von Projekten, die davon gebrauch machen, noch sehr übersichtlich. Als Demo-Anwendung habe Ich mal eine Seite namens PiShare erstellt, eine Art Torrent-Indexer für Webtorrent-Dateien. Die Demo macht schon deutlich, wie einfach und schnell eine Datei publiziert und binnen kürzerster Zeit zwischen zahlriechen Peers verteilt werden kann, ohne dass eine extra Software dafür installiert werden muss.

Der Sourcecode zu dem Projekt findet man hier.