Skip to content

Instantly share code, notes, and snippets.

View waynegraham's full-sized avatar

Wayne Graham waynegraham

View GitHub Profile
@waynegraham
waynegraham / README.md
Last active October 29, 2021 14:05
Youtube-dl on macos

Youtube-dl is a popular commandline utility to download content from YouTube (among many other sites).

Install Youtube-dl

Open a termianl and type:

brew install youtube-dl ffmpeg
@waynegraham
waynegraham / convert_word_to_pdf.sh
Created July 28, 2021 12:37
Convert Word to pdf
#! /bin/bash
for file in *.doc; do
textutil -convert docx "$file"
# Account for the new `x` in `docx`
pandoc -o "${file%doc}pdf" "${file}x"
done
@waynegraham
waynegraham / wordpress_theme_deploy.md
Last active June 23, 2021 17:35
Deploy wordpress theme via git

Deploying WordPress Theme via Git

I needed to deploy a child theme to a server for folks to check out the development. I went with a git remote to get the good stuff from git to quickly recover if (when) I break something.

Server Setup

On the server, I created a new directory:

$ sudo mkdir -p /var/repos/theme_name.git
@waynegraham
waynegraham / postdocs.rb
Created June 16, 2021 17:38
Parse postdoc URIs from sitemap
require 'nokogiri'
require 'open-uri'
sitemaps = [
'https://www.clir.org/page-sitemap1.xml',
'https://www.clir.org/page-sitemap2.xml'
]
xml = Nokogiri::XML(URI.open(sitemaps[0]))
# urls = xml.search('url')
@waynegraham
waynegraham / Gemfile
Created April 28, 2021 20:05
Check Resource Counts
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "mechanize"
gem 'progress_bar'
gem 'terminal-table'
@waynegraham
waynegraham / continentCodes.txt
Created October 22, 2012 16:08
Download and import geonames data
AF,Africa,6255146
AS,Asia,6255147
EU,Europe,6255148
NA,North America,6255149
OC,Oceania,6255151
SA,South America,6255150
AN,Antarctica,6255152
@waynegraham
waynegraham / notes.md
Created October 16, 2015 13:27
Capistrano deployment with Travis

Setup

On a development machine, install the Travis CLI gem and login. You'll then need to encrypt a password to decrypt the private key.

$ gem instal travis
$ travis login
$ travis encrypt DEPLOY_KEY="password for encryption" --add
@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
@waynegraham
waynegraham / README.md
Created November 3, 2020 11:36
List links in a GoogleDrive directory
@waynegraham
waynegraham / gist:196c44e13e3afb494d113621e0c3c1b5
Created October 13, 2020 17:08
Find large directories in linux
du -a /home | sort -n -r | head -n 5