Skip to content

Instantly share code, notes, and snippets.

☕️
a damn fine cup of coffee

Andreas Linz klingtnet

☕️
a damn fine cup of coffee
Block or report user

Report or block klingtnet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@klingtnet
klingtnet / add-keys-automatically-to-SSH-agent.md
Created Feb 2, 2020
Add SSH keys automatically to SSH-Agent
View add-keys-automatically-to-SSH-agent.md

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 Jan 29, 2020
Hot to share a git repository by mail
View gist:4148a55e374bdf7bfe160ed0dcdd5677
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
View Viewsonic-VG2755-2k.md

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 Jan 9, 2020
My docker daemon.json (fixes address ranges for docker-compose, etc. and logs using journald instead of files).
View daemon.json
{
"log-driver": "journald",
"default-address-pools": [
{
"base": "10.241.0.0/16",
"size": 24
}
]
}
@klingtnet
klingtnet / xfce-hidpi-scaling-commands.sh
Last active Jan 14, 2020
XFCE4.14 properly switch scaling factor
View xfce-hidpi-scaling-commands.sh
# 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
View gist:e91591956a3d0e89774a02a8ba9ef950
$ script --timing=typescript.timings
# spawns a new shell, do something etc.
# until EOF
$ scriptreplay typescript.timings
# replays the script
@klingtnet
klingtnet / create-an-ext4-blockdevice-as-file.sh
Created Nov 6, 2019
Use a file as blockdevice (experiment with filesystem options)
View create-an-ext4-blockdevice-as-file.sh
#!/bin/bash
dd if=/dev/zero of=/tmp/blockdevicefile bs=1M count=2K oflag=sync status=progress
mkfs.ext4 /tmp/blockdevicefile
mkdir /tmp/mountpath && sudo mount -o loop /tmp/blockdevicefile /tmp/mountpath
@klingtnet
klingtnet / go.sh
Created Nov 3, 2019
Go installation script for Linux
View go.sh
#!/bin/bash
set -eo pipefail
_version=${1:-'1.13.4'}
set -u
rm -rf /usr/local/go
curl -Lsf "https://dl.google.com/go/go${_version}.linux-amd64.tar.gz" | tar -C/usr/local -xvzf-
cat <<HEREDOC>/etc/profile.d/go.sh
export PATH=$PATH:/usr/local/go/bin
@klingtnet
klingtnet / mail.py
Created Oct 28, 2019
Send emails with Python using SMTP over TLS
View mail.py
import smtplib
import os
from email.message import EmailMessage
with smtplib.SMTP_SSL('mailserver.example', port=465) as smtp:
smtp.login('my-user', 'my-secret-password')
from_addr = 'my-user@mailserver.example'
to_addr = 'anli@spreadshirt.net'
msg = EmailMessage()
View eucledian-rythms.py
import unittest
import itertools
from typing import List
def flatten(f):
def wrapper(*args, **kwargs):
nested = f(*args, **kwargs)
return list(itertools.chain(*nested))
You can’t perform that action at this time.