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
import requests | |
import sys | |
import time | |
import os | |
def main(): | |
trigger_url = sys.argv[1] | |
trigger_resp = requests.get(trigger_url) |
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
# SETUP DOCKER | |
sudo bash | |
docker ps | |
apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; https://autohotkey.com/docs/KeyList.htm | |
; left hand mouse config | |
; Accidently hitting numlock a lot...maybe move 'homerow' from 789' to '456'? |
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 | |
BASE='https://raw.githubusercontent.com/stevemao/diff-so-fancy/master/' | |
for i in diff-so-fancy diff-highlight; do | |
wget -O ~/bin/$i ${BASE}${i} | |
chmod +x ~/bin/$i | |
done; | |
git --version && git config --global core.pager "diff-highlight | diff-so-fancy | less --tabs=1,5 -R" |
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
# 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
$ 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
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
# 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
function tm { | |
TMUXNAME=${1:-"default"} | |
if tmux ls | grep "^$TMUXNAME:"; then | |
tmux attach -d -t $TMUXNAME | |
else | |
tmux new -s $TMUXNAME | |
fi | |
} |
NewerOlder