Skip to content

Instantly share code, notes, and snippets.

View djha-skin's full-sized avatar
💭
Hello again.

Daniel Jay Haskin djha-skin

💭
Hello again.
View GitHub Profile
from Levenshtein import distance
import subprocess
import re
import sys
import pprint
print("Running terraform plan...", file=sys.stderr)
proc = subprocess.run(
@djha-skin
djha-skin / Feedly.opml
Created August 23, 2022 07:27
August 2022 Feedly OPML
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Daniel subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="Software" title="Software">
<outline type="rss" text="PingCAP Blog RSS Feed" title="PingCAP Blog RSS Feed" xmlUrl="https://pingcap.com/blog/index.xml" htmlUrl="https://pingcap.com"/>
<outline type="rss" text="f : ⊥ x ⊥ → ⊥" title="f : ⊥ x ⊥ → ⊥" xmlUrl="http://arrdem.com/atom.xml" htmlUrl="https://www.arrdem.com"/>
@djha-skin
djha-skin / CANDL.md
Last active July 18, 2022 14:58
Convenient Arbitrarily Nestable Document Language

This Document Has Moved

This document is no longer being updated at this location. To see an up-to-date version, head over to its new home.

CANDL

Convenient
Arbitrarily
Nestable
@djha-skin
djha-skin / st2scheduler-scrubbed.log
Created December 19, 2018 19:59
Stackstorm Concurrency Error
2018-12-18 23:18:56,684 140672270229168 INFO handler [-] Scheduling liveaction: second_task_run (queue_item_id=5c19c6b022edb20192bc631f) (queue_item_id='5c19c6b022edb20192bc631f',liveaction_id='second_task_run')
2018-12-18 23:18:56,688 140672270229168 DEBUG policies [-] Applying pre-run policies for liveaction "second_task_run".
2018-12-18 23:18:56,690 140672270229168 DEBUG policies [-] Getting driver for policy "my_pack.my_pack.concurrency" (action.concurrency).
2018-12-18 23:18:56,690 140672270229168 DEBUG policies [-] Identified 1 policies for the action "my_pack.my-task".
2018-12-18 23:18:56,693 140672270229168 DEBUG concurrency [-] ConcurrencyApplicator is attempting to acquire lock "action=my_pack.my-task,policy_type=action.concurrency".
2018-12-18 23:18:56,693 140672270229168 INFO policies [-] Applying policy "my_pack.my_pack.concurrency" (action.concurrency) for liveaction "second_task_run".
2018-12-18 23:18:56,694 140672265936400 DEBUG connection [-] Sending request(xid=18): Exists(path=u'/tooz/locks
@djha-skin
djha-skin / Main.hs
Created November 18, 2018 02:24
Haskell JSON-RPC nested struct server example
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
-- The purpose of this RPC example is to show how to define a method using
-- JSON-RPC in Haskell without having to explicitly write the deserialization
-- code. It also shows at the same time that nested structs in the `params`
-- object in the RPC call are possible and even easy.
--
-- It is built off of the original json-rpc server example, found here:
@djha-skin
djha-skin / 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'
@djha-skin
djha-skin / png2icns
Created December 21, 2016 19:19
Convert PNG file to ICNS file
# Stolen from here: http://stackoverflow.com/a/20703594/850326
#!/bin/sh
export POSIXLY_CORRECT=1
if [ -z "${1}" -o -z "${2}" ]
then
echo "Usage: ${0} <name> <original-png-location>"
fi
name=$1
@djha-skin
djha-skin / 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
@djha-skin
djha-skin / 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