Skip to content

Instantly share code, notes, and snippets.

@miebach
miebach / git-log-pretty
Last active Jun 3, 2021
pretty git log graph with coloured branches
View git-log-pretty
# Visualizing branch topology in git on the commandline
git log --graph --oneline --full-history --all
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
# With colors in Bash:
git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
@miebach
miebach / dump_object.py
Created Oct 16, 2011
Python debugging and inspection: print (or return as string) a nicely formatted overview of a python object. Works on a module, class or instance.
View dump_object.py
# recipe-137951-1.py
# from http://code.activestate.com/recipes/137951-dump-all-the-attributes-of-an-object/
# created by (C) Philip Kromer http://code.activestate.com/recipes/users/552075/
# forked as https://gist.github.com/1291055
# licence = psf http://code.activestate.com/recipes/tags/meta:license=psf/
# On python attributes and methods read: http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html
from cStringIO import StringIO
import sys
@miebach
miebach / xenmigrate.py
Last active Mar 28, 2021
xenmigrate - convert a Citrix *.xva file to a XEN *.img file.
View xenmigrate.py
"""
Original Location: http://www.robotics.net/wp-content/uploads/xenmigrate.py
Quote from the Documentation: http://www.robotics.net/2009/06/06/converting-citrix-xva-to-xenorg-img/ :
'The file formats of the commercial and open source Xen are totally different.
The open source is a standard image file, you can mount it, fdisk it, whatever you would like.
The Citrix Xen Virtual Appliance .XVA file is quite different. It is actually a tar file
with ova.xml meta data and directories starting with Ref full of 1M files that make up the
rive volumes of the virtual image.
@miebach
miebach / rotate-a-wb-page-javascript.rst
Last active Sep 22, 2020
Rotate a web page 90 degree counter clockwise:
View rotate-a-wb-page-javascript.rst

Rotate a web page 90 degree counter clockwise

Chrome

javascript: document.body.setAttribute( "style", "-webkit-transform: rotate(-90deg);");

paste into JS console: Ctrl-Shift-C -> "Console" from top menu

View post-checkout
#!/usr/bin/env bash
# gist at https://gist.github.com/miebach/7391024
# save this file to .git/hooks/post-checkout
# and also to .git/hooks/post-merge
# and make it executable
# Delete .pyc files and empty directories from root of project
cd ./$(git rev-parse --show-cdup)
@miebach
miebach / ff-extensions+settings.md
Last active Jan 4, 2016
Firefox extensions and settings
View ff-extensions+settings.md

Options

Options - Gerneral - Browsing

  autoscrolling
  smooth scrolling
x hardware acceleration
  check spelling
View py3.patch
diff -r 961ac99baa29 couchdb/client.py
--- a/couchdb/client.py Sun Aug 18 18:41:46 2013 +0200
+++ b/couchdb/client.py Fri Jan 17 11:03:56 2014 +0100
@@ -13,9 +13,9 @@
>>> doc_id, doc_rev = db.save({'type': 'Person', 'name': 'John Doe'})
>>> doc = db[doc_id]
>>> doc['type']
-'Person'
+u'Person'
>>> doc['name']
@miebach
miebach / xmind-ubuntu.md
Created Jan 11, 2014
Xmind on Ubuntu 13.10 with workaround for missing menus
View xmind-ubuntu.md
@miebach
miebach / byobu hostname display
Last active Jan 1, 2016
Byobu's hostname script modified to show only the short hostname. Use the install script below and activate using F9 -> toggle -> hostname
View byobu hostname display
#!/bin/sh -e
#
# hostname: report a host's name
#
# Copyright (C) 2008-2011 Canonical Ltd.
# Copyright (C) 2011 Dustin Kirkland
#
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
@miebach
miebach / vSphere-Client-english.cmd
Created Dec 4, 2013
Start vSphere Client 5.x with english locale set:
View vSphere-Client-english.cmd
rem Start vSphere Client 5.x with english locale set:
rem see http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1016403
"C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe" -locale en_US