Skip to content

Instantly share code, notes, and snippets.

View jlaustill's full-sized avatar
💭
I may be slow to respond.

Joshua Austill jlaustill

💭
I may be slow to respond.
View GitHub Profile
@jlaustill
jlaustill / gitStatsAllTime.sh
Last active April 8, 2021 20:46
Get the user stats for the previous month from a git repo
#!/usr/bin/env bash
format=${1:-pretty}
#if [[ "$OSTYPE" == "linux-gnu" ]]
#then
#from=$(date -d "last month" +"%d %b %Y")
#to=`date +"%d %b %Y"`
#else
#from=`date -v-1m`
#to=`date`
#fi
#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
# echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 80 ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as of $(date)"
fi
done
@jlaustill
jlaustill / ..OptimizeImages.md
Last active July 26, 2017 18:47
A simple script to recursively optimize every image(jpeg|gif|png) in a folder.

This simple script will find every jpg, gif, and png in a directory recursively and optimize it using google's pagespeed recommended settings.

Depends on ImageMagick's convert plugin. Pass folder to optimize as first parameter.

@jlaustill
jlaustill / MagentoAuthStep3.js
Created October 20, 2016 14:30
The 3rd and final step in getting a permanent token from Magento REST API 1.x
var request = require('request');
var consumerKey = "57d84828608840c7dbaa637f2f66ee13",
consumerSecret = "82fbea317ff08682cdd73d9eb242f0c7",
token= "ce50bf275b8face27b9f6c43c91f9058",
token_secret="13a59b2e7547b239d116b62b35142528",
verifier="399860495fab9eea64b69375fd5c5aca",
siteUrl = "http://dev.yoursite.com";
// step 3
@jlaustill
jlaustill / MagentoAuthStep1.js
Last active November 1, 2018 09:59
The first step in getting a token from Magento 1.x REST API
var request = require('request');
var consumerKey = '57d84828608840c7dbaa637f2f66ee13',
consumerSecret = "82fbea317ff08682cdd73d9eb242f0c7",
siteUrl = "http://dev.yoursite.com";
// step 1
var qs = require('querystring'),
oauth = {
callback : 'http://thisis.broken/callback/',