Skip to content

Instantly share code, notes, and snippets.

@dnozay
dnozay / 1_tox.ini
Created October 23, 2014 18:20
tox + coverage : getting combined python code coverage.
[testenv]
deps=coverage
commands =
coverage erase
coverage run setup.py test
coverage report --omit='.tox/*'
coverage html --omit='.tox/*'
@dnozay
dnozay / python33.rb
Last active November 6, 2016 11:13
python3.3 homebrew formula.
# taken from https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python3.rb
# and adapted to use 3.3.x instead of 3.4
# Homebrew: https://github.com/Homebrew/homebrew
# Homebrew is licensed under BSD 2 Clause: https://github.com/Homebrew/homebrew/blob/master/LICENSE.txt
require "formula"
class Python33 < Formula
homepage "https://www.python.org/"
@dnozay
dnozay / script.groovy
Created October 20, 2014 23:25
Jenkins - retroactively add badges to promoted builds.
// Licensed under MIT
// author : Damien Nozay
// ---------------------------------------------------------
// Retroactively add badges to promoted builds.
// this assumes
// ---------------------------------------------------------
import hudson.plugins.promoted_builds.*;
import org.jvnet.hudson.plugins.groovypostbuild.*;
@dnozay
dnozay / script.groovy
Last active June 27, 2019 17:16
Jenkins - add badge & summary to promoted build
// When using the Promoted Build plugin, you may want to perform some operations
// then you may also want to add badges or a summary to the target build as
// opposed to the promotion build. This script assumes that you have a manual
// promotion process with a parameter called RELEASE_VERSION (hence requiring
// user input); the content that follows would be what you put as a Groovy
// Postbuild action on the promotion process.
import org.jvnet.hudson.plugins.groovypostbuild.*;
def add_release_version(promotion) {
@dnozay
dnozay / review_scripts.groovy
Created October 9, 2014 01:56
jenkins script console: check jobs with unapproved postbuild groovy script.
// Licensed under MIT
// author : Damien Nozay
// ---------------------------------------------------------
// This script goes through all the jobs and checks if they are using the Groovy Postbuild
// if they are, then it computes the hash value, and checks against the ones that are approved.
// ---------------------------------------------------------
import org.jenkinsci.plugins.scriptsecurity.scripts.*;
import org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.*;
@dnozay
dnozay / grab.c
Created October 8, 2014 21:15
grab: move a process from one tty to another (source: http://www.ucc.asn.au/~dagobah/things/grab.c)
/*
* grab: move a process from one tty to another.
* Version 0.0.1
*
* Written by Bernard Blackham. This code is in the public domain.
*
* This is a very quick hack and quite a mess. Needs a lot of polish. It is
* also nowhere near perfect.
*
* Usage:
@dnozay
dnozay / screen-resolution.sh
Created October 5, 2014 00:17
use xrandr to properly fit Sceptre 40" display over HDMI output.
#!/bin/bash
# fix display for Sceptre 40" X405BV-FHD3 on Fedora 20.
# this is done by turning on the underscan feature with xrandr.
# usage: call this script from within /etc/gdm/Init/Default.
xrandr --output HDMI-1 \
--set "underscan" on \
--set "underscan hborder" 50 \
--set "underscan vborder" 30
@dnozay
dnozay / README.md
Last active October 13, 2016 21:52
recompile bash on OSX 10.6.
@dnozay
dnozay / local-apxs.sh
Last active October 20, 2021 03:17
fix apxs on OSX10.9
#!/bin/bash
# apxs may fail with .../usr/bin/cc: not a directory
# solution: use your own apxs script.
# fix based on the configure.ac from mod_wsgi
# https://github.com/GrahamDumpleton/mod_wsgi
XCODE_PREFIX="/Applications/Xcode.app/Contents/Developer/Toolchains/"
XCODE_CC="${XCODE_PREFIX}XcodeDefault.xctoolchain/usr/bin/cc"
@dnozay
dnozay / 0001-trivial-massage-for-centos.patch
Created August 5, 2014 22:56
zfs-backup patch for centos
From dec16d764a5bb0a45b16fbb445dce9a8858fc80d Mon Sep 17 00:00:00 2001
From: damien <damien@localhost>
Date: Tue, 5 Aug 2014 15:54:14 -0700
Subject: [PATCH] [trivial] massage for centos
---
zfs-backup.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/zfs-backup.sh b/zfs-backup.sh