Skip to content

Instantly share code, notes, and snippets.

View UtahDave's full-sized avatar

David Boucha UtahDave

View GitHub Profile
nginx:
pkg.installed: []
service.running:
- require:
- pkg: nginx
php-fpm:
pkg.installed: []
service.running:
- name:
- require:
- pkg: php-fpm
#!/bin/bash
touch /tmp/Recent.xyz
while true
do
echo "Checking again..."
wget -q https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/Release -O /tmp/Release.xyz
if test /tmp/Release.xyz -nt Recent.xyz; then
mplayer /usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg
@UtahDave
UtahDave / jqfilter.sh
Created May 27, 2016 18:03 — forked from deybhayden/jqfilter.sh
jq filter a list of objects' values
aws elasticbeanstalk describe-configuration-settings --application-name foo --environment-name foo-staging | jq '.ConfigurationSettings[0].OptionSettings[] | select(.OptionName=="Notification Topic ARN")'
{% for server, addrs in salt['mine.get']('roles:docker', 'network.ip_addrs', expr_form='grain').items() %}
{% if '*web1*' in server %}
server {{ server }} {{ addrs[0] }}:443 check inter 2000 rise 2 fall 5
{% endif %}
{% endfor %}
@UtahDave
UtahDave / System Design.md
Created April 20, 2016 21:30 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@UtahDave
UtahDave / salt-msi-instructions.md
Created March 18, 2016 20:23
How to build Windows Installer (MSI) packages for SaltStack

Build environment (in order):

  • Microsoft Windows Server 2008 R2 Standard w/ SP1
  • Microsoft Visual Studio 2008 (all features)
  • Microsoft Windows SDK for Windows 7 and .NET Framework 4 (all features)
  • Python 2.7.11 (all features, skip byte compilation of .py files)
  • Run WindowsSdkVer.exe -version:v7.1 as an administrator in order to register the SDK properly with Visual Studio 2008.
  • Run pip install -U setuptools as an administrator in order to update the bundled version of setuptools.
  • Patch distutils per http://bugs.python.org/issue15797.

Obtaining sources:

@UtahDave
UtahDave / Documentation.md
Created January 29, 2016 23:38 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@UtahDave
UtahDave / Apache_rewrite_to_Amazon_S3.txt
Created January 29, 2016 22:20 — forked from NapoleonWils0n/Apache_rewrite_to_Amazon_S3.txt
apache: apache rewrite to amazon s3 bucket
<Directory "/www/sitename/folder/">
<IfModule mod_rewrite.c>
RewriteEngine ON
RewriteRule ^(.*) http://bucktname.s3.amazonaws.com/folder/$1
</IfModule>
</Directory>
@UtahDave
UtahDave / cmd.sh
Created December 10, 2015 19:45 — forked from theladyjaye/cmd.sh
clear salt minion cache
salt '*' cmd.run 'rm -rm /var/cache/salt/minion/files/base/*'
salt '*' saltutil.sync_all