Skip to content

Instantly share code, notes, and snippets.

View zhimsel's full-sized avatar

Zach Himsel zhimsel

View GitHub Profile
#!/usr/bin/env python2
"""s3_apt_wrapper
Manage an S3-backed APT repository and its packages.
This script requires the 'deb-s3' tool to be installed and executable via $PATH
https://github.com/krobertson/deb-s3
Usage:
s3_apt_wrapper --help
@zhimsel
zhimsel / userscript.js
Created January 27, 2016 20:40
Fluidapp Dock Badge for Asana Notifications
window.fluid.dockBadge = "";
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 1000);
function updateDockBadge() {
var inbox = document.getElementsByClassName("has-newNotifications");
if (Object.keys(inbox).length > 1) {
window.fluid.dockBadge = "•";
#!/bin/sh
# This script will monitor another NAT instance and take over its routes
# if communication with the other instance fails
# NAT instance variables
# Other instance's IP to ping and route to grab if other node goes down
NAT_ID=
NAT_RT_ID=
# My route to grab when I come back up
@zhimsel
zhimsel / restart_apache-update-openssl
Created June 19, 2014 01:20
openssl update script
#!/bin/bash
while read server; do
ssh $server 'ps cax | grep httpd > /dev/null; if [ $? -eq 0 ]; then echo "httpd is running"; yum update -y openssl && service httpd restart ; else echo "httpd is not running"; yum update -y openssl; fi'
done < $1
#!/bin/bash
# define some functions
######################################
# command
run_command () {
echo ""
echo "----------------------"