Skip to content

Instantly share code, notes, and snippets.

View stgnet's full-sized avatar

Scott Griepentrog stgnet

View GitHub Profile
@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@cocoalabs
cocoalabs / gist:2fb7dc2199b0d4bf160364b8e557eb66
Created August 15, 2016 21:50
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@stgnet
stgnet / build_test_module
Created April 1, 2014 15:17
Build FreePBX module tgz for testing
#!/bin/bash
# build test version of module
set -e
[ ! -f module.xml ] && echo "ERROR: module.xml not found!" && exit 1
MODNAME=$(xmllint --shell module.xml <<<"cat /module/rawname/text()" |grep -v "^/")
VERSION=$(xmllint --shell module.xml <<<"cat /module/version/text()" |grep -v "^/")
[ -z "$MODNAME" -o -z "$VERSION" ] && echo "ERROR: module name and version missing from module.xml" && exit 2
cd ..
[ ! -d "$MODNAME" ] && echo "ERROR: directory $PWD/$MODNAME not found!" && exit 3