ix5 tech

Technology section • ix5.org

Netgear R6120 OpenWRT

February 16, 2021

Links Netgear R6120 OpenWRT page Firmware download nmrpflash Get nmrpflash $ git clone https://github.com/jclehner/nmrpflash.git $ cd nmrpflash/ $ make Check interfaces ./nmrpflash -L enp0s31f6 192.168.1.8 8c:16:45:22:f5:71 wlp2s0 192.168.1.6 74:e5:f9:e7:79:26 For me, enp0s31f6 showed 0.0.0.0 as IP: enp0s31f6 0.0.0.0.0 8c:16:45:22:f5:71 Flash Plug LAN cable from computer into LAN port 1 of the router. NOT into the WAN port. Turn off router. $ sudo ./nmrpflash -i enp0s31f6 -f ~/downloads/netgear-openwrt/factory/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img Waiting for physical connection.

Languages

February 7, 2021

For reasons that (I swear!) have nothing to do with my nationality, I have always avoided acquiring any modicum of French language skills. I took Latin in high school and while at university, Spanish sounded like the clearly superior investment, especially for my social life. Hearing people speak French, I was having trouble holding it together, because, obviously this was a fake language designed to make you emit as many silly noncoherent noises as possible.

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.

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 ~/.

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.

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!

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:

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.

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.

Banshee

July 18, 2016

Remove deleted files from internal database Install libdbi-perl and libdbd-sqlite3-perl Make a backup of ~/.config/banshee-1/banshee.db Download reap-dead-tracks.pl from this server or GitHub Run perl reap-dead-tracks.pl <db>, confirm deletion Reload internal database sqlite3 ~/.config/banshee-1/banshee.db "update coretracks \ set LastSyncedStamp = 0 where PrimarySourceID=1" UI Use right mouse button to resize time slider Sync Make an .is_audio_player file in root of external device, describe capabilites Do not start banshee wile an mtp device is connected (Just starting up banshee in the background will cause the connection to fail and mess up everything)

Mixxx reference

February 11, 2016

AutoDJ Activate with Shift-F12, a little android icon will appear in top left corner and control over crossfader will be automated Skip track with Shift-F11 Set fade time to negative value for breaks in between songs, don’t forget to turn it off. Setting a negative value will make mixxx not respect cue points! Use crates to refill cue if necessary Seeking to cue point on load can be turned off in preferences Musicality The BPM detection is insufficicient Knobs Any effect will increase audio latence, this includes key lock Don’t forget to turn off filters after the song has ended Mind the crossfader Use the gain slider cautiously, and turn it off immediately afterwards For effects: select appropriate channel Recording CTRL-R to start-stop recording, little icon will appear in top left corner Organizing Use playlists for tracks in a specific order Tandas are designated T:Genre:Artist(tempo):Singer/mood/etc.

Firefox modifications

December 20, 2015

Addons Essential uBlock Origin (with custom filters) Stylish Session Manager GrabMyBooks I don’t care about cookies Clean Uninstall New Tab override(since Firefox doesn’t allow setting newtab.url any more for some reason) Suspend Tab (actually works, as opposed to UnloadTab) VimFx(with custom mappings, don’t forget to back up) wallabag(v2) Warn Before Quit Unused UnloadTab (loses tabs, not recommended) Super Start (load a custom html page from file:/// instead) RSVP Reader ScrapBook HTML5 Video Everywhere!

Debian cheatsheet

May 16, 2014

This has grown into a very useful list of things that make my life easier. Divided into sections for clarity. Mostly applicable to Ubuntu as well. tags, tables side-by-side for better overview -- Nifty shortcuts, one-liners and useful programs netcat for file transfer receiver: nc -l -p 1234 > somefile.png sender: nc -w 3 192.168.178.20 1234 < somefile.png ssh port forwarding ssh -R 80:localhost:8080 user@server.com -i key.pem multiple x sessions exec startx -- :1 vt8 get random SALT openssl rand -base64 32 use imagemagick to resize pictures convert <infile> -resize 100x100 [<outfile>] use imagemagick to create quick thumbnails POSIX, only works with .

Vim cheat sheet

May 16, 2014

Folds za to toggle current fold zm to close, zr to open Windows from windows A buffer is the in-memory text of a file. A window is a viewport on a buffer. A tab page is a collection of windows. Opening: CTRL-W and v(vert), s(split/duplicate), n(horiz) Closing: CTRL-W and q(quit), c(close) Moving cursor: CTRL-W and up, down, left, right Moving windows: CTRL-W CTRL-O make window the only(maximize) Plugin mappings sensible: CTRL-u in insert mode: delete backwards, for real sneak: s or S and then two letters for faster jumping, ; to repeat table-mode: <leader>tm to toggle, <leader>tr to realign, SHIFT-jklö to jump table cells multiple cursors: CTRL-n to select word, CTRL-p for undo, CTRL-x to skip the current one Settings in vimrc