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 / 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 / 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 / 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 / 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 / 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 / bundle-conf
Created October 29, 2017 10:09
Simple OpenVPN+EasyRSA configuration bundler
#!/usr/bin/env bash
set -e
panic() { echo $* >&2; exit 1; }
HOST="$(hostname)"
CLIENT="$1"
[ -z "$CLIENT" ] && panic "usage: ./bundle-conf [CLIENT]"
@Informatic
Informatic / README.md
Created February 24, 2018 12:21
Raspberry Pi xscreensaver DPMS fix

This script will watch for xscreensaver blanking event and disable actual HDMI output accordingly.

@Informatic
Informatic / JanusStream.vue
Last active November 12, 2020 09:25
Quick and dirty Janus WebRTC Gateway Streaming plugin component for Vue.js based on https://github.com/TechTeamer/janus-api
<template>
<video controls></video>
</template>
<script>
/* Note: you may need to add `externals: { ws: "WebSocket"},` to Your webpack configuration for this to work properly */
import { Janus, StreamingJanusPlugin } from '@techteamer/janus-api'
export default {
props: ['config', 'stream'],
@Informatic
Informatic / stunnel-transparent.sh
Created July 22, 2018 10:20
stunnel transparent proxy (server) on localhost. use transparent=source; connect=127.1.1.1:... in stunnel configuration (mostly borrowed from sslh documentation)
#!/bin/bash
set -e
# Set route_localnet = 1 on all interfaces so that ssl can use "localhost" as
# destination
sysctl -w net.ipv4.conf.default.route_localnet=1
sysctl -w net.ipv4.conf.all.route_localnet=1
# DROP martian packets as they would have been if route_localnet was zero
@Informatic
Informatic / domain.xml
Last active May 28, 2024 11:44
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>