Skip to content

Instantly share code, notes, and snippets.

@shawn-sterling
shawn-sterling / graphite
Created February 14, 2012 21:30 — forked from drawks/graphite
Graphite on uwsgi/nginx
#This is the "site config" for nginx
upstream django {
# Distribute requests to servers based on client IP. This keeps load
# balancing fair but consistent per-client. In this instance we're
# only using one uWGSI worker anyway.
ip_hash;
server unix:/tmp/uwsgi.sock;
}
server {
@shawn-sterling
shawn-sterling / derived-value-migrate.py
Created May 15, 2012 19:08 — forked from mleinart/derived-value-migrate.py
Modify data in existing whisper files to be derived from existing counter values
#!/usr/bin/env python
import sys, time, whisper, shutil
from optparse import OptionParser
now = int( time.time() )
option_parser = OptionParser(
usage='''%prog path from''')
@shawn-sterling
shawn-sterling / mate-terminal.spec
Created January 20, 2013 00:12
mate-terminal spec fix
Summary: Terminal emulator for MATE
Name: mate-terminal
Version: 1.5.0
Release: 2%{?dist}
License: GPLv3+
Group: User Interface/Desktops
URL: http://mate-desktop.org
Source0: http://pub.mate-desktop.org/releases/1.5/%{name}-%{version}.tar.xz
" ---------------------------------------------------------------------------
" -- Vundle Settings --
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
"-- Vundle Settings end --
" ---------------------------------------------------------------------------
" -- vundle -- vim bundle tool (thank jebus)
@shawn-sterling
shawn-sterling / gist:6410245
Created September 2, 2013 07:50
jenkins stack trace
Stack trace
javax.servlet.ServletException: java.lang.Error: java.io.IOException: <html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.0.15</center>
</body>
</html>
@shawn-sterling
shawn-sterling / gist:6631845
Created September 20, 2013 00:35
handy history file
# cat histfile.sh
export HISTFILE=~/.bash_history_$(who -m |awk '{print $1}')
export HISTSIZE=9999
export HISTFILESIZE=999999
export HISTCONTROL=''
export HISTIGNORE=''
export HISTTIMEFORMAT='%F %T %Z '
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'history -a'
readonly HISTFILE
readonly HISTFILESIZE
@shawn-sterling
shawn-sterling / gist:9774519
Created March 26, 2014 00:29
hiera-eyaml problem
puppet apply site.pp --noop --debug --trace --color=no
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
hostname: Unknown host
Debug: importing '/etc/puppet/environments/master/modules/role/manifests/base.pp' in environment master
@shawn-sterling
shawn-sterling / gist:84ee929c54542e5119d1
Created June 24, 2014 21:20
gather info for virtual cpus
#!/bin/bash
CPULIST=$(ls -d /sys/devices/system/cpu/cpu[0-9]* |sort -tu -k3 -n)
echo "shared L2 cache (cat /sys/devices/system/cpu/cpu[0-9]*/cache/index2/shared_cpu_map)"
for i in $CPULIST; do
A=$(printf $i|cut -d"/" -f6)
printf "$A - "
cat $i/cache/index2/shared_cpu_map
done
# puppet master:
[root@qa-pmaster common]# puppetserver gem list |grep hiera
hiera-eyaml (2.0.7)
hiera-eyaml-gpg (0.5.rc1)
[root@qa-pmaster common]# gem list |grep hiera
hiera-eyaml (2.0.7)
hiera-eyaml-gpg (0.5.rc1)
@shawn-sterling
shawn-sterling / shell-multiple-choice-quiz.py
Created August 19, 2016 07:23 — forked from philippkeller/shell-multiple-choice-quiz.py
base code of stage 1 and 2 of sysengquiz3
import urwid, random, re, time
blank = urwid.Divider()
palette = [
('body','light gray','black', 'standout'),
('reverse','light gray','black'),
('header','white','dark red', 'bold'),
('important','dark red','black',('standout','underline')),
('editfc','white', 'dark blue', 'bold'),
('editbx','light gray', 'dark blue'),