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 / textrender.py
Created June 21, 2015 19:27
Simple PyGame text rendering sprite
import pygame
LEFT, CENTER, RIGHT = range(3)
TOP, MIDDLE, BOTTOM = range(3)
class RenderText(pygame.sprite.Sprite):
pos = None
pos_rel = None
@Informatic
Informatic / README.md
Last active November 28, 2015 22:47
How to make Synergy usable. In a couple of easy steps.

Note: My config is as follows: Ubuntu/KDE Server + Windows 7 Client.

  1. If you are going to play any games, you want to bind some key/keystroke to lockCursorToScreen (switchInDirection might be usable too, I actually prefer to have cursor locked most of the time, and just switch between screens with a keystroke) and check Advanced server config → Use relative mouse moves on server.
  2. Remember to check Elevate privileges in config on your (Windows) client.
  3. For Windows to receive Ctrl+Alt+Del properly you have to mingle with gpedit, as per http://www.robertwrose.com/2012/06/enabling-ctrl-alt-del-in-windows-7-over-synergy.html
  4. Unless you feel like patching your Windows build, you have to be very patient and try not to switch context too often - https://github.com/synergy/synergy/issues/3241 :^)
  5. If the only thing you use Ctrl+Alt+Del keystroke for in Windows is starting taskmgr, you might want to learn Ctrl+Shift+Escape which does just that, without switching running context to
@Informatic
Informatic / IOMMU fun.md
Last active September 13, 2017 07:49
Log of my struggle with vfio / iommu / VGA passthrough

It just works™, at least on Windows 10 & UEFI/OVMF. Remember to have QXL emulated graphics enabled. This will show as an additional screen in Windows, but you'll be able to just disable it. Only downside of that is you won't get OVMF and Windows splashscreen on physical screen.

Hardware

  • AMD Phenom II x4 955
  • ASRock 970 Extreme3
  • AMD Radeon R9 280x
  • 16GB RAM
@Informatic
Informatic / README.md
Last active October 4, 2020 07:01
Minimal Tor hidden service on OpenWRT
  1. Format your storage
  2. Configure networking (it's easiest with LuCI, or just take a look at OpenWRT howtos)
  3. Configure /storage by adding proper options in /etc/config/fstab, or, again, just clicking around in LuCI
  4. opkg update && opkg install tor
  5. Copy proper configuration, namely /etc/tor/torrc and /etc/config/uhttpd
  6. Reboot (or /etc/init.d/uhttpd restart && /etc/init.d/tor restart)
  7. Check /etc/tor/hidden_service/hostname for your public .onion address
  8. ...
  9. PROFIT!
@Informatic
Informatic / gist:ba8aef167a92eba5acde
Created March 9, 2016 19:29
FLOSS / Non-shady Windows tools
@Informatic
Informatic / HID.cpp
Last active February 7, 2023 19:11
Arduino Leonardo HID.cpp patched for keyboard HID boot protocol / BIOS support (from Arduino 1.6.8 package)
/* Copyright (c) 2011, Peter Barrett
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted, provided that the
** above copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
@Informatic
Informatic / pycextractor.py
Last active April 21, 2016 21:49
Extracts .pyc from frozen binaries (i've got no idea what freezer that was :^))
"""
Extracts plain python bytecode / marshal code from frozen binary.
Dirty as fuck and might fail / miss random stuff, but worked fine for me.
NOTE: Creates dump_*.pyc files in current directory!
"""
import sys
counter = 1
@Informatic
Informatic / README.md
Last active November 30, 2018 00:02
Yi 2 Firmware reverse-engineering

Yes. It's real. These are just my notes after skimming through the firmware. (protip: update API)

Hardware revisions: 12L, 13L Internal version: z16 (it's all over the place)

Features

  • Running A9S, as everyone might've guessed
  • Seems to have EXFAT support in uITRON
  • SuperView
@Informatic
Informatic / example.tex
Last active May 10, 2016 16:30
Lennyface LaTeX package
\documentclass{article}
\usepackage{lenny}
\begin{document}
Hello World! \lenny
\end{document}
@Informatic
Informatic / README.md
Last active May 23, 2024 02:47
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.