Skip to content

Instantly share code, notes, and snippets.

View rumpelsepp's full-sized avatar
🏠
Working from home

Stefan Tatschner rumpelsepp

🏠
Working from home
View GitHub Profile
@rumpelsepp
rumpelsepp / update-atom.sh
Last active November 26, 2017 14:10
A bash script to install and update atom on debian/ubuntu
#!/usr/bin/env bash
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rumpelsepp
rumpelsepp / mkimage.sh
Created September 21, 2017 12:22
Create a debian qemu image
#!/bin/bash
# Creates a raw image which can be booted with:
#
# $ kvm -kernel PATHTOKERNEL/bzImage \
# -drive file=$HOME/sid-amd64.img,media=disk,format=raw,readonly=off \
# -append "root=/dev/sda console=ttyS0" \
# -fsdev local,id=fs1,path=$HOME,security_model=none \
# -device virtio-9p-pci,fsdev=fs1,mount_tag=host-home \
# -nographic
@rumpelsepp
rumpelsepp / log.c
Last active October 26, 2022 06:51
A printf wrapper, with loglevel support and timestamps
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <libiberty/libiberty.h>
#include "log.h"
#include "config.h"
#define BUFSIZE 1024
@rumpelsepp
rumpelsepp / pagemap.c
Last active September 10, 2024 02:11
Read the pagemap of a given process id
// Public Domain; Feel free to copy and steal it!
// Based on:
// http://fivelinesofcode.blogspot.de/2014/03/how-to-translate-virtual-to-physical.html
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <errno.h>
#include <stdint.h>
@rumpelsepp
rumpelsepp / search-deb.sh
Last active February 13, 2017 09:12
A shell script for using the debian packages search website from the commandline
#!/bin/sh
SCRIPTNAME=$(basename "$0")
KEYWORDS="$1"
SUITE="testing"
usage() {
echo "usage: $SCRIPTNAME [ARGS] [-h] KEYWORDS"
echo ""
echo "This script is a short wrapper over the search feature of the debian"
@rumpelsepp
rumpelsepp / fcd.fish
Created March 20, 2016 10:23
Fuzzy cd for fish shell using fzf
function -d "Fuzzy change directory" fcd
if set -q argv[1]
set searchdir $argv[1]
else
set searchdir $HOME
end
# https://github.com/fish-shell/fish-shell/issues/1362
set -l tmpfile (mktemp)
find $searchdir \( ! -regex '.*/\..*' \) ! -name __pycache__ -type d | fzf > $tmpfile
@rumpelsepp
rumpelsepp / chucknorris.py
Last active June 6, 2017 09:16
Fetch a random Chuck Norris joke
#!/usr/bin/env python3
#
# The MIT License (MIT)
#
# Copyright (c) 2015-2016 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rumpelsepp
rumpelsepp / install-pacaur.sh
Last active November 20, 2022 13:04
A small script for arch linux which builds and installs "pacaur" automatically
#!/usr/bin/bash -l
#
# The MIT License (MIT)
#
# Copyright (c) 2015-2017 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@rumpelsepp
rumpelsepp / get-n24.py
Last active February 23, 2016 18:07
A quick and dirty extractor for rtmpdump to download n24 videos, see also: http://anthropophobist.wordpress.com/2013/05/04/rtmp-streams-von-diversen-mediatheken-speichern
#!/usr/bin/env python3
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell