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
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 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 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 | |
SERVER="$1" | |
INTERVAL=10 | |
# read once and ignore result, as it is bogus at first | |
cat /sys/bus/w1/devices/*/w1_slave > /dev/null | |
while sleep "$INTERVAL"; do | |
for DEV in /sys/bus/w1/devices/*/w1_slave; do |
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 | |
# Copyright (c) 2014 Jan-Philipp Litza <janphilipp@litza.de> | |
# | |
# 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 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 | |
set -eu | |
if [ "$#" != 2 ]; then | |
echo "Usage: $(basename "$0") <iface> <file>" | |
exit 1 | |
fi | |
IFACE="$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/bash | |
set -eu | |
declare -a STATES=(OK WARNING CRITICAL UNKNOWN) | |
declare -i STATE_OK=0 | |
declare -i STATE_WARNING=1 | |
declare -i STATE_CRITICAL=2 | |
declare -i STATE_UNKNOWN=3 |
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
class TPLink < Oxidized::Model | |
# tp-link prompt | |
prompt /^\r?([\w.@()-]+[#>]\s?)$/ | |
comment '! ' | |
# handle paging | |
# workaround for sometimes missing whitespaces with "\s?" | |
expect /Press\s?any\s?key\s?to\s?continue\s?\(Q\s?to\s?quit\)/ do |data, re| | |
send ' ' | |
data.sub re, '' |
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 /etc/rc.common | |
START=50 | |
USE_PROCD=1 | |
NAME=co2mon | |
PROG=/root/co2mon/hidapi_co2mon.py | |
start_service() { | |
local url=$(uci -q get co2mon.@co2mon[0].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
<?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 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 | |
set -eu | |
PROXY=false | |
usage() { | |
echo "Usage: $0 [-X connect -x <proxy:port>] <host> <port>" | |
} |