Skip to content

Instantly share code, notes, and snippets.

View ernstki's full-sized avatar

Kevin Ernst ernstki

  • Earth, Sol
View GitHub Profile
@ernstki
ernstki / plink.cmd
Last active October 28, 2022 02:17 — forked from anonymous/plink.cmd
A simple batch wrapper around PuTTY's PLINK.EXE to fix EGit/Pageant integration on Windows for non-standard SSH port numbers
@ernstki
ernstki / post-receive.passenger
Created July 14, 2014 04:51
Sample Git post-receive hook for a Rails/mod_rails app
#!/bin/bash
set -x
export GIT_WORK_TREE=/var/www/tm
export RAILS_ENV=mod_rails
if [ ! -d "$GIT_WORK_TREE" ]; then
echo "ACK! The specified working tree ($GIT_WORK_TREE) doesn't exist. Quitting." >&2
exit 3
fi
git checkout -f dev
@ernstki
ernstki / post-receive.webhost
Last active May 29, 2019 22:23
A basic Git post-receive hook that will publish a sequence of similarly-named projects to a common web-accessible subfolder
#!/bin/bash
####################################################################
## ##
## post-receive.webhost ##
## ##
## A Git 'post-receive' hook for automating deployment to a ##
## public web directory based on the name of the "bare" repo ##
## that it belongs to. ##
## ##
## Rename to 'post-receive' and 'chmod a+x', then move this ##
@ernstki
ernstki / quadratic.html
Last active August 29, 2015 14:04 — forked from anonymous/jsbin.qoxalize.html
JavaScript source to create quadratic curves between successive points drawn with the mouse
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<meta charset=utf-8 />
<title>quadraticCurveTo given three points</title>
<style>
body { background:#000; margin:0px; padding:0px; overflow:hidden; }
@ernstki
ernstki / ldap-query-last-first.sh
Last active August 29, 2015 14:05
Query Davmail LDAP server for "LastName, FirstName" from input file and prepare output suitable for Listserv bulk subscription
#!/bin/bash
# Query an LDAP server (assuming OWA via DavMail) for "LastName, FirstName"
# given a list of names from an input file passed on the command line; output
# names and emails in a format acceptable to Listserv for bulk subscription.
#
# The input names can be copied from a Blackboard course's Tools -> Send Email
# -> All Users. These are semicolon-separated, so replace these with newlines
# using a global search-and-replace (e.g., in Vi: :%s/; \?/<CTRL+V><CTRL+M>/g,
# where <CTRL+X> is a literal keypress, holding down the Control key).
#
@ernstki
ernstki / fawk.sh
Last active November 7, 2019 01:38
fawk: a Bash shell function to save your fingers from typing awk '{ print $x }' all the time
#!/bin/bash
##############################################################################
## ##
## fawk! - a shortcut for `awk '{ print $x }'` ##
## (also an expression of extreme frustration) ##
## --------------------------------------------- ##
## ##
## Author: Kevin Ernst <ernstki -at- mail.uc.edu> ##
## Inspiration: http://serverfault.com/a/5551 (but basically rewritten) ##
## Mnemonic: "Field Awk" ##
@ernstki
ernstki / index.html
Created January 25, 2015 12:28
Appearing/disappearing message box with CSS transitions only // source http://jsbin.com/yoyada
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Appearing/disappearing message box with CSS transitions only" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.box {
border: 1px solid black;
height: 5em;

Keybase proof

I hereby claim:

  • I am ernstki on github.
  • I am ernstki (https://keybase.io/ernstki) on keybase.
  • I have a public key whose fingerprint is 13CE B335 8962 AF0C 4489 FD84 DE5F FAB6 821A 05EB

To claim this, I am signing this object:

@ernstki
ernstki / udacity-cs344-cmake-fixes-kme.diff
Last active November 18, 2016 19:54
Patch file to get Udacity CS344 course materials to compile on OSC's Oakley cluster
--- CMakeLists.txt.orig 2016-11-13 18:49:46.528795000 -0500
+++ CMakeLists.txt 2016-11-13 18:52:36.459490000 -0500
@@ -21,7 +21,6 @@
# to make sure more people can easily run class code without knowing
# about this compiler argument
set(CUDA_NVCC_FLAGS "
- -ccbin /usr/bin/clang;
-gencode;arch=compute_30,code=sm_30;
-gencode;arch=compute_35,code=sm_35;
-gencode;arch=compute_35,code=compute_35;
@ernstki
ernstki / flaskapp-wsgi.conf
Last active April 5, 2019 21:33
Minimum-viable Flask, Apache + mod_wsgi configuration
##############################################################################
# A basic, functional Apache <VirtualHost> configuration stanza for
# mod_wsgi might look something like what's below.
#
# On an Amazon AMI ECS instance, I would save this in to a config file
# called /etc/httpd/conf.d/flaskapp-wsgi.conf and then 'sudo service httpd
# restart'.
#
# Helpful References:
# - http://flask.pocoo.org/docs/0.11/deploying/mod_wsgi/#configuring-apache