ix5 tech

Technology section • ix5.org

Customizing Isso for my needs

January 19, 2021

Some functionality that is not (yet) available with upstream Isso. All features mentioned in this post are available on this frozen branch. I run a local development server using the following command: ISSO_SETTINGS=share/isso-dev.conf \ venv-isso/bin/gunicorn \ -b 0.0.0.0:8080 \ -w 1 \ --preload isso.run \ --worker-tmp-dir /dev/shm Thanks button - A small button with a counter to simply say “Thanks” instead of posting a comment. Has been suggested upstream but so far no one attempted the work.

Skype for Linux - Disable autostart

January 8, 2021

TL;DR Insert "app.autoStartEnabled":false into ~/.config/skypeforlinux/settings.json. See also my answer at askubuntu.com. Intro The native Skype app for Linux - I guess I should be thankful there even is one - auto-starts itself on boot1, and there is no way to turn off that behaviour as a guest because the Settings pane can only be accessed by logged-in users. Auto-start works on Linux desktops works by inserting a .desktop file in a config folder, so Skype’s is at ~/.config/autostart/skypeforlinux.desktop. Even if you delete the file, Skype just re-creates it every time it launches. You could just empty and then chmod a-w the desktop file, but that’s lame and Skype might change their auto-start behaviour in the future using systemd units or some other shenanigans; it’s always whack-a-mole since Skype’s business interest lies in having its app always present to create “engagement”.

flask-admin: Access row object in LinkRowAction

January 4, 2021

I have an admin interface with tags that can be associated with any number of entries. As a demonstration, flaskadmintagdemo should give you an idea of what my side looks like. I wanted to have a link next to each tag pointing to a filtered list of all entries tagged with that specific tag. The logic for that is in flask-admin > model > template.py class LinkRowAction(BaseListRowAction): def render(self, context, row_id, row): m = self._resolve_symbol(context, 'row_actions.link') # string_types = (str, unicode) if isinstance(self.url, string_types): url = self.url.format(row_id=row_id) else: url = self.url(self, row_id, row) return m(self, url) So, we need to amend the column_extra_row_actions to add a LinkRowAction that points to the filtered listing of entries:

Adding DuckDuckGo properly to Firefox

January 3, 2021

Needed to re-add DuckDuckGo search to Firefox manually. Install Add-on Install Add custom search engine addon from addons.mozilla.org. Get search parameters Navigate to DuckDuckGo.com, enter the Settings page, click “Show Bookmarklet and Settings Data”, copy the “Bookmarklet URL”. For me, it looks like: duckduckgo.com/?kah=de… Enter info in addon Open the interface to add a new search engine by locating the blue looking glass icon in the menu bar (Not in Firefox Settings! It is an addon with its own interface).

Git tricks

February 27, 2019

Tips From twitter.com/zeuxcg git rebase —autostash stashes and unstashes local changes for you git commit -v adds diffs to commit draft so that you can inspect them as you write commit msg git rebase -i Also, you should configure autostash to be on by default, and configure rebase to be default on pull. Pull without -r will screw you every time! You probably know already but commit messages allow to autosquash commits. fixup! <hash>, squash! <hash> Works best with git rebase —interactive —autostash —autosquash or simply git commit --fixup <hash> (or git commit --squash <hash>) … easier than typing the relevant commit msgs.

Bash

February 26, 2019

getopt my-function() { # This is important for getopt or it will fail on the second invocation! local OPTIND while getopts 'u:b:s:' _flag do echo "_flag=$_flag" case "${_flag}" in u) GIT_URL="$OPTARG" ;; b) GIT_BRANCH="-b $OPTARG" ;; s) SPEC+="$OPTARG " ;; *) echo "my-function(): Unexpected option $_flag"; exit 1; ;; esac done }

Ubuntu install

May 29, 2018

Disclaimer: This is for personal reference, read up on the official documentation before you brick something you did not want bricked… Create disk sudo dd if=distro.iso of=/dev/sdX status_progress bs=1M Boot live cd Set keymap, then prepare disks (If in virtualbox, make sure to activate EFI mode) Partition drive Use lsblk or blkid, fdisk -l to get an overview of the current situation, then create GPT table and partitions with: sgdisk --zap-all /dev/sdX sgdisk --clear \ --new=1:0:+550MiB --typecode=1:ef00 --change-name=1:EFI \ --new=2:0:0 --typecode=2:8300 --change-name=2:system \ /dev/sdX Or use cgdisk which is nice and interactive.

Arch install

April 29, 2018

Create disk sudo dd if=distro.iso of=/dev/sdX status_progress bs=1M Boot arch Better connect ethernet, else use wifi-menu loadkeys de-latin1 Partition drive Use lsblk or blkid, fdisk -l to get an overview of the current situation sgdisk --zap-all /dev/sdX sgdisk --clear \ --new=1:0:+550MiB --typecode=1:ef00 --change-name=1:EFI \ --new=2:0:0 --typecode=2:8300 --change-name=2:system \ /dev/sdX Or use cgdisk which is nice and interactive mkfs.fat -F32 -n EFI /dev/disK/by-partlabel/EFI Cryptsetup cryptsetup luksFormat /dev/sda2 --key-size 512 --iter-time 2000 [--align-payload=8192 -h sha512 -c aus-xts-plain64] cryptsetup luksOpen /dev/sda2 cryptroot mkfs.btrfs --force --label system /dev/mapper/cryptroot Then create btrfs filesystems, optionally with subvolumes

Rhythmbox

February 9, 2017

Remove clutter from database Install lxml (apt-get install python-lxml) Download removehidden.py and removeignored.py. Copy rhythmdb.xml over from ~/.local/share/rhythmbox into working directory Run either script to remove hidden or ignored entries respectively Copy rhythmdb_new.xml back to the rhythmbox directory Plugins MediaServer2 D-Bus interface (included by default in 3.x) MPRIS D-Bus interface (included by default in 3.x) Rating filters Open containing folder

Brother DCP-L2520DW

August 1, 2016

Download files from the brother printer support page. Use either the install tool(will complain about missing ia32-libs but works fine) or install the packages manually. Assign a static ip address to the device and add the printer with CUPS. The device should appear with proper name and abilities. Do not install the generic packages(named ‘Generic LPR printer driver, Generic CUPSwrapper printer driver’). (for Arch Linux: Install brscan4 from AUR) For scanning functionality, use brsaneconfig4. Run brsaneconfig4 -q and confirm that the line 39 "DCP-L2520DW" appears. Then run brsaneconfig4 -a name='Friendly Name' model='DCP-L2520DW' ip=192.168... Or use nodename=printerhostname where printerhostname might be something like BRWxxxxxxxx.fritz.box, use nmap -sn to find out. Use simple-scan and select the device, then run a test scan. DPI can be set to up to 2400.