Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name linux.com News "Read more at" Redirect
// @namespace http://tampermonkey.net/
// @version 1
// @description Automatic redirect for linux.com articles to full stories
// @author Jeni4 <Jeni4@users.noreply.github.com>
// @match http://www.linux.com/news/*
// @match https://www.linux.com/news/*
// @grant none
// @updateURL https://gist.github.com/Jeni4/3e58c0e83bae2b499152925eeda86954/raw/960f22e35c31aed6db15b2f487759dcbf7fdfbc2/linux.com%2520News%2520%2522Read%2520more%2520at%2522%2520Redirect.user.js
@netravnen
netravnen / my_personal_cheat_sheet
Last active March 30, 2017 12:16
Short personal cheat-sheet
= GIT =
# List all git authors in open repository with name and e-mail
#
git shortlog -e -s -n
= VI =
# Replace all tabs with 2 spaces in open text file
#
// ==UserScript==
// @name TitleFixer - Peeringdb.com
// @namespace https://github.com/netravnen/TitleFixer-PDB
// @version 0.1.1
// @description netravnen
// @author netravnen
// @match https://www.peeringdb.com/asn/*
// @match https://www.peeringdb.com/org/*
// @match https://www.peeringdb.com/ix/*
// @grant none
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Syntax: $_ USER[ USER[ ...]]" >&2
exit 1
fi
exit_code=0
for user in "$@"; do
home="/home/$user"

Keybase proof

I hereby claim:

  • I am netravnen on github.
  • I am motd (https://keybase.io/motd) on keybase.
  • I have a public key ASC1Lm5LmjZxTZLp1L_0t_Y35sL4cz7vZx4Mx4293lABQwo

To claim this, I am signing this object:

@netravnen
netravnen / gpg.conf
Last active September 1, 2017 14:43
# Options for GnuPG
# Copyright 1998, 1999, 2000, 2001, 2002, 2003,
# 2010 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
@netravnen
netravnen / fix-missing-gpg-keys.sh
Last active September 17, 2017 20:52
Fix missing GPG keys
#!/bin/bash
#
# Source: Shamelessly copied from https://askubuntu.com/a/280957
#
sudo apt-get update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' |
while read key; do
echo 'Processing key:' "$key"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key"
done
:: Archive files in current dir into seperate 7z archives
:: and delete archives files afterwards.
::
:: a: create archive
:: -t7z: use 7z format
:: -sdel: delete files after archiving
:: -mx9: use highest possible compression ration
:: -mmt: use multi-threading while archiving
:: -ms: create solid archive-file
@netravnen
netravnen / multiple-git-remotes.gitconfig
Last active November 27, 2017 05:41
When doing 'git push origin' on current branch, will push branch to all specified remotes
[remote "gitlab"]
url = https://gitlab.com/username/repository-name.git
fetch = +refs/heads/*:refs/remotes/gitlab/*
[remote "github"]
url = https://github.com/username/repository-name.git
fetch = +refs/heads/*:refs/remotes/github/*
[remote "bitbucket"]
url = https://bitbucket.org/username/repository-name.git
fetch = +refs/heads/*:refs/remotes/bitbucket/*
[remote "origin"]

Keybase proof

I hereby claim:

  • I am netravnen on github.
  • I am chri (https://keybase.io/chri) on keybase.
  • I have a public key whose fingerprint is C8B3 82A8 A1CD CDB7 71FE B24C C654 948F DA86 BECD

To claim this, I am signing this object: