Skip to content

Instantly share code, notes, and snippets.

View naterh's full-sized avatar

Nada Who naterh

View GitHub Profile
"""Decorator to quickly add statsd (graphite) instrumentation to Celery
task functions.
With some slight modification, this could be used to instrument just
about any (non-celery) function and be made abstract enough to customize
metric names, etc.
Stats reported include number of times the task was accepted by a worker
(`started`), the number of successes, and the number of times the task
raised an exception. In addition, it also reports how long the task took
@naterh
naterh / gist:6426030
Created September 3, 2013 16:14
Keyring stacktrace
======================================================================
ERROR: Failure: ValueError (Attempted relative import in non-package)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/jenkins/workspace/checkmate-test-pull-request/.tox/prjenkins/local/lib/python2.7/site-packages/nose/loader.py", line 413, in loadTestsFromName
addr.filename, addr.module)
File "/var/lib/jenkins/workspace/checkmate-test-pull-request/.tox/prjenkins/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/var/lib/jenkins/workspace/checkmate-test-pull-request/.tox/prjenkins/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
@naterh
naterh / libusb-devel.rb
Last active August 29, 2015 14:21
libusb-devel brew formula sha256
require 'formula'
class LibusbDevel < Formula
url 'https://github.com/OpenNI/OpenNI/blob/4dbf64bc45b880bfda6aa6bb2a30d1ddd03a8c65/Platform/Linux/Build/Prerequisites/libusb-1.0.8-osx.tar.bz2?raw=true'
homepage 'http://www.libusb.org/'
sha256 'e9c39943bedba9aca0c776673040602596b1a7ae880d359e25c07f48971372e9'
depends_on "automake" => :build
depends_on "libtool" => :build
@naterh
naterh / gist:5b4793f3055be7548048
Created July 22, 2015 19:45
grub2 compile automation
sudo apt-get update && sudo apt-get install git bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo ia32_libs build_essential
git clone git://git.savannah.gnu.org/grub.git
cd grub
./autogen.sh
./configure --target=i386 --program-prefix=""
make
cd grub-core
@naterh
naterh / gist:979632b0496967bac93d
Created July 22, 2015 19:45
grub2 compile automation
sudo apt-get update && sudo apt-get install git bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo ia32_libs build_essential
git clone git://git.savannah.gnu.org/grub.git
cd grub
./autogen.sh
./configure --target=i386 --program-prefix=""
make
cd grub-core
@naterh
naterh / gist:c00caf9c940578eec138
Created December 16, 2015 21:08
BMC device map definition data? Extracted from embedded binaries.
------ FILENAME FI_fwid.bin -------
00000000 03 02 42 4d 43 30 30 31 30 1f 00 05 02 00 00 59 |..BMC0010......Y|
00000010 ff 5f 00 00 00 00 00 00 00 00 00 00 01 00 c9 00 |._..............|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
0000003e
----------------------
------ FILENAME FT_fl.bin -------
00000000 01 18 00 00 00 00 00 00 01 10 00 00 18 00 00 00 |................|
00000010 00 00 00 00 00 00 00 be 00 00 |..........|
@naterh
naterh / osx-for-hackers.sh
Created December 29, 2015 17:52 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
nmap -Pn 192.168.0.227
Starting Nmap 6.40 ( http://nmap.org ) at 2016-04-28 16:56 UTC
Nmap scan report for 192.168.0.227
Host is up (0.019s latency).
Not shown: 992 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
111/tcp open rpcbind
@naterh
naterh / gist:13e4ac685e98cd385bea0f476fd767de
Created April 28, 2016 17:10
Avocent viewer jnpl contents
cat viewer.jnlp\(192.168.0.227\@0\@1461862973458\)
<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="https://192.168.0.227:443/" spec="1.0+">
<information>
<title>Virtual KVM Client</title>
<vendor>Avocent Corporation</vendor>
<icon href="http://192.168.0.227:80/images/logo.gif" kind="splash"/>
<shortcut online="true"/>
</information>
<application-desc main-class="com.avocent.kvm.client.Main">
@naterh
naterh / dex_imap_gmail.py
Created January 10, 2017 07:04
Helper util for getting Dex files into Dexlink
#!/usr/bin/env python
#
# Helper util for removing SD1* line from emailed DEX files & uploading to Dexlink
#
import base64
import email
import sys
import smtplib
import imaplib
import getpass