Skip to content

Instantly share code, notes, and snippets.

View eik3's full-sized avatar

Eike Herzbach eik3

View GitHub Profile
// ==UserScript==
// @name WorldTimeBuddy hacks
// @description
// @namespace http://www.worldtimebuddy.com/
// @include http://www.worldtimebuddy.com/*
// @match http://www.worldtimebuddy.com/*
// ==/UserScript==
(window.setTimeout(function(){
document.getElementsByClassName("wrapper")[0].removeChild(document.getElementById("toprek"));
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@eik3
eik3 / profile_tasks.py
Last active January 11, 2016 23:33
Show Ansible timing stats at end of play
"""
based on
https://github.com/jlafon/ansible-profile
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/timer.py
just throw this into a callback_plugins directory inside your playbooks directory
"""
import time
import datetime
#!/bin/bash
init=true
function do_stuff () {
while :; do
echo -n .
sleep .5
done
}
while :; do
if [ "$(nc -l 9999)" = "on" ]; then
k=k$RANDOM
function r {
redis-cli -p 16379 $*
}
count=$1
i=0
while [ $i -lt $count ]; do
sleep .1
let i+=1
@eik3
eik3 / README.md
Last active February 11, 2022 09:48
Git pre-commit and pre-push hooks to avoid accidental main / master branch commits / pushes
  1. Save files to ~/.git/hooks/
  2. Make them executable: chmod +x ~/.git/hooks/pre-{commit,push}
  3. Configure git to use these hooks: git config --global core.hooksPath ~/.git/hooks
@eik3
eik3 / rp.sh
Last active November 7, 2023 09:25
A bash script to update all git repos
#!/usr/bin/env bash
# A script to update all git repositories in a directory tree
# Run `rp status` to see the status of all repositories
# Run `rp update` to update all repositories that are on the main branch and have no uncommitted changes
my_project_dir=/path/to/my/git/repos
function print_status() {
tput bold