Skip to content

Instantly share code, notes, and snippets.

View klingtnet's full-sized avatar
a damn fine cup of coffee

Andreas Linz klingtnet

a damn fine cup of coffee
View GitHub Profile
@klingtnet
klingtnet / import-backup-share-gnome-settings.md
Created April 15, 2020 08:31
Import/backup/share gnome settings

You need dconf for this to work. Alternatively, those commands can be adapted to gsettings. There a two user accounts on my system between I share a common configuration. To reapply those settings through GUI menus is error prone and cumbersome and this is why I do it like this:

a@machine$ dconf dump /org/gnome/ > /tmp/gnome.dconf
# you can also dump everything / or dump /org/gtk (nautilus settings) as well
b@machine$ cat /tmp/gnome.conf | dconf load /org/gnome/
@klingtnet
klingtnet / katex.js
Created April 13, 2020 11:52
Server side LaTeX equation rendering in Go
#!/usr/bin/env node
var katex = require('katex');
function main() {
let displayMode = process.argv[process.argv.length-1] == '--display-mode';
process.stdin.setEncoding('utf8');
let input = "";
#!/bin/bash
set -euo pipefail
_version='1.3.0'
curl -Lf "https://github.com/mumble-voip/mumble/releases/download/${_version}/murmur-static_x86-${_version}.tar.bz2" | tar -xjf-
cp -f murmur-static_x86-${_version}/murmur.x86 murmur.x86
sudo bash -c "cat >/etc/systemd/system/murmur.service" <<HEREDOC
[Unit]
Description=Murmur Mumble Server
@klingtnet
klingtnet / how-to-git-bisect-a-Go-project.sh
Created February 26, 2020 15:24
How to git bisect a Go project
$ git bisect start <bad-revision> <good-revision>
# Example: git bisect start maintenance c6792fae3ac9279763e30096c8dfac7f3bbf2a7c
$ git bisect run go test ./...
@klingtnet
klingtnet / add-keys-automatically-to-SSH-agent.md
Created February 2, 2020 12:25
Add SSH keys automatically to SSH-Agent

With the Mate desktop environment I faced the problem that SSH keys were not added automatically to my SSH-Agent/Keyring. This worked perfectly with XFCE, though. I just discovered that my ~/.ssh/config did not contain AddKeysToAgent (see man 5 ssh_config for options). After adding AddKeysToAgent=ask the keys are now added as expected.

@klingtnet
klingtnet / gist:4148a55e374bdf7bfe160ed0dcdd5677
Created January 29, 2020 08:28
Hot to share a git repository by mail
1. `$ git bundle create my-project.bundle --all`
2. send the `my-project.bundle` by mail
3. on the receiver side: `git clone /path/to/my-project.bundle`
Source: https://statagroup.com/articles/git-bundle
@klingtnet
klingtnet / Viewsonic-VG2755-2k.md
Created January 14, 2020 15:14
Viewsonic VG2755-2k

Viewsonic VG2755-2k

A 27" WQHD business IPS display: specs.

Often customers report problems about humming or buzzing noises caused by badly designed power supplies when a device is connected and charged via USB-C to a display. One very bad example of this is the Lenovo ThinkVision P27h-10, but also devices from Dell and Philips seem to be noisy when USB-C charging is active. I owned one of the P27h-10 for a short time and the noise was unbearable so I returned the display to the seller. Except that the monitor was very good, sturdy built, crisp and very bright diplay. Nonetheless, I wanted to have a display where I can connect my X1 through a single cable.

The Viewsonic VG2755-2k works fine when connected via USB-C, it can provide up to 60W charging power (15W more than the Lenovo) and makes absolutely no noise.

@klingtnet
klingtnet / daemon.json
Created January 9, 2020 11:06
My docker daemon.json (fixes address ranges for docker-compose, etc. and logs using journald instead of files).
{
"log-driver": "journald",
"default-address-pools": [
{
"base": "10.241.0.0/16",
"size": 24
}
]
}
@klingtnet
klingtnet / xfce-hidpi-scaling-commands.sh
Last active October 20, 2021 13:26
XFCE4.14 properly switch scaling factor
# 2 times scaling
$ xfconf-query --channel xsettings --property /Gdk/WindowScalingFactor --set 2 && xfconf-query --channel xfwm4 --property /general/theme --set Default-xhdpi && xfconf-query --channel xsettings --property /Gtk/CursorThemeSize --set 48 && xfce4-panel -r
# normal scaling
$ xfconf-query --channel xsettings --property /Gdk/WindowScalingFactor --set 1 && xfconf-query --channel xfwm4 --property /general/theme --set Default && xfconf-query --channel xsettings --property /Gtk/CursorThemeSize --set 16 && xfce4-panel -r
@klingtnet
klingtnet / gist:e91591956a3d0e89774a02a8ba9ef950
Created November 26, 2019 07:30
How to record terminal sessions
$ script --timing=typescript.timings
# spawns a new shell, do something etc.
# until EOF
$ scriptreplay typescript.timings
# replays the script