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 / image.its
Last active January 5, 2023 19:54
Example FIT image descriptor with signatures & buildroot post-image hook / https://blog.inf.re/buildroot-cheatsheet.html
/dts-v1/;
/ {
description = "Example FIT image";
#address-cells = <1>;
images {
kernel@1 {
description = "default kernel";
data = /incbin/("./zImage");
@Informatic
Informatic / image.its
Last active August 4, 2021 07:45
Example FIT image descriptor & buildroot post-image hook / https://blog.inf.re/buildroot-cheatsheet.html
/dts-v1/;
/ {
description = "Example FIT image";
#address-cells = <1>;
images {
kernel@1 {
description = "default kernel";
data = /incbin/("./zImage");
@Informatic
Informatic / thegame.py
Last active December 28, 2016 23:24
Simple SIP DTMF-to-keypress program I hacked up on 33c3. It is for tetris, you know.
# $Id$
#
# SIP DTMF-to-keypress
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# This program 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; either version 2 of the License, or
# (at your option) any later version.
@Informatic
Informatic / contrec.lua
Created December 18, 2016 15:30
MagicLantern continuous recording Lua replacement (for Canon 500D, seems to work fine for me)
-- starts movie recording after a delay
contrec_running = false
contrec_stop = false
contrec_countdown = 0
function contrec_main()
if contrec_running then contrec_stop = true return end
if camera.mode == MODE.MOVIE and movie.recording == false and contrec_menu.submenu["Delay Amount"].value > 0 then
contrec_running = true
@Informatic
Informatic / README.md
Last active September 13, 2017 07:46
ansible + letsencrypt + nginx

Small example on how to set up letsencrypt with nginx and ansible.

  1. Include nginx snippet in default configuration and configuration of every vhost you would like to have letsencrypt enabled for
  2. Make sure nginx is reloaded before letsencrypt role (protip: - meta: flush_handlers)
  3. Use playbook.yml as a further example.
@Informatic
Informatic / README.md
Last active April 9, 2024 07:09
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.

@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 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 / 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 / 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