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 | |
# k8s_manual_cron - Run a configured cronjob now | |
set -euo pipefail | |
IFS=$'\n\t' | |
# shellcheck disable=SC2155 | |
main() { | |
readonly cronjob_name="$1" | |
local cronjob="$(kubectl get cronjob "$cronjob_name" -o json)" | |
local jobTemplate="$(printf "%s" "$cronjob" | jq -c .spec.jobTemplate.spec)" |
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
package main | |
// #cgo LDFLAGS: -framework Carbon | |
// #include <Carbon/Carbon.h> | |
// extern void Callback(); | |
// void RunApplicationEventLoop(); | |
// static inline OSStatus handler(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) | |
// { | |
// Callback(); | |
// return 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
DDH |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"os" | |
"regexp" | |
"sort" | |
"strconv" |
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
// ==UserScript== | |
// @name Torrentz Direct Link | |
// @description Adds direct links to torrent pages, you won't have to go to the original index. | |
// @author Koen Bollen | |
// @match http://torrentz.com/* | |
// ==/UserScript== | |
var rxs = { | |
'piratebay.org': [ |
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
# branch will let you quickly create a git branch prefixed with your username | |
function branch() { | |
name=${@:?"mssing argument usage: branch BRANCH NAME"} | |
slug=$(echo "${name}" | tr -s "A-Z_ " "a-z--" | tr -cd "a-z0-9-" ) | |
cmd="git checkout -b ${USER}/${slug}" | |
echo -n "\033[37;1m${cmd}?\033[0m [\033[0;32menter\033[0m/\033[0;31mctrl+c\033[0m] " | |
read || return | |
eval $cmd | |
} |
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
package main | |
// usage: curl localhost:1544 -d"Text Here" | |
import ( | |
"io" | |
"net/http" | |
"os/exec" | |
"golang.org/x/text/transform" |
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
/** | |
* bail.h supplies the macro bail( expr, s ); "no description, read the code" | |
* version 1.0 | |
* Copyright (C) 2008, Koen Bollen | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation version 2. | |
* | |
* This program is distributed in the hope that it will be useful, |
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/env python | |
# wake.py - Send a wake-on-lan packet to a certain host specified by name. | |
# The hosts that can be woken are stored a csv file. | |
# | |
# Default path for the hosts file is ~/.mac and the | |
# format is this (one host per line): | |
# Title, name, mac-address, port | |
# Example: | |
# My Computer, living, 00:11:22:33:44:55, 7 | |
# |
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/env python | |
# load.py | |
# Test the current load of this system and report through e-mail when it's | |
# above a given threshold. | |
# | |
# Koen Bollen <meneer@koenbollen.nl> | |
# GPLv2 2011 | |
# | |
LOAD_THRESHOLD = 0.8 # normalized (load/cpus > LOAD_THRESHOLD) |