This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <signal.h> | |
#include <unistd.h> | |
int forkstatus; | |
int exitstatus = 0; | |
void catch_sigterm () { | |
if (forkstatus != 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $1 =~ ^http ]]; then #http, https | |
url=$1 | |
else # everything else | |
url="http://$1" | |
fi | |
escaped=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0], "(),");' "$url") | |
firefox -P default -remote "openURL(${escaped}, new-tab)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
url=$(xclip -o | sed -e 's/^\s*//' -e 's/\s*$//' | grep -v '^$' | head -n 1) | |
x-www-browser "$url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec ${emulator:=urxvtcd} -e vim "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
temp=$(mktemp) | |
echo "### clipboard ###" > "$temp" | |
xclip -o >> "$temp" | |
env emulator=urxvt uvim -b -c 'set noeol' "$temp" + | |
sed 1d "$temp" | xclip -i | |
rm "$temp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import random | |
import base64 | |
"""Secret Santa generator 0.1, trusted 1-party version. | |
Ever been dissatisfied with random santa assignment because the group would break up into smaller circles? This script prevents this. | |
Usage: Edit seed and names, run the script. Each participant will have the obfuscated name of the presentee printed next to their name, run it through the base64 decoder of your choice to reveal it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# canything can be found here: https://github.com/keiji0/canything | |
focus=$(xdotool getwindowfocus) | |
list="./folders" | |
tosort=$1 | |
if [ -z "$tosort" ] | |
then | |
echo "read script source." | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# fix shift+ins pasting on gtk apps | |
# use by binding to shift+ins globally like so: ("S-<Insert>", spawn "pastefix") | |
# depends: xclip, xdotool | |
# inspired by https://github.com/wh5a/arch/commit/623faac500a0eeb31477b0374b3080eaf2ed3685 | |
clipboard=$(xclip -o -selection clipboard) | |
xclip -o | xclip -selection clipboard | |
pid=$(xdotool getwindowfocus getwindowpid) | |
if head -c 1 >/dev/null 2>/dev/null /proc/$pid/maps && \ | |
grep -q libgtk-x11 /proc/$pid/maps && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $@: ircssh, a shell account with irssi running | |
# xmonad line: | |
# , ("M-S-i", spawn "gnome-terminal -e 'Skripte/ssh.sh ircssh'") | |
if [[ `date +%k` -lt 18 || `date +%k` -gt 20 ]] | |
then | |
echo "Internet geschlossen, Öffnungszeiten 18 bis 21 Uhr." | |
read | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use Irssi; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.01"; | |
%IRSSI = ( | |
name => 'qwertz.pl', |