Inane Observations $ sudo fix_it
  • Customising Pretix defaults with a plugin

    04 September 2020 | pretix programming guide | Comment

    Pretix is an open source ticket sales platform with a self-hosted ‘Community’ edition. Pretix is highly versatile, and features a plugin system making it highly customisable, and the API is fairly well-documented. However, complete examples of how exactly to use the API to accomplish certain… »

  • Snippet: Converting SVG with embedded CSS fonts to PDF

    13 June 2019 (updated 29 March 2025) | guide | Comment

    This is a snippet of Python code that can be used as a framework for converting SVG files with embedded CSS fonts (@font-face) to PDF, maintaining the font embedding.

    import base64
    import os
    import re
    import subprocess
    import uuid
    
    #from fontTools.ttLib import TTFont
    … »
  • Guide: cURL in an initramfs environment (with HTTPS and DNS)

    05 June 2019 (updated 05 June 2019) | guide linux | Comment

    I recently found myself wishing to be able to remotely unlock my LUKS partitions on (re)boot. The Arch Linux wiki has some information on this, but this was not sufficient for my case, as my network assigns dynamic IP addresses, which I normally push to… »

  • Guide: Magisk root and (Ed)Xposed using official releases on the Xiaomi Mi A2 (Android 9.0)

    24 January 2019 (updated 17 June 2019) | android superuser guide | Comment

    This is a guide on rooting the Xiaomi Mi A2 using Magisk and installing Xposed via EdXposed for Android Pie 9.0, using the official releases.

    Unlocking the bootloader

    Firstly we need to unlock the bootloader to allow us to flash new images. Go to Settings… »

  • Open with Emacs in same window, and open as root: emacsclients scripts and .desktop files

    24 October 2018 | guide emacs | Comment

    Open with Emacs in same window

    /usr/local/bin/myemacs:

    #!/bin/bash
    
    # how many emacs?
    NUM_EMACS=$(emacsclient -e "(length (frame-list))" -a "")
    
    if [ $NUM_EMACS -le 1 ]; then
    	emacsclient -c -e "(progn (select-frame-set-input-focus (selected-frame)) (find-file \"$@\"))"
    else
    	emacsclient -e "(progn
    … »
  • Hacking the Kobo Clara HD – 5: Setting up SSH

    30 July 2018 | guide kobo clara hd ereader ebook | Comment

    Last time, we set up telnet on the Clara HD and set up the USB network interface. Now we will extend this to enable SSH on the device.

    Unfortunately, unlike telnet, the Clara HD does not ship with any SSH binaries, so we will… »

  • Hacking the Kobo Clara HD – 4.3: Automatically switching between USB networking and file transfer

    30 July 2018 | guide kobo clara hd ereader ebook | Comment

    Last time, we set up the Clara HD to automatically start USB networking when connected. We will now set it up to automatically stop USB networking when file transfer mode is activated in the main interface.

    Much like ac and plug, /usr/local/Kobo/udev/usb is… »

  • Hacking the Kobo Clara HD – 4.2: Automatically starting telnet over USB on connect

    30 July 2018 | guide kobo clara hd ereader ebook | Comment

    Last time, we set up networking over USB on the Clara HD, but this required us to manually start and stop the network. We will now configure the Clara HD to automatically start USB networking when connected over USB.

    The Clara HD uses udev… »

  • Hacking the Kobo Clara HD – 4.1: Telnet over USB

    30 July 2018 | guide kobo clara hd ereader ebook | Comment

    Last time, we gained root telnet access to the Clara HD over WiFi; however, the connection can be quite temperamental. We will now use this to set up a network connection over USB, allowing for telnet access over a secure USB channel.

    Set up

    … »
  • Hacking the Kobo Clara HD – 3: Gaining root telnet access

    30 July 2018 (updated 18 February 2021) | guide kobo clara hd ereader ebook | Comment

    Last time, we dipped our toes into the waters of the Kobo Clara HD's USB interface. As it turns out, there is a lot more we can do with this simple interface. The Clara HD runs Linux, and we can easily gain root telnet… »

  • Hacking the Kobo Clara HD – 2: Bypassing registration/sign in

    30 July 2018 | guide kobo clara hd ereader ebook | Comment

    Last time, we imaged the internal storage of the Kobo Clara HD (and possibly expanded the internal storage capacity). Now we can begin setting up the device. We soon find, however, that the Clara HD requires us to log in with a Kobo account.… »

  • Hacking the Kobo Clara HD – 1: Hacking the internal microSD storage

    29 July 2018 | guide kobo clara hd ereader ebook | Comment

    Introduction

    The Kobo Clara HD is the latest e-reader from Canadian ebook vendor Rakuten Kobo, sporting a 6-inch 300 ppi e-ink touchscreen, and 8 GB of internal memory.

    The Clara HD, like its predecessors in the Kobo range, internally runs Linux, and is surprisingly amenable… »

  • Guide: Using Okta Verify with third-party TOTP (Google Authenticator, FreeOTP, etc.)

    19 July 2018 | guide totp 2fa mfa | Comment

    Okta is an identity management and single sign-on cloud provider. Okta supports multi-factor authentication through multiple mechanisms, but at my site, only the proprietary Okta Verify smartphone app was supported.

    Thankfully, Okta Verify operates via the ‘industry standard Time-Based, One-Time Password Algorithm (TOTP)’,… »

  • LibreOffice custom “Set numbering”/“Restart numbering from” macro

    20 May 2018 | guide libreoffice openoffice basic opendocument numbering | Comment
    Sub RestartNumbering
    	Dim cursor   As Object
    	cursor = ThisComponent.CurrentController.ViewCursor
    	
    	Dim startFrom As Integer
    	startFrom = CInt(InputBox("Restart numbering from:"))
    	
    	cursor.NumberingStartValue = startFrom
    End Sub
    
  • GIF scrolling text marquee with ImageMagick (or: DIY X'trapolis PIDs)

    12 May 2018 | guide gif animation marquee scroll imagemagick linux | Comment

    Example scrolling GIF

    #!/bin/bash
    
    IMWIDTH=336
    IMHEIGHT=24
    STEP=2 #pixels per frame
    FRAMERATE=50 #frames per second
    
    OUTPUT="scroll.gif"
    FONT_PATH=/usr/share/fonts/TTF/LiberationSans-Bold.ttf
    
    MESSAGE="Hello World!"
    
    BACKGROUND="#000000"
    FILL="#ff9c10"
    
    # Make a "unique" prefix for this run
    PREFIX=
    … »
  • GUIDE: A DIY dynamic DNS server for Linux with BIND

    18 April 2017 (updated 30 January 2018) | guide linux dns bind nsupdate | Comment

    With last month seeing a 100% increase in the number of computers I own, I found it useful to be able to determine the IP address of my various devices, with a lightweight Linux-compatible solution. My initial solution was to use Syncthing and interface with… »

  • Guide: Launching EmulationStation/RetroPie from within Kodi on Raspbian (The XBone, part 2)

    22 December 2016 | guide linux raspberry pi kodi xbmc retropie emulationstation retroarch xbone | Comment

    So you've got your Raspberry Pi to display a glorious ‘XBone’ splash screen, but what kind of bone would it be if it couldn't play games? Kodi looks kind of like a console UI, and with RetroPie, we can launch games, but how… »

  • Guide: A custom splash screen on the Raspberry Pi, for Raspbian Jessie (The XBone, part 1)

    21 December 2016 (updated 22 December 2016) | guide linux raspberry pi xbone | Comment

    There are many guides on the internet for creating a custom splash screen on Linux, but most for Raspbian are based on SysV init, and don't interface well with systemd, which is now used by Raspbian. Those that do support systemd make use of Plymouth… »

  • GUIDE: Convert SWFs to PDFs, preserving text as text, with gfx2gfx-pdftext

    24 November 2016 (updated 05 February 2021) | guide ebook | Comment

    Introducing gfx2gfx-pdftext, a fork of gfx2gfx designed to convert SWF files to PDF files, while preserving text! I am not aware of any other freely-available tools that can do this.

    The original gfx2gfx from SWFTools unfortunately converts text to paths. An improvement on… »

  • Random Question Generator on Anki using JavaScript

    15 March 2015 (updated 17 October 2016) | guide anki javascript | Comment

    Updated 2016-10-17 to work with AnkiDroid!

    Introduction

    Anki is brilliant. It has really lived up to its motto ‘Remember Anything, Remember Anywhere, Remember Efficiently’ for being my go-to way to remember notes and other information. This is made all the more powerful through its HTML-based… »

  • FIX: Steam crashes when using radeon driver

    12 June 2014 | ati arch linux defense of the ancients error amd guide linux steam gaming dota | Comment

    Symptoms

    Steam crashes upon opening, after verifying the installation and before opening the main interface, with something about the OpenGL context not supporting direct rendering. Soon afterwards, the X server crashes. (I'm not crashing my computer again just to find the exact error message, thank… »
  • FIX: LoL errors on (PlayOn) Linux

    31 March 2014 | error guide linux league of legends lol wine gaming | Comment

    Problem

    ‘The game has crashed. Please try to reconnect.’ immediately after champion select.

    Solution

    Open /etc/hosts on the host computer in the text editor of your choice.
    On the line that resembles:
    127.0.0.1   localhost.localdomain   localhost
    add the name of your computer (found in /etc/hostname). For example:… »
  • GUIDE: Convert book-style SWFs to PDFs with gfx2gfx

    03 February 2014 (updated 24 November 2016) | guide ebook | Comment

    Hold it right there!

    It's been nearly three years since this post, and in those three years, I found the time to write 177 lines of code. Now, with my fork, gfx2gfx-pdftext, you can convert SWFs to PDFs, while preserving the text, resulting in… »

  • GUIDE: Easier League of Legends Installation Using PlayOnLinux

    06 January 2014 | arch linux guide linux league of legends lol gaming | Comment

    Preamble

    PlayOnLinux is a brilliant wrapper for WINE, allowing for the easy installation of innumerable Windows programs on Linux. Of these, my most recent install was League of Legends, which, of course, does not have a native Linux release. PlayOnLinux installs and runs it… »
  • Adventures in Arch: Part 2 - Is It Working Yet?

    03 January 2014 | misc arch linux error rant intel amd guide linux hybrid graphics | Comment

    Let's Get Some Hybrid Graphics Up In Here!

    if [ ! -f /etc/X11/xorg.conf ]; then
    sudo cp /etc/X11/xorg.conf.fglrx /etc/X11/xorg.conf
    fi
    startx /usr/bin/openbox-session -- :1
    How simple was that? And my script for starting X on my integrated card is about the same (only using XFCE,… »
  • GUIDE: Exporting Encrypted bitcoin-qt Wallets into MultiBit

    24 November 2013 | bitcoin windows guide linux btc java mac | Comment

    Introduction

    Bitcoin is awesome. Unfortunately, migrating between Bitcoin clients is not. It's especially annoying when the recommended method of exporting with pywallet, importing into BlockChain.info, exporting as an aes.json and importing into MultiBit is 1) incredibly confusing and 2) doesn't actually work.
    So, here… »
  • GUIDE: Dota 2 Dedicated Server on Linux (from Scratch)

    10 October 2013 | defense of the ancients guide linux steam wine gaming dota | Comment
    Note: it is now possible to run a Dota 2 dedicated server on Linux without WINE. This article is kept purely for archival purposes, though it should still work.

    It is entirely possible to, using the Windows Alien Swarm SRCDS and WINE, run a Dedicated… »
  • GUIDE: Directly Executable JAR File

    18 August 2013 | guide linux java | Comment

    Java is great, but having to type java -jar program.jar gets annoying. Why can't you run it like any other program, with ./program.jar? Well, you can, and it's incredibly simple!

    echo '#!/usr/bin/java -jar' | cat - Program.jar>Program
    chmod +x Program

    Tada! That's it! Program.jar… »

  • GUIDE: Restoring Windows Vista/7 backup files under Linux

    18 July 2013 | backup windows guide linux | Comment

    If you've recently upgraded from Windows to Linux but now need to restore the backup files you made with Windows Backup (or need to restore someone else's), you've come to the right place!

    The Windows Backup Format

    Unlike the Windows NT BKF backup format, the… »
  • GUIDE: Downloading MMS/RTSP/HTTP/etc streams with VLC

    15 July 2013 | youtube windows guide linux stream video mac | Comment

    We all know that if you use YouTube, you can download the video from Keepvid or something. But what if your content provider uses some crazy streaming system? For example, one website (which shall remain nameless) that I use uses MMS to serve videos.

    Disclaimer

    … »
  • GUIDE: Kdenlive on Windows, Properly!

    13 June 2013 | cygwin video editing windows guide kdenlive linux kde | Comment

    Introduction

    So, you want to install and use Kdenlive on M$ Windows, but don't want to do all that crazy Live-CD sh*t (probably because that's not technically doing it in Windows)?

    Well, you've come to the right place (website, whatever)!

    This guide will show you… »
  • GUIDE: ‘Stereo Mix’ without PulseAudio

    20 April 2013 | audio guide linux | Comment
    [Cut to the chase]

    Introduction

    So I recently upgraded (yes, upgraded) from Windows to Linux a while ago, right, and now I want to record my gaming the way DXtory let me (except for free, of course).

    So a quick bit of Googling revealed that… »
  • Home
  • Git (Archives: GitLab, GitHub)
  • Research
  • Music
  • Posts
    • December 2024 (2)
    • November 2024 (2)
    • September 2024 (2)
    • August 2024 (1)
    • June 2024 (2)
    • More…
  • Tags
    • medicine (25)
    • copyright (20)
    • opentally (20)
    • drm (19)
    • encryption (12)
    • monash (12)
    • mathematics (11)
    • statistics (10)
    • proportional representation (8)
    • victoria (8)
    • law (7)
    • meeting procedure (7)
    • ptv (7)
    • public transport (7)
    • rust (7)
    • defective by design (6)
    • digital rights management (6)
    • python (5)
    • creative commons (4)
    • webassembly (4)
    • metro trains (3)
    • paediatrics (3)
    • politics (3)
    • 2fa (2)
    • mfa (2)
    • victorian electoral commission (2)
    • android (5)
    • security (18)
    • cryptography (12)
    • programming (12)
    • voting systems (8)
    • med in review (11)
    • music (10)
    • parliamentary procedure (7)
    • totp (2)
    • reverse engineering (20)
    • obfuscation (12)
    • single transferable vote (19)
    • ebook (16)
    • elections (12)
    • java (6)
    • linux (31)
  • Lee Yingtong Li
  • blog@yingtongli.me
  • My CV · CV of Failures
@RunasSudo

Most material on this website is available under an open licence. See https://yingtongli.me/blog/copyright.html for details.