Skip to content

Instantly share code, notes, and snippets.

View saily's full-sized avatar

Daniel Widerin saily

View GitHub Profile
@saily
saily / update.sh
Last active August 29, 2015 14:07
Update buildout including all sources in src dir
#!/bin/sh
spinner() {
# thanks to: http://fitnr.com/showing-a-bash-spinner.html
local pid=$1
local delay=0.075
local spinstr='|/-\'
local infotext=$2
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf "[ %c ] %s" "$spinstr" "$infotext"
#!/bin/bash
#
# supervisord This scripts turns supervisord on
#
# Author: Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd)
# Jason Koppe <jkoppe@indeed.com> adjusted to read sysconfig,
# use supervisord tools to start/stop, conditionally wait
# for child processes to shutdown, and startup later
#
# chkconfig: 345 83 04
@saily
saily / gist:738617b760167ea4527f
Created October 28, 2015 09:32 — forked from dedy-purwanto/gist:11312110
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@saily
saily / supervisord.service
Last active May 28, 2016 18:51 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
ExecStart=${buildout:directory}/bin/supervisord -n
ExecReload=${buildout:directory}/bin/supervisorctl reload
ExecStop=${buildout:directory}/bin/supervisorctl shutdown

Keybase proof

I hereby claim:

  • I am saily on github.
  • I am widerin (https://keybase.io/widerin) on keybase.
  • I have a public key ASBt_C-qgCfevYvxqwqyNCkGSYmSzIsqqs_EEhFxrY7dawo

To claim this, I am signing this object:

@saily
saily / json_restore_hierarchy
Last active November 21, 2018 10:58
Restore JSON hierarchy in Weblate PRE_COMMIT_SCRIPTS
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import argparse
import codecs
import json
__author__ = 'Daniel Widerin <daniel@widerin.net>'
__license__ = 'MIT'