Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonas Berlin xkr47

View GitHub Profile
@xkr47
xkr47 / README.md
Last active Nov 28, 2021
VDR 2.4.0 channels.conf for DVB-C channels of Karis Telefon / Karjaan puhelin 2021-11-26
View README.md

VDR 2.4.0 channels.conf for DVB-C channels of Karis Telefon / Karjaan puhelin 2021-11-26

Produced using w_scan -fc -c FI -Q1 -S1 -o21 using w-scan version 20170107-2

@xkr47
xkr47 / git-fetch-sha
Last active Jul 26, 2021
Fetch commit by SHA from remote even if not attached to a branch — useful for e.g. force-pushed PRs whose earlier commits are no longer directly available
View git-fetch-sha
#!/bin/bash
# by Jonas Berlin 2021 from https://gist.github.com/xkr47/a82d710092847a39901a563b22e82b4b
# 1. Place in e.g. $HOME/bin/git-fetch-sha
# 2. Run "git fetch-sha" for usage
set -e
remote="$1"
sha="$2"
@xkr47
xkr47 / libera.irssi
Last active May 13, 2022
How to add the libera.chat network to irssi
View libera.irssi
Replace all <....> parts with your specific details
/network add -nick <nick> libera
/server add -network libera -auto -ssl irc.libera.chat 6697
/connect libera
/query NickServ
register <password> <email>
<copypaste line from email>
/network add -autosendcmd "" -sasl_username <user> -sasl_password <pass> -sasl_mechanism PLAIN libera
/channel add -auto <channel> libera
@xkr47
xkr47 / README.md
Last active Jun 24, 2021
Script for moving/renaming files/directories arbitrarily in whole git history of single branch, using perl expressions
View README.md

Install into PATH e.g. $HOME/bin/ as "git-filter-mv" and chmod a+rx git-filter-mv

It works with any special characters in filenames like tabs and linefeeds. It works with empty commits.

Based on example from git-filter-branch manpage.

If you want to print debug messages, use STDERR e.g. print STDERR "File: $_\n";

Examples:

@xkr47
xkr47 / git-alias.sh
Last active Sep 25, 2020
"git alias" command for adding/removing/editing git aliases conveniently
View git-alias.sh
#!/bin/bash
set -eo pipefail
usage () {
cat <<'EOF'
usage:
git alias [<options>]
git alias [<options>] name
git alias [<options>] name newvalue
@xkr47
xkr47 / Cargo.toml
Last active Jun 19, 2020
Seriously funny rust error message
View Cargo.toml
[package]
name = "x"
version = "0.1.0"
edition = "2018"
[dependencies]
dbus = "0.8.1"
@xkr47
xkr47 / README.md
Last active Nov 11, 2019
Simple calculator in https://raku.org/ language, with support for time durations & base 2..36
View README.md

Example session:

2+3

Result: 5₁₀

5d

Result: 5,00:00:00 = 5.000000 days
 120:00:00 = 120.000000 hours
@xkr47
xkr47 / doodle.css
Last active Sep 24, 2019
Fix Doodle to use full screen width and to stop resetting the horizontal scrolling when scrolling "outside" the vote table
View doodle.css
.d-pagesContainer {
max-width: unset !important;
}
.d-expandableScrollContainer {
overflow: visible !important;
background: white;
max-width: unset !important;
width: unset !important;
}
#d-participationPage #d-metadataView .d-pollMetadataRow, #d-participationPage #d-metadataView .d-pollHiddenButton.d-silentButton {
View flowdock.css
/* make notifications darker - suitable for dark theme */
.msg-body {
color: #585860;
}
.comment-group-hover .msg-body {
color: #9090a0;
}
/* just restore default theme colour that gets overridden by the above for normal messages */
.msg-body > p, .msg-body ul {
@xkr47
xkr47 / message.js
Last active Aug 23, 2019
keybase ephemeral message test
View message.js
// rendition of a message "test" set to expire in 30 seconds, as retrieved by json api after "exploding":
// $ keybase chat api -p -m '{"method": "read", "params": {"options": {"channel": {"name": "keybasefriends", "members_type": "team", "topic_name": "general", "pagination": {"num": 1}}}}}'
{
"msg": {
"id": 52853,
"conversation_id": "0000d5ba71470610a40b4d32af53a52775cc561589525d7b21bad9ec057b6aac",
"channel": {
"name": "keybasefriends",
"public": false,
"members_type": "team",