Skip to content

Instantly share code, notes, and snippets.

View Informatic's full-sized avatar
🤔
excuse me, is this facebook

Piotr Dobrowolski Informatic

🤔
excuse me, is this facebook
View GitHub Profile
@Informatic
Informatic / Howto: iPXE+Windows7+iSCSI.markdown
Created June 30, 2013 05:26
Quick iPXE & Windows7-on-iSCSI howto

Quick Installation Howto

  1. Make sure you have successfuly set up iPXE, iSCSI target (iSCSI Enterprise Target on Debian works fine for me), TFTP server and some time to spend.
  2. Get yourself a NTFS-formatted USB stick.
  3. Copy contents of installation DVD into mentioned USB stick.
  4. Get a copy of wimboot and load it into your TFTP server.
  5. Copy boot/bcd, boot/boot.sdi, sources/boot.wim and bootmgr into TFTP root as well.
  6. Create the bootstrap script (included bootstrap.ipxe file) and boot your
"""
You may wonder what the heck is going on here.
This is simply my take on code reloading with persisting open sockets i thought
of using in some future IRC bot. A good way to research a little bit more about
exec, file descriptors and sockets.
"""
import socket
import random
import time
@Informatic
Informatic / logging.h
Created May 10, 2014 21:41
Simple but cute GCC logging facilities
#include <stdio.h>
#ifndef VERBOSITY_LEVEL
#define VERBOSITY_LEVEL 3
#endif
#define _stringify2(n) #n
#define _stringify(n) _stringify2(n)
#define PRINT_MESSAGE(type, color, fmt, ...) printf("\033[0;" color "m" \
__FILE__ "@" _stringify(__LINE__) " \033[1;" color "m" type ":\033[0;" \
@Informatic
Informatic / gist:c61b0b5cb7ab24c62a36
Last active August 29, 2015 14:01
Windows 7-based Steambox

My SteamBox recipe

  • Install Windows7
  • Install relevant drivers
  • Update
  • Update
  • Update
  • ...a couple more reboots
  • Set power button action to suspend and disable lock on resume
@Informatic
Informatic / termartist.py
Created May 17, 2014 21:16
Random rotating cube in terminal with some abstracted graphics class
# -*- coding: utf-8 -*-
import sys, time, math, atexit, select
class Screen(object):
def __init__(self, width=80, height=24):
self.output = sys.stdout
atexit.register(self.clear)
# FIXME: don't flush on every escapecode
def _e(self, s):
#!/usr/bin/env python
# -* coding: utf-8 *-
'''
Guitar Hero® World Tour wireless PS3 drums to MIDI adapter for Linux in python.
usage: PROG [hidraw device, default: /dev/hidraw4] [MIDI device number, default: last output]
'''
# FIXME: I dunno... refactor maybe? ;)
# FIXME: Sadly, latency is quite noticable
@Informatic
Informatic / toykeyboard.ino
Created October 18, 2014 21:07
Simple hacked key matrix toy keyboard with PSP analog stick as pitchbend/mod controller.
const int ROWS_COUNT = 4;
const int COLS_COUNT = 8;
const int ANALOG_COUNT = 2;
// Internal reserved CC ID for pitchbend (which isn't really a CC, but, welp)
const int CC_PITCHBEND = 128;
const int midiChannel = 0;
const int midiVelocity = 127;
const int midiBaseNote = 52;
#!/usr/bin/env python
# encoding: utf-8
"""
Really simple chunked/gzipped HTTP Request/Response decoder.
Might be useful in conjunction with sslsplit and vim.
Note: it loads whole body to memory, but might be fixed with zlib.decompressobj
"""
@Informatic
Informatic / Makefile
Last active July 24, 2016 08:51 — forked from jcmvbkbc/Makefile
ESP8266 Makefile for C/C++, which seems to compile properly on FreeRTOS SDK
# tnx to mamalala
# Changelog
# Changed the variables to include the header file directory
# Added global var for the XTENSA tool root
#
# This make file still needs some work.
#
# Updated for SDK 0.9.2
#
# Output directors to store intermediate compiled files
import cv2
from subprocess import call, check_output
class CameraSettings:
def __init__(self, captureObject, device):
self.cap = captureObject
self.device = device
def getFocus(self):