Skip to content

Instantly share code, notes, and snippets.

View woodie's full-sized avatar

John Woodell woodie

View GitHub Profile
$ uname -a
Linux pi 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux
$ sudo apt-get -y upgrade openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ ssh-keygen -t ed25519
unknown key type ed25519
@woodie
woodie / example.rb
Last active February 12, 2023 18:40
App Engine STandard Ruby
# app.rb
require "sinatra"
get "/status" do
<<~HTML
<h1>Hello Status!</h1>
<img src="images/cloud.png">
<p>The environment is #{ENV['APP_ENV'] || 'unknown'}.</p>
HTML
end
@woodie
woodie / midi_keypad.md
Last active June 8, 2021 19:50
A little program to capture input from a keypad and change programs on the midi device.
@woodie
woodie / prompt.bash
Created May 16, 2021 20:49
The git status prompt I've been using for years
# username@ ~/workspace/repo (branch)
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\] \[\033[33;1m\]\w\[\033[m\] (\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \$ "
name: Add new issues to project board
on:
issues:
types: [opened]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
name: Set new issues with Monday details
on:
issues:
types: [opened]
jobs:
set-new-issues-with-monday-details:
runs-on: ubuntu-latest
steps:
#!/bin/bash
# Keep this associative array up-to-date based on perforce packages
declare -A releases=( ["12.04"]="precise" ["14.04"]="trusty" ["16.04"]="xenial")
# https://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.install.html#install.linux.packages
os_name=`grep ^NAME= /etc/os-release | cut -c6- | tr -d '"'`
if [[ $os_name != "Ubuntu" ]] ; then
echo 'Sorry, only for Ubuntu.'
exit 1
@woodie
woodie / README.rdoc
Created March 17, 2010 08:35
Rails 3 on App Engine

Rails 3.0.pre on App Engine

You can Rails 3 on App Engine, but it won’t be especially useful until bundler 10. You should try these instead:

Install the Development Environment

The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.

@woodie
woodie / iis_mail.rb
Last active December 15, 2016 23:02
Local mail delivery on Windows Server using IIS SMTP Service
# config/environments/production.rb
# Local mail delivery using IIS SMTP Service
require 'shim/mail_message' # fix line endings
config.action_mailer.delivery_method = :file
config.action_mailer.file_settings = { location: "#{ENV['SystemDrive']}/InetPub/MailRoot/Pickup" }
# lib/shim/mail_message.rb
# Patch Mail::Message to enforce proper line-endings for Windows IIS file-type delivery.
module Mail
class Message
@woodie
woodie / usr_local_bin_typescript
Last active December 27, 2015 13:29
I use this wrapper to run TypeScript files on-the-fly.
#!/usr/bin/env bash
TSFILE=${@##*/}
JSFILE=${TSFILE/%ts/js}
MD5DIR=`md5 -q ${@}`/
if [ ! -d $TMPDIR$MD5DIR ]; then
mkdir $TMPDIR$MD5DIR
fi
if [ ! -f $TMPDIR$MD5DIR$JSFILE ] || [ ${@} -nt $TMPDIR$MD5DIR$JSFILE ]; then
tsc --outDir $TMPDIR$MD5DIR ${@}
fi