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
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#define CPUID_EBX_AVX2 0x00000020
#define CPUID_EBX_AVX512F 0x00010000
#define XCR0_SSE 0x00000002
#define XCR0_AVX 0x00000004
#define XCR0_OPMASK 0x00000020
#!/bin/bash
if [ "$1" = "--cflags" ]; then
FLAGS=$(/usr/bin/net-snmp-config --cflags)
MYFLAGS=""
for flag in $FLAGS; do
if [[ "$flag" =~ -DNETSNMP* ]]; then
MYFLAGS="$MYFLAGS $flag"
fi
done
#!/bin/bash
set -x
puppet agent --disable "update Debian"
service keepalived stop
apt-get install udev acl
sed -i'' -e 's/jessie/stretch/g' /etc/apt/sources.list.d/*
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
apt-get update
apt-get install apt dpkg deborphan # openjdk-8-jre-headless
function load_rootkeys()
root_key_path = "/usr/share/dns/root.ds"
print("LUA: Loading DNSSEC root keys from " .. root_key_path)
-- . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
for line in io.lines(root_key_path) do
ds = string.match(line, "^%.%s+IN%s+DS%s+(%d+%s+%d+%s+%d+%s+%S+)")
if ds then
print("LUA: Adding DS: " .. ds)
addDS(".", ds)
end
--- /opt/omd/versions/1.4.0p33.cee/share/check_mk/checks/netapp_api_vs_traffic 2018-06-14 22:38:10.015343639 +0200
+++ fixed 2018-06-14 22:38:02.875290054 +0200
@@ -88,7 +88,7 @@
if what not in data:
continue
- rate = get_rate(what, now, int(data[what]) * scale)
+ rate = get_rate('%s:%s' % (protocol, what), now, int(data[what]) * scale)
yield 0, "%s %s: %s" % (protoname, perftext, format_func(rate)), [(perfname, rate)]
@zeha
zeha / nordep.sql
Last active July 7, 2016 13:49
pkg-ruby-extras packages with no r-dep (or r-build-dep)
WITH
sidpkgs AS (
select distinct
p1.package, p1.maintainer, p1.version,
regexp_split_to_array(replace(regexp_replace(p1.depends, E'(\\([^\\)]+\\))', '', 'g'), ' ', ''), E'[,|]') as depends,
regexp_split_to_array(replace(regexp_replace(p1.recommends, E'(\\([^\\)]+\\))', '', 'g'), ' ', ''), E'[,|]') as recommends,
regexp_split_to_array(replace(regexp_replace(p1.suggests, E'(\\([^\\)]+\\))', '', 'g'), ' ', ''), E'[,|]') as suggests
from packages p1
where p1.release = 'sid'
and p1.package not like '%-dbgsym'
@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.