This file contains hidden or 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 zsh | |
# This script prints a bell character when a command finishes | |
# if it has been running for longer than $zbell_duration seconds. | |
# If there are programs that you know run long that you don't | |
# want to bell after, then add them to $zbell_ignore. | |
# | |
# This script uses only zsh builtins so its fast, there's no needless | |
# forking, and its only dependency is zsh and its standard modules | |
# |
This file contains hidden or 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
module Gollum | |
class Macro | |
class GlobalTOC < Gollum::Macro | |
def render(title = "Global Table of Contents") | |
pages = @wiki.pages.sort do |a,b| | |
if a.path.include?('/') and b.path.include?('/') then | |
a.path <=> b.path | |
elsif a.path.include?('/') then | |
1 | |
elsif b.path.include?('/') then |
This file contains hidden or 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 | |
CMD="${@:-bash}" | |
unshare -unpirf --mount-proc sh -c ' | |
hostname sandbox | |
TMPNAME=$(mktemp -d) | |
# replace /dev by minimal dummy version | |
mount -t tmpfs -o nosuid,mode=755 none $TMPNAME |
This file contains hidden or 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
local function timeout_popen(timeout, ...) | |
local outerpiper, outerpipew = nixio.pipe() | |
if nixio.fork() == 0 then | |
outerpiper:close() | |
local innerpiper, innerpipew = nixio.pipe() | |
local pid = nixio.fork() | |
if pid == 0 then | |
outerpipew:close() | |
innerpiper:close() | |
nixio.dup(innerpipew, nixio.stdout) |
This file contains hidden or 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
function update_latency(int link_latency) { | |
bgp_community.add((64511, link_latency)); | |
if (64511, 9) ~ bgp_community then bgp_community.delete([(64511, 1..8)]); | |
else if (64511, 8) ~ bgp_community then bgp_community.delete([(64511, 1..7)]); | |
else if (64511, 7) ~ bgp_community then bgp_community.delete([(64511, 1..6)]); | |
else if (64511, 6) ~ bgp_community then bgp_community.delete([(64511, 1..5)]); | |
else if (64511, 5) ~ bgp_community then bgp_community.delete([(64511, 1..4)]); | |
else if (64511, 4) ~ bgp_community then bgp_community.delete([(64511, 1..3)]); | |
else if (64511, 3) ~ bgp_community then bgp_community.delete([(64511, 1..2)]); | |
else if (64511, 2) ~ bgp_community then bgp_community.delete([(64511, 1..1)]); |
This file contains hidden or 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
<?php | |
// where to log errors and successful requests | |
define('LOGFILE', '/tmp/github-webhook.log'); | |
// what command to execute upon retrieval of a valid push event | |
$cmd = 'update-jekyll.sh 2>&1'; | |
// the shared secret, used to sign the POST data (using HMAC with SHA1) | |
$secret = '00000000000000000000000000000000'; |
This file contains hidden or 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 | |
# Copyright (c) 2014 Jan-Philipp Litza <[email protected]> | |
# | |
# 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 | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or 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
[{"2412": ["6511A5AF+", "9CA6B13E+", "C7A646CE", "238742BA"], "2472": ["1A2B3912-"], "2462": ["80DFA95A", "0543E2A4", "C7A6A76E", "96D72006"], "2437": ["0F6EB6A4", "2506C763", "1D19D85E", "1DD19B4A", "4FB59AB4"], "2452": ["83BF6A82", "24FE03AD-"], "2442": ["2308AD52-"]}, {"2412": ["03557B22", "2308015E+", "2DB38AD9+"], "2472": ["1C284EB1"], "2462": ["8DF730F1-"], "2422": ["317035E5", "C63C55C8"], "2437": ["040E2C9D", "2E9E3916", "1A4F01E2", "BDB99066", "80DF7CD7"], "2457": ["1C2812C7"]}, {"2412": ["23087FE1", "2308E857", "31C4156A+", "31C43F2E", "23085221", "C63C3FB3"], "2422": ["040ED55D", "1D199CD5"], "2447": ["96D7A2DE", "A8E4F368", "C7A6F2A2-"], "2472": ["651172E5", "31C40A3D"], "2462": ["1F33777C", "16E36874", "1C4A0129-", "6D8FCEB6-"], "2437": ["1E58849F", "26F24594+", "7EE53D88", "1E580919", "1CF08464", "040E5692", "264D08B0-", "264D0C81", "265AAFBB", "150C8C77"], "2417": ["96D7A280+", "1A2ACAD0", "C63C266C+"], "2442": ["66B3EE61-"], "2432": ["8DF7790B+", "C63CB6E1"], "2457": ["1401CE1D", "7EE50084-", |
This file contains hidden or 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
\documentclass{scrartcl} | |
\usepackage{tikz} | |
\usetikzlibrary{graphdrawing,graphs} | |
\usegdlibrary{circular} | |
\begin{document} | |
\begin{tikzpicture}[simple necklace layout] | |
\graph { A -> B -> C -> A}; | |
\end{tikzpicture} | |
\end{document} |
This file contains hidden or 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 nodejs | |
var fs = require('fs'); | |
var _ = require('underscore'); | |
var RRD = require('rrd').RRD; | |
var argv = require('optimist') | |
.usage('Usage: $0 -b <batvis file> -a <alias file> <destination dir>') | |
.options('b', {alias: 'batvis', describe: 'File containing output of batadv-vis -f jsondoc', demand: true, string: true}) | |
.options('d', {alias: 'details', describe: 'File containing details sent by the nodes', demand: true, string: true}) | |
.argv; |