Skip to content

Instantly share code, notes, and snippets.

View pulsar256's full-sized avatar

Paul Rogalinski-Pinter pulsar256

  • 4.screen
  • Munich
  • 00:03 (UTC +02:00)
View GitHub Profile
@pulsar256
pulsar256 / wirejig.scad
Created May 10, 2016 18:19
Heatbed Round Wire Jig
$fn=100;
markerRadius=1;
circle(r = markerRadius);
quadrant();
mirror([1,0]) quadrant();
mirror([0,1]) quadrant();
mirror([1,0]) mirror([0,1]) quadrant();
@pulsar256
pulsar256 / bassreflexadapter.scad
Created April 30, 2016 22:42
Bassreflex Adapter vom Sacha
$fn=200;
rotate_extrude()
translate([-22.5,0,0]) union() {
translate([0,-10,0]) square([7,10]);
translate([6.5,-3.5,0]) rotate([0,0,45]) square([5,5]);
intersection() {
circle(10, center=true);
square(20);
};
};
@pulsar256
pulsar256 / stm32f0_synth_case.scad
Last active April 30, 2016 10:58
semi-parametric 3d printed case for a 50x50 PCB
$fn=100;
// Enclosure for
// http://blog.kehribar.me/build/2015/12/06/polyphonic-fm-synthesizer-with-stm32f031.html
case(drawPart=0); // 0=box, 1=lid, 2==both
module case (
wall=1.5, // wall thickness
@pulsar256
pulsar256 / dynv6_v4only.sh
Last active January 11, 2022 09:58 — forked from corny/dynv6.sh
Update script for dynv6.com to set your IPv4 address
#!/bin/sh -e
# based on https://gist.github.com/corny/7a07f5ac901844bd20c9
hostname=$1
device=$2
v4_file=$HOME/.${hostname}.dynv6.addr4
[ -e $v4_file ] && old=`cat $v4_file`
@pulsar256
pulsar256 / vibration_tester.ino
Created July 11, 2015 11:13
Vibration Tester
#include "U8glib.h"
#include <Wire.h>
#define TWI_FREQ 400000L
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
const int MPU=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
@pulsar256
pulsar256 / pageTokenGen.js
Created May 21, 2015 17:17
Generator for pageTokens for the Youtube API
// workaround for https://code.google.com/p/gdata-issues/issues/detail?id=7163
var d0 = "AEIMQUYcgkosw048";
var d1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var d2 = d1;
var d1c = 0;
var d2c = 0;
var overflowSuffix = "Q";
var direction = "AA";
var d2OverflowCounter = 0;
@pulsar256
pulsar256 / render_scale.py
Created February 8, 2015 22:43
render_scale.py - Inkscape 0.91 compatible version
#!/usr/bin/env python
# coding=utf-8
'''
Copyright (C)
2009 Sascha Poczihoski, sascha@junktech.de
original author
2013 Roger Jeurissen, roger@acfd-consultancy.nl
dangling labels and inside/outside scale features
@pulsar256
pulsar256 / ssd1306_init.c
Last active December 5, 2023 20:27
SSD 1306 Init Sequence
/**
* according to http://www.adafruit.com/datasheets/UG-2864HSWEG01.pdf Chapter 4.4 Page 15
*/
void ssd1306Init(void)
{
i2c_OLED_send_cmd(0xAE); // Set display OFF
i2c_OLED_send_cmd(0xD4); // Set Display Clock Divide Ratio / OSC Frequency
i2c_OLED_send_cmd(0x80); // Display Clock Divide Ratio / OSC Frequency
@pulsar256
pulsar256 / my_hetzner_xen_setup.md
Last active February 9, 2023 22:20
Hetzner Xen + v4 Subnet + v6 Subnet Setup HowTo

Hetzner Primary IPv4 IP + IPv4/2x Subnet + "Non-Routed" IPv6/64 Subnet HowTo

... so I do not forget the next time I have to figure this stuff out. And perhaps to help other poor souls fiddling with v6/v4 xen setups in a Hetzner network environment.

Basic setup

You can basically follow along the Xen Project Beginners Guide.

The short version

Install Debian Wheezy via Hetzner's installimage on the rescue system, the only important part about partitioning is that you have an LVM volume group named vg0 with enough space for your guests' disks.

@pulsar256
pulsar256 / wifiProbeRequestSniffer.js
Last active February 6, 2018 20:22
wifi probe request monitoring in node.js
var pcap=require('pcap');
pcap.createSession("mon0", '(type mgt) and (type mgt subtype probe-req )').
on('packet', function (raw_packet) {
with(pcap.decode.packet(raw_packet).link.ieee802_11Frame)
if (type == 0 && subType == 4)
console.log("Probe request",shost, "-> ",bssid);
}
);