Skip to content

Instantly share code, notes, and snippets.

View djhaskin987's full-sized avatar

Daniel Jay Haskin djhaskin987

View GitHub Profile
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@djhaskin987
djhaskin987 / PFDS_Chapter2.ml
Created December 18, 2013 01:53
Chris Okasaki's "Purely Functional Data Structures", Chapter 2 Excercises
(* Excercise 2.1
* We proceed by induction.
* If 'lst' is an empty list, we simply return lst itself.
* If 'lst' is a non-empty list, we store the pointer to the tail of the list,
* plus any pointers stored by a recursive call to suffixes.
* []
*)
let rec suffixes lst =
match lst with
[] -> lst
@djhaskin987
djhaskin987 / openpgp.txt
Created February 10, 2016 23:10
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:f54cff731e7e01c3ae749b30d62daa3e080e17a9]
@djhaskin987
djhaskin987 / header_of_pwfile.gpg
Last active May 26, 2016 15:52
For use with keeping track of passwords with gnupg.vim in encrypted text files
# vim: nobackup nowritebackup noswapfile bufhidden=wipe tw=0 conceallevel=2 concealcursor=nvc foldmethod=syntax syntax=password
@djhaskin987
djhaskin987 / functions
Last active July 31, 2016 05:51
Useful Clojure Macros
(defn assoc-conj
"Conjoin a value onto the list corresponding to the key `k` in `mp`."
[mp k v]
(if (empty? mp)
{k [v]}
(if (empty? (mp k))
(assoc mp [v])
(assoc mp
(conj (mp k)
v)))))
@djhaskin987
djhaskin987 / rdp.sh
Created August 30, 2016 14:33
Options to use with XFreeRDP
#!/bin/sh
set -x
xfreerdp \
"${@}"
+clipboard \
+compression \
/audio-mode:2 \
/network:lan \
/cert-ignore \
@djhaskin987
djhaskin987 / update-alternatives-directory.sh
Created December 12, 2016 15:32
Update alternatives in a directory
set -x
dir="${1}"
for i in $(ls -1A $dir)
do
if [ -x ${dir}/${i} ]
then
update-alternatives --install /usr/bin/${i} ${i} ${dir}/${i} 1
fi
done
@djhaskin987
djhaskin987 / build-screen.sh
Last active December 12, 2016 19:14
Install screen with 256 color support on mac
#!/bin/sh
export POSIXLY_CORRECT=1
set -xe
git clone git://git.savannah.gnu.org/screen.git
cd screen/src
sudo mkdir -p /etc/opt/screen
./autogen.sh
./configure --prefix=/opt/djhaskin987/screen --sysconfdir=/etc/opt/djhaskin987/screen/ --localstatedir=/var/opt/djhaskin987/screen/ --enable-colors256
@djhaskin987
djhaskin987 / mistral_logs
Created June 28, 2018 22:09
mistral_hangs
2018-06-28 21:38:37.101 29017 INFO mistral.notifiers.notification_server [req-22840e07-dbe4-4213-9ab7-a2b6ae0fe840 - - - - -] Received RPC request 'notify'[ex_id=fca02cf9-e359-4f15-8399-f87fed8f5b51, event=WORKFLOW_FAILED, timestamp=2018-06-28T21:38:36.000000, data={u'workflow_name': u'examples.mistral-basic', u'updated_at': u'2018-06-28 21:38:36', u'workflow_id': u'39a0a055-68f9-439c-8475-7ecde31af63f', u'id': u'fca02cf9-e359-4f15-8399-f87fed8f5b51', u'state_info': u"Failure caused by error in tasks: task1\n\n task1 [task_ex_id=a9cfeda0-d8ee-4f00-bddf-d807a12ab25d] -> {status: 404, cookies: {}, encoding: None, url: http://127.0.0.1/api/v1/executions, elapsed: 0.006918, content: {u'faultstring': u'The resource could not be found.'}, headers: {u'Content-Length': u'57', u'Access-Control-Allow-Headers': u'Content-Type,Authorization,X-Auth-Token,St2-Api-Key,X-Request-ID', u'Access-Control-Expose-Headers': u'Content-Type,X-Limit,X-Total-Count,X-Request-ID', u'X-Request-ID': u'015a26a0-512d-4570-9706-e85736050037'