Skip to content

Instantly share code, notes, and snippets.

View zeha's full-sized avatar
:shipit:
Shipping it

Chris Hofstaedtler zeha

:shipit:
Shipping it
View GitHub Profile
@zeha
zeha / debug_heap_xc32_13x.c
Created February 11, 2016 00:19 — forked from jasonkajita/debug_heap_xc32_13x.c
UNSUPPORTED debug_heap() implementation for XC32 v1.3x
/*-------------------------------------------------------------------------
* !! UNSUPPORTED !! - debug_heap() function for MPLAB XC32 v1.3x
*
* Copyright (c) 2014, Microchip Technology Inc. and its subsidiaries ("Microchip")
* All rights reserved.
*
* This software is developed by Microchip Technology Inc. and its
* subsidiaries ("Microchip").
*
* Redistribution and use in source and binary forms, with or without
@zeha
zeha / gist:3d4f6e69a809e4411927
Created December 2, 2015 00:46
single lvm2 LV to plain partition
LVM2 partition previously began on sector 2048
Offset 1048576 = 2048 * 512
dmsetup table shows where LV begins, usually at offset 2048 (unit=sectors), -> new partition starts at sector 4096!
Don't forget to update-grub (check root=UUID=<uuid of ext4>) and grub-install /dev/vda after making these changes!
# fdisk -l
Disk /dev/vda: 32 GiB, 34359738368 bytes, 67108864 sectors
@zeha
zeha / ilopassword.xml
Created July 28, 2015 10:09
hp-ilo-reset-password
<RIBCL VERSION="2.1">
<LOGIN USER_LOGIN="Administrator" PASSWORD="anypassword">
<USER_INFO MODE="write">
<mod_USER USER_LOGIN="Administrator"><password value="XXXXXXXXXXXX"/></mod_USER>
</USER_INFO>
</LOGIN>
</RIBCL>

Python packages

Also called "eggs", when zipped and renamed.

Note that packages means two things in the Python world:

a directory with an __init__.py an egg, or a source of that, also called distribution. (Something installable. A collection of ... modules & packages.) This page will use distribution when referring to the second thing, and package for the directories.

@zeha
zeha / awayforward.pl
Last active August 29, 2015 14:00
irssi script to forward messages while away to mqtt
use Irssi;
use POSIX;
use JSON;
use vars qw(%IRSSI);
%IRSSI = (
name => "awayforward",
license => "Public Domain",
);
#!/bin/bash
# -*- sh -*-
: << =cut
=head1 NAME
ipmi_ - Plugin to monitor temperature or fan speed using IPMI
=head1 CONFIGURATION
import codecs
import sys
from xml.dom.minidom import parse, parseString
def minimize(el):
attrs = []
for i in range(0, el.attributes.length):
attrs.append(el.attributes.item(i).name)
for attr in attrs:
if el.getAttribute(attr) == "" or el.getAttribute(attr) == "0":
@zeha
zeha / gist:5999375
Created July 15, 2013 11:49
gitignore for MPLAB X projects
*.d
*.pre
*.p1
*.lst
*.sym
*.obj
*.o
*.sdb
*.obj.dmp
html/
@zeha
zeha / bt-proximity.sh
Created May 2, 2013 10:38
bt-proximity: Check if your phone (or any other bluetooth device) is in range.
#!/bin/bash
# sudoers:
# username ALL = NOPASSWD: /usr/bin/hcitool, /bin/mount
# crontab:
# @reboot ~/Source/dotfiles/tools/bt-proximity
# one-time pairing:
# bt-device -c F0:XX:XX:XX:XX:XX
mkdir -p ~/.local/bt-proximity
@zeha
zeha / gist:5233288
Last active December 15, 2015 08:49
quick howto netns
assumption: your machine has eth0 bridged to br0 already
(everything as root)
create a new netns:
-------------------
ip netns add foo
ip netns exec foo bash