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
sudo apt-get install software-properties-common -y | |
sudo apt-add-repository ppa:ansible/ansible -y | |
sudo apt-get update -y | |
sudo apt-get install ansible -y |
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
sudo yum install cloud-utils -y |
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
{% for k,v in hostvars[inventory_hostname].iteritems() %} | |
{{ k }}: {{ v }} | |
{% endfor %} |
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
/etc/facter/facts.d/ # when admin/root | |
<HOME DIRECTORY>/.facter/facts.d/ # when not running facter as admin | |
# why is it so hard to google for that!? | |
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 cls="ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(\"%0o \",k);print}'" |
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
read -s; export OS_PASSWORD=$REPLY |
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
require 'nokogiri' | |
require 'csv' | |
kml_path = '/path/to/Google Drive/My Tracks/' | |
def kml_file_paths path | |
Dir.glob(path + "*.kml") | |
end | |
csv = CSV.open('mytracks.csv', "wb") |
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 subprocess | |
import string | |
# import smtplib for sending email | |
import smtplib | |
# execute exim queue count command | |
proc = subprocess.Popen(['/usr/sbin/exim','-bpc'], stdout=subprocess.PIPE) | |
mail_count = int(proc.stdout.read()) |
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
template_values = { | |
} | |
path = os.path.join(os.path.dirname(__file__), 'index.html') | |
self.response.out.write(template.render(path, template_values)) |
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 os | |
from django.template import Template, Context | |
from google.appengine.ext.webapp import template | |
def render_view(view_name, template_dict = {}): | |
path = os.path.join(os.path.dirname(__file__), view_name) | |
f = open(path, 'r') | |
view_str = f.read() | |
t = Template(view_str) | |
return t.render(Context(template_dict)) |