Skip to content

Instantly share code, notes, and snippets.

View waynegraham's full-sized avatar

Wayne Graham waynegraham

View GitHub Profile
@waynegraham
waynegraham / gist:196c44e13e3afb494d113621e0c3c1b5
Created October 13, 2020 17:08
Find large directories in linux
du -a /home | sort -n -r | head -n 5
@waynegraham
waynegraham / translate.rb
Created July 24, 2020 14:27
Arabic Translation vs Transliteration
require 'dotenv'
require 'any_ascii'
require 'aws-sdk-translate'
Dotenv.load
class String
def is_western?
count('a-zA-Z') > 0
@waynegraham
waynegraham / Gemfile
Created July 22, 2020 15:09
Spatial Test
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'colorize'
gem 'geo_names'
gem "geocoder"
@waynegraham
waynegraham / env.sh
Created November 13, 2019 20:15
ZSH custom env
#! /bin/zsh
# Add commonly used folders to $PATH
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
for bindir in $HOME/local/bin $HOME/bin; do
if [ -d $bindir ]; then
PATH=$PATH:${bindir}
fi
done
@waynegraham
waynegraham / password.sh
Last active November 13, 2019 20:14
Password generator in zsh
#! /usr/bin/env zsh
if [ -z "$1" ]
then
length=18
else
length=$1
fi
openssl rand -base64 $length
@waynegraham
waynegraham / Vagrantfile
Created August 27, 2019 15:57
Migrate Sympa to Listserv
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get upgrade
apt-get install -y python libmail-mboxparser-perl
2018-06-26 21:43:28 INFO Zope Ready to handle requests
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'SOAPUtil' from module 'contextual.higherlogic.soaputil.SOAPUtil'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'VocabularyLibrary' from module 'Products.ATVocabularyManager.tools.vocabularylib'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'FormGenTool' from module 'Products.PloneFormGen.tools.formGenTool'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'SmartlinkConfig' from module 'redturtle.smartlink.utility'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'ISmartlinkConfig' from module 'redturtle.smartlink.interfaces.utility'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'IDropdownSpecific' from module 'webcouturier.dropdownmenu.browser.interfaces'
2018-06-26 21:43:28 WARNING OFS.Uninstalled Could not import class 'ICollectivePortletClassLayer' from module 'collective.portletclass.inte
@waynegraham
waynegraham / api.md
Created April 5, 2018 15:13
API prototype
{
  //Metadata about this manifest file
  "@context": "https://api.clir.org/grants/1/context.json",
  "@id": "https://www.example.edu/grants/grant##/manifest",
  "@type": "sc:Manifest",
  // Descriptive metadata about the object/work
  "label": "Recording 1",
  "metadata": [
 {"label": "Name", "value": "Object name"},
@waynegraham
waynegraham / jekyll-deploy.md
Last active March 21, 2018 20:06
Travis deployment of Jekyll sites with Let's Encrypt on Ubuntu.
@waynegraham
waynegraham / converts.sh
Created February 14, 2018 16:19
ImageMagic convert for icons
# IE is still braindead so still use favicon.ico
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico
convert output-16x16.ico output-32x32.ico favicon.ico
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32">