Skip to content

Instantly share code, notes, and snippets.

View jollyroger's full-sized avatar

Andrii Senkovych jollyroger

  • TRData Limited
  • Ukraine
View GitHub Profile
import XMonad hiding ( (|||) )
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook
import XMonad.Util.EZConfig(additionalKeys)
-- Pipes, environment variables, etc.
import XMonad.Util.Run(spawnPipe)
import System.IO
@jollyroger
jollyroger / glide-support-common-make-vars.patch
Last active August 4, 2016 18:31
RPM SPEC file to build glie package manager for Golang
--- Makefile 2016-08-04 13:07:27.501588143 -0400
+++ Makefile 2016-08-04 13:07:35.035595718 -0400
@@ -1,13 +1,17 @@
GLIDE_GO_EXECUTABLE ?= go
-VERSION := $(shell git describe --tags)
+VERSION_GIT := $(shell git describe --tags)
+VERSION ?= ${VERSION_GIT}
DIST_DIRS := find * -type d -exec
+PREFIX ?= /usr/local
/*
Door timer
Controls light in the room by door state:
* when door opens: turn light on until time less than DELAY_OPEN value
* when door closes: turn light off after time reaches DELAY_CLOSE value
Separately control timer for two rooms
Pins used:
@jollyroger
jollyroger / ca.py
Created July 19, 2013 08:42
External pillar for populating hosts' private keys and certificates.
"""
Custom pillar module to retrieve certificates and private keys based on the
server id.
Configuring the CA ext_pillar
=============================
The CA ext_pillar configuration needs a path to the PKI directory and a Pillar
variable name to populate the data into. In the end ext_pillar configuration
will look like:
@jollyroger
jollyroger / apt.py
Created November 29, 2012 14:58
salt.states.debconf module
'''
Support for APT (Advanced Packaging Tool)
'''
# Import python libs
import os
import re
# Import Salt libs
import salt.utils
@jollyroger
jollyroger / rename_authors_in_svn.py
Created December 30, 2010 23:47
Rename authors in svn using svn dump file
#!/usr/bin/python
# -*- coding:utf8 -*-
import sys
authors = {
"author1_old_name\n":"author1_new_name",
"author2_old_name\n":"author2_new_name",
}
@jollyroger
jollyroger / post-commit
Created December 22, 2010 16:05
Subversion post-commit hook for buildbot.
#!/bin/sh
# Subversion post-commit hook.
#
# This script will update files on the development web-server transparently
# without any files to be deleted before sync.
REV=$2
REPOS=$1
/usr/share/buildbot/contrib/svn_buildbot.py --repository "$REPOS" --revision "$REV" --bbserver 123.123.123.123 --bbport 9989
@jollyroger
jollyroger / gist:502584
Created July 31, 2010 20:39
Demonstrates work of buildbot init script with two bots enabled
[jollyroger@gamma:buildbot-0.8.1]% sudo invoke-rc.d buildbot-master start [20:37:47]
Starting buildbot-master: twistd
Starting foo:done.
Starting bar:done.
[jollyroger@gamma:buildbot-0.8.1]% sudo invoke-rc.d buildbot-master reload [20:37:50]
Reloading buildbot-master: twistd
foo:done.
bar:done.
[jollyroger@gamma:buildbot-0.8.1]% sudo invoke-rc.d buildbot-master restart [20:37:54]
Restarting buildbot-master: twistd
<script src="http://gist.github.com/324678.js?file=sample.html"></script>
@jollyroger
jollyroger / fmetric.py
Created February 26, 2010 13:16
Help restore files from lost+found
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Script generates statistics table for specified direcories sorted by type(by
# default), overall files size or files count. This script can also sort files
# into the directories by type using hardlinks(default) or softlinks. Type
# determination is done by `file` utility.
#
# To get help just run script with wrong parameters.
import os