Skip to main content


A lunch roulette algorithm in R

The purpose of the algorithm described here is to randomly create pairs from a list of people to go out for lunch. As an input, this algorithm needs a list of people created as shown below and saved to a file called people.csv , in UTF-8 format. j,Jill Valentine,1 j,007,1 t,Tony Stark,2 d,Solid Snake,1 h,Hannibal Lecter,0 l,Lara Croft,2 d,Daenerys Targaryen,1 w,Heisenberg,1 Each line in this file should contain an email address, a name, and a code that should be set to 0, 1 or 2. Code 0 means ignored, so only people with codes 1 or 2 are considered when creating new pairs. In case of an odd number of people with codes 1 or 2, 1 randomly selected person with code 2 is discarded. In order to not have to worry about odd numbers, it is best to always have at least 1 person with code 2. Also important to k

Creating a low-power, secure torrent box based on a Raspberry Pi 3 Model A+, Samba, Deluge and PIA OpenVPN

Install the Raspberry Pi OS Lite 64-bit (2022-04-04) to a SanDisk Ultra 200 GB micro SD card. Create a new file called wpa_supplicant.conf in the root of the first partition of the micro SD card and add the text shown below. Adjust the ssid and psk as needed. ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=SE network={ ssid="NAME" psk="PASSWORD" } In the same directory, create a new file called userconf and add the text shown below. pi:$6$oLZglrx6toCFaoR/$06EmZ9/BN2tAjU5kbuxUxU6W.se66etapF0b9bftdw/LDd1yncSDhWPM2eZCOIEgH1iAn4ygozxNPbHc3Easg1 Still in the same directory, create an empty file called ssh . In the second partition, open the files hostname and hosts in the directory /etc/ and replace raspberrypi by micro (the new hostname). Comment all the lines related to IPv6. In the same directory, add the line net.ipv6.conf.all.disable_ipv6 = 1 at the end of the file sysctl.conf . Still in the same dire

Creating a compact, low-power, Linux-based file server

My requirements for this system: Fully compatible with Linux (in particular, Arch Linux) Silent (in particular, fanless) Low-power Compact and beautiful Hardware Motherboard: ASRock Q1900DC-ITX RAM: Kingston KVR16LS11/8 (2) Disks: Kingston SV300S37A/240G (1), Western Digital WD10JFCX (2) Case: Streacom F1CWS Evo Power adapter: Targus APA042EU My main reasons for selecting this particular motherboard were the low power consumption, convenience of a decent integrated CPU (Intel J1900), fanless design, Mini-ITX form factor, and complete compatibility with Linux. Other features, also relevant: 4 SATA connectors (2.0 and 3.0), plenty of USB ports (2.0 and 3.0), several graphics outputs (HDMI, DVI-D and D-Sub, all up to a resolution of 1920 by 1200 at 60Hz), and an integrated power supply unit which accepts any voltage between 9 and 19V, ±10%. An additional interesting detail is that this motherboard supports Wake-on-LAN. In terms of RAM, I used 2 8GB DDR3L modules, result