Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Nick Hobart nwhobart

🚀
View GitHub Profile
View gist:309d867d75d6667b35b2
echo "Running a check on your DB creds"
mysql -u backup -p$mysqlpass -h $host -e "SHOW DATABASES;" &>/dev/null
rc=$?; if [[ $rc != 0 ]]; then echo "not working; check your creds" && exit $rc; fi
@nwhobart
nwhobart / aws-deploy.sh
Last active Oct 27, 2015
How we deploy to AWS Elastic Beanstalk with multiple sumo logic accounts.
View aws-deploy.sh
#!/bin/bash
# simple script for using eb deploy in a bash script
app=$(cat config/application.rb |grep -i "module" |awk '{ print tolower ($2) }' )
current_date=$(date +"%Y%m%d-%T%Z")
current_user=$(whoami)
if [ ! -f .elasticbeanstalk/config.yml ]; then
echo "You need to run 'eb init' first!"
else
@nwhobart
nwhobart / 0006_sumologic.config
Created Nov 9, 2015
Our ebextension for sumologic.
View 0006_sumologic.config
packages:
rpm:
SumoCollector: https://collectors.sumologic.com/rest/download/rpm/64
services:
sysvinit:
collector:
enabled: true
ensureRunning: true
files:
View keybase.md

Keybase proof

I hereby claim:

  • I am hobakill on github.
  • I am hobart (https://keybase.io/hobart) on keybase.
  • I have a public key ASB1OLdjeTVyPeO_eSL-zT09ejXr0tvrmMDqxecYg3xKGAo

To claim this, I am signing this object:

View util.js
// Hide on click.
if (config.hideOnClick) {
$this.find('a')
.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)');
$this
.on('click', 'a', function(event) {
var $a = $(this),
View FML.sh
#!/usr/bin/env bash
ssh -t user@server.com 'df -h'
^^^^^^ does not work ^^^^^^^
ssh: command not found
------------------------------------------
#!/usr/bin/env bash
View s3mysqlbackup.sh
#!/bin/bash
# Basic variables
mysqlpass="########"
bucket="s3://#####-prod-data-####/######-#"
host="####-########-rds-platform-1.######.us-east-1.rds.amazonaws.com"
# Timestamp (sortable AND readable)
stamp=`date +"%s - %A %d %B %Y @ %H%M"`
View closures.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
65528132135,DOT610908,DOT_SE,DOT Special Event Permit,Festival,Festival,Closed,Complete,06/09/2017,06/12/2017,06/09/2016,06/09/2016,06/09/2016,06/20/2016,Green Music Fest,"This event serves to educate the public in sustainable practices and adds to the marketing efforts of the Wicker Park Chamber of Commerce to expose the community to new potential consumers. The event features live music, local retail and food vendors, plus family activities and ""green"" exhibitors",$100.00,,CRITERION PRODUCTIONS,,,4753 N Broadway,Ste. 800,CHICAGO,IL,60640,Matt Marsden,,,,,,1400,1573,N,DAMEN,AVE,,Full,6/17/2016 11:59PM - 6/20/2016 5:00AM,,1162767,1909454,41.907194665,-87.677522231,"(41.90719466503503, -87.67752223070566)"
65528132134,DOT610908,DOT_SE,DOT Special Event Permit,Festival,Festival,Closed,Complete,06/09/2017,06/12/2017,06/09/2016,06/09/2016,06/09/2016,06/20/2016,Green Music Fest,"This event serves to educate the public in sustainable practices and adds to the marketing efforts of the Wicker Park Chamber of Commer
View keybase.md

Keybase proof

I hereby claim:

  • I am hobakill on github.
  • I am hobart (https://keybase.io/hobart) on keybase.
  • I have a public key ASCFP3bRc1lGG_q9M37LYJCKhLVUM95WzV2m7P8JYdKQSwo

To claim this, I am signing this object:

@nwhobart
nwhobart / tempcheck.py
Created Sep 24, 2018
Temperature check
View tempcheck.py
#!/usr/bin/env python3
import geocoder
import argparse
import json
from darksky import forecast
tomkey = ''
darkkey = ''
locations = {