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 | |
# Customize variables: | |
RCFILE=~/.bashrc | |
MODULES=( | |
"XML::Simple" | |
"DateTime::Event::Cron" | |
"Switch" | |
"LWP::Simple" | |
) |
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
function tm { | |
TMUXNAME=${1:-"default"} | |
if tmux ls | grep "^$TMUXNAME:"; then | |
tmux attach -d -t $TMUXNAME | |
else | |
tmux new -s $TMUXNAME | |
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
# Requires modules: puppetlabs-apache, puppetlabs-mysql | |
exec { 'apt_get_update': | |
command => '/usr/bin/apt-get update', | |
} | |
-> | |
Package <| |> | |
# Default | |
Exec { |
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 sdo='sudo docker' | |
function dockinfo { | |
if [ -z "$1" ] ; then | |
echo "dockinfo usage: dockinfo <container> [inspect format string]" | |
echo -e """ Example inspection elements:\n "Args"\n "Config"\n "Created"\n "Driver"\n "ExecDriver"\n "HostConfig"\n "HostnamePath"\n "HostsPath"\n "Id"\n "Image"\n "MountLabel"\n "Name"\n "NetworkSettings"\n "Path"\n "ProcessLabel"\n "ResolvConfPath"\n "State"\n "Volumes"\n "VolumesRW"\n""" | |
# Generated list with: sudo docker inspect test_jenkins | grep -Po '^ {4}"\w+"' | |
kill -INT $$ | |
else | |
CONTAINER="$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
$ grep -ri hist ~/.bashrc | grep -v alias | |
# don't put duplicate lines or lines starting with space in the history. | |
#HISTCONTROL=ignoreboth | |
# append to the history file, don't overwrite it | |
shopt -s histappend | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
#HISTSIZE=1000 | |
#HISTFILESIZE=2000 | |
export HISTSIZE=100000 | |
export HISTFILESIZE=50000 |
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
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374: | |
QUEUEID (?:[A-F0-9]+|NOQUEUE) | |
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+ | |
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote} | |
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?) | |
POSREAL [0-9]+(.[0-9]+)? | |
DELAYS (%{POSREAL}[/]*)+ | |
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT} | |
STATUS sent|deferred|bounced|expired |
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 | |
function usage() { echo "Allows scriptable downloading of official Java packages."; | |
echo -e "Options:\n -7: use latest java 7 version\n -v: specify version 6/7\n -u: specify the update version #\n -a: specify x64 or i586"; | |
exit 1; | |
} | |
# Defaults Opts | |
DESTINATION="./" | |
JAVA_VER=6 |
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
Use git for all steps of the process. | |
Write a server that knows how handle a TODO list. Preferably test driven. Initially the server can use a very simple in-memory collection of items. If time permits, we can have it backed with a database living in another docker container. | |
Server: | |
GET /todos | |
PUT /todos {"title": "<TITLE>", "message": "<MESSAGE"}. Returns the location in the header | |
GET /todos/ID Returns single note. | |
POST /todos/ID {"id": "<ID>", "title": "<TITLE>", "message": "<MESSAGE"}. Updates a note | |
POST /search {"title": "<TITLE_SEARCH_STRING>", , "message": "<MESSAGE_SEARCH_STRING"}. Returns all the todos with a title or message that matches the search. Maybe the search string could be a regex. |
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 | |
RELEASE=`lsb_release --codename | cut -f2`; | |
DLDEST="/opt/puppetlabs-release-$RELEASE.deb"; | |
if [[ `dpkg -l | grep -c 'puppetlabs-release'` -gt 0 ]] ; then | |
echo "$DLDEST already installed" | |
else | |
sudo wget http://apt.puppetlabs.com/puppetlabs-release-$RELEASE.deb -O $DLDEST; | |
sudo dpkg -i $DLDEST; | |
sudo apt-get update; | |
sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y puppet; |
OlderNewer