Skip to content

Instantly share code, notes, and snippets.

View szaydel's full-sized avatar

Sam Zaydel szaydel

  • RackTop Systems
  • Moss Beach
View GitHub Profile
setup_ssh_key ()
{
## Function used to call ssh-copy-id script to copy my primary ssh-pub-key over
## to any new system being setup
## If length of arguments is less than 2
if [ ${#@} -lt 2 ]; then
printf "%s\n" "Not enough arguments, please supply username and hostname." \
"Expected: $0 <username> <hostname>"
return 1
@szaydel
szaydel / gist:1438270
Created December 6, 2011 13:49
Test write with dd and random `skip` offset on each run through the loop
# max=875 min=236; while :; do dd if=/source/data/file-big.out of=/dest/data/file2.out bs=64k skip=$(echo $(( RANDOM % (max - min) + $(echo $RANDOM|cut -b1,2) ** 2 ))) 2>&1|tee -a /tmp/some-logfile.log; sleep 1; done
@szaydel
szaydel / gist:2996203
Created June 26, 2012 14:45
Configuration Failure with of gnu-tar with Homebrew
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU tar configure 1.26, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ ./configure --prefix=/usr/local/Cellar/gnu-tar/1.26 --mandir=/usr/local/Cellar/gnu-tar/1.26/share/man --program-prefix=g
## --------- ##
## Platform. ##
@szaydel
szaydel / graphite-client.py
Created July 6, 2012 06:10 — forked from codification/graphite-client.py
Graphite client in python
import time
import socket
def collect_metric(name, value, timestamp):
sock = socket.socket()
sock.connect( ("localhost", 2003) )
sock.send("%s %d %d\n" % (name, value, timestamp))
sock.close()
def now():
int(time.time())
@szaydel
szaydel / agent.conf
Created November 7, 2012 14:37 — forked from fxtentacle/agent.conf
Hajo's logstash config
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"
@szaydel
szaydel / fish_prompt.fish
Created November 10, 2012 04:16 — forked from terlar/fish_prompt.fish
Prompt for fish with git statuses
set -U fish_color_user magenta
set -U fish_color_host yellow
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
# User
set_color $fish_color_user
printf (whoami)
set_color normal
@szaydel
szaydel / README
Created November 12, 2012 16:48 — forked from bewest/README.markdown
Using pyCLI to create some commands and subcommands.
Using pyCLI to create some commands and subcommands.
@szaydel
szaydel / tmux.md
Created November 12, 2012 22:39 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@szaydel
szaydel / zfs_notes.md
Created February 24, 2013 15:33 — forked from dch/zfs_notes.md

pool management

  • create a new pool by first creating an empty partition space using diskutil or Disk Utility

adding a mirror to an existing pool

check current status

zpool status -v