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 | |
# System Colors | |
for line in {0..7}; do | |
for col in {0..1}; do | |
code=$(( $col * 8 + $line )) | |
printf $'\e[38;05;%dm %03d' $code $code | |
done | |
echo | |
done |
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 | |
# attach to an existing tmux session, or create one if none exist | |
# also set up access to the system clipboard from within tmux when possible | |
if [[ $OSTYPE == darwin* && -x $(command -v reattach-to-user-namespace) ]]; then | |
# on OS X force tmux's default command to spawn a shell in the user's namespace | |
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard | |
tweaked_config=$(cat $HOME/.tmux.conf <(echo 'set-option -g default-command "reattach-to-user-namespace -l $SHELL"')) |
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
[alias] | |
ap = add --patch | |
br = branch | |
ci = commit --verbose | |
co = checkout | |
df = diff | |
ds = diff --stat | |
empty-tree-sha1 = hash-object -t tree /dev/null | |
gone = git log --diff-filter=D --summary | |
lc = log ORIG_HEAD.. --stat --no-merges |
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
Two nodes, alice and bob that are set up to be redundant load balancers using | |
HAProxy. There are two floating IP address resources that need to be on the | |
machine for HAProxy to bind to (so only one machine will be running the HAProxy | |
resource at a time). Both machines are x86_64 CentOS 6.1 running corosync 1.4.1 | |
and pacemaker 1.1.6. | |
alice.example.com = 172.16.32.10/24 (eth1) | |
bob.example.com = 172.16.32.11/24 (eth1) |
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/gawk -f | |
### samp | |
### Efficiently sample lines from a large file or infinite pipe. | |
### Table of Contents: | |
## * Copyright & Licensing | |
## * Script Documentation | |
## * Acknowledgments |
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
{ | |
"Version": "2008-10-17", | |
"Id": "http referer policy", | |
"Statement": [ | |
{ | |
"Sid": "Allow GET requests", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
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
# Fact: javaversion & javamajversion | |
# | |
# Purpose: | |
# Return the version of the installed Java package in both its full form and | |
# just the major release version. | |
# | |
# Resolution: | |
# Uses the output from the `java -version` command to establish the full | |
# version, and then parses that value to return just the major version | |
# number. It will return the full javaversion if the major version could not |
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 ( | |
"encoding/hex" | |
"flag" | |
"io" | |
"io/ioutil" | |
"log" | |
"net" | |
"os" |
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
hypepass () { | |
if [[ -z $1 ]]; then | |
echo 'Usage: hypepass <USERNAME>' | |
echo 'Generate a user-specific password for allowing someone to peer with your cjdns host' | |
else | |
desired=64 | |
random=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w $(( ${desired} - ${#1} - 1 )) | head -n 1) | |
echo "{ \"user\": \"${1}\", \"password\": \"${1}:${random}\" }" | |
fi | |
} |
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 | |
pkg=$1 | |
if [ "$pkg" = "" -o ! -e "$pkg" ]; then | |
echo "no package supplied" 1>&2 | |
exit 1 | |
fi | |
leadsize=96 | |
o=`expr $leadsize + 8` |
OlderNewer