Skip to content

Instantly share code, notes, and snippets.

View hgn's full-sized avatar

Hagen Paul Pfeifer hgn

View GitHub Profile
@hgn
hgn / munich.json
Created May 14, 2014 08:45
munich
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hgn
hgn / gist:9666ef57df9b3525c712
Created March 29, 2015 15:31
Dropbear login
@virgo:/tmp $ ssh -vvvv root@10.10.10.1
OpenSSH_6.7p1 Debian-3, OpenSSL 1.0.1k 8 Jan 2015
debug1: Reading configuration data /home/pfeifer/.ssh/config
debug1: /home/pfeifer/.ssh/config line 101: Applying options for *
debug3: macs ok: [hmac-sha1,hmac-ripemd160]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.10.10.1 [10.10.10.1] port 22.
debug1: Connection established.
@hgn
hgn / gist:485f6c5c1b5ac69719db
Created April 2, 2015 20:31
OpenWRT New Client Signal Generator for Arduino LED
#!/usr/bin/perl
# Nexus 4
$db{'10:68:ff:ff:ff:ff'} = 0;
# Nexus 5
$db{'c4:43:ff:ff:ff:ff'} = 0;
sub worker {
$scan=`(iw dev wlan1 station dump; iw dev wlan0 station dump) | grep Station`;
foreach $key (keys(%db)) {
@hgn
hgn / btrfs-raid0
Last active August 29, 2015 14:20
sudo mount /dev/sda2 /
# mounting sda2 is boot time related via fstab:
# UUID=01e804ec-cc93-44c9-8b92-8fcd41c95aff / btrfs rw,relatime,space_cache 0 0
# now add sdb1 to /
sudo btrfs device add /dev/sdb1 /
sudo btrfs filesystem show
# Label: none uuid: 01e804ec-cc93-44c9-8b92-8fcd41c95aff
#!/usr/bin/env perl
$aosd_path = "aosd_cat";
@aosd_args = ();
push(@aosd_args, "--shadow-offset=1");
push(@aosd_args, "--back-color=black");
push(@aosd_args, "--back-opacity=255");
push(@aosd_args, "--position=4");
push(@aosd_args, "--padding=0");
@hgn
hgn / gist:5035117
Created February 26, 2013 01:51 — forked from dmatveev/gist:2295597
#include <glib.h>
#include <gio/gio.h>
#include <string.h>
static GMainLoop *gMainLoop = NULL;
char *
decode (GFileMonitorEvent ev)
{
char *fmt = g_malloc0 (1024);
@hgn
hgn / gist:5076654
Last active December 14, 2015 11:08
Gtk3 CSS for MenuItems
/* COMPILE WITH: gcc -Wall -o icon3 `pkg-config --cflags --libs gtk+-3.0` a.c */
#include <gtk/gtk.h>
#include <string.h>
static void cb_left_click(GtkStatusIcon * icon, gpointer data)
{
static GtkWidget *window = NULL;
if (window == NULL) {
@hgn
hgn / gist:5082143
Created March 4, 2013 13:13
Read Proc
#include <stdio.h>
// how to read and print various things in /proc
/////////////////////////////////
// how to read /proc/*/stat
/////////////////////////////////
struct statStuff {
int pid; // %d
@hgn
hgn / gist:5094180
Created March 5, 2013 20:54
Parse /proc/interrupts
#!/usr/bin/perl
#
# Interrupt top
#
# Show the interrupts per second/per IRQ per CPU
# Parse /proc/interrupts file for data
#
# CPU0 CPU1
# 0: 3025267376 3026744388 IO-APIC-edge timer
@hgn
hgn / gist:5094337
Created March 5, 2013 21:14
cputree - parse /sys CPU tree
/*
* Copyright (C) 2006, Intel Corporation
* Copyright (C) 2012, Neil Horman <nhorman@tuxdriver.com>
*
* This file is part of irqbalance
*
* This program file is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2 of the License.
*