Skip to content

Instantly share code, notes, and snippets.

View JanKoppe's full-sized avatar
🐧
NOOT NOOT!

Jan Koppe JanKoppe

🐧
NOOT NOOT!
View GitHub Profile
@jmcgill
jmcgill / descriptors.c
Last active March 24, 2018 19:54
A minimal sample of a generic batch mode USB device using LUFA.
/*
LUFA Library
Copyright (C) Dean Camera, 2012.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
@kamiyaowl
kamiyaowl / dmx_receiver.c
Last active January 25, 2019 09:13
dmx receive for avr
/*
* dmx_receiver.c
*
* Created: 2014/07/15 19:43:52
* Author: kamiya
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include "dmx_receiver.h"
variable "hcloud_token" {
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
resource "hcloud_server" "kube-master" {
name = "kube-master"
image = "ubuntu-18.04"
@KowalczykBartek
KowalczykBartek / how to setup secure Dynomite
Last active May 27, 2019 06:39
Dynomite NGINX SSL/TLS Termination
what ?
- As we know Dynomite doesn't support any kind of authentication, so, to make security teams happy, we need to obey this somehow.
One of possibilities is SSL Termination, our Redis client (Jedis for java) will not talk with Dynomite directly but will request NGINX,
NGINX will check client's certificate and if cert is valid, request will be forwarded to Dynomite.
technically how ?
- In normal setup Dynomite requires (for each instance) Dynomite and Redis, in secure setup you will need additionally NGINX,
and this will be only one open port.
With this sample configuration, both Client and Server needs to trust themselves.
@blha303
blha303 / 1001.conf
Last active July 2, 2019 08:24
Asterisk 1.0.0.1 context
[1001]
exten => _X.,1,Set(CALLERID(name)=1.0.0.1)
exten => _X.,n,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,Playback(1001-recordtype) ; "Enter record type on your phone keypad, followed by the hash key. Press 1 to go to next character"
exten => _X.,n,Read(recordtype,,,si,)
exten => _X.,n,Playback(1001-domain) ; "Enter domain name to retrieve record, followed by the hash key"
exten => _X.,n,Read(domain,,,si,)
exten => _X.,n,Set(RECORD="${SHELL(/usr/bin/1001.py "${recordtype}")}")
exten => _X.,n,Set(ADDR="${SHELL(/usr/bin/1001.py "${domain}")}")
location ~ /(?:a|A)utodiscover/(?:a|A)utodiscover.xml {
root /var/www/;
try_files /autodiscover/autodiscover.php =404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param SERVER_ADDR "";
fastcgi_param REMOTE_ADDR $http_x_real_ip;
}
@raine
raine / gitter-weechat-instructions.md
Last active October 4, 2021 10:52
Connecting to gitter using weechat

Auth and copy token at https://irc.gitter.im/.

Ignore the /PASS thing, it doesn't work in weechat.

/server add gitter irc.gitter.im -ssl -ssl_verify -ssl_dhkey_size=1024 -password=<REPLACE_WITH_YOUR_TOKEN>
/connect gitter
@mjohnsullivan
mjohnsullivan / generate_cloudfront_signed_cookies.py
Created January 1, 2017 16:34
Python script that generates signed cookies to control access to CloudFront content
#!/usr/bin/env python
"""
Copyright (C) 2017 Matt Sullivan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@chelsea
chelsea / README.md
Last active April 26, 2022 18:26
Random Aww

Description

Dashing widget to display a random cute picture from http://reddit.com/r/aww

The display of the widget is heavily based on the Image widget, however it does not prepend the src with 'assets' which allows for external images.

Settings

You can set a placeholder image in the event that reddit is down, or otherwise unresponse. This is set at the top of random_aww.rb as follows:

@nicjansma
nicjansma / MountVHD.cmd
Created January 5, 2012 02:28
MountVHD and UnMountVHD: Allows you to mount .VHDs in Windows 7 from the command-line. http://nicj.net/2012/01/04/mounting-vhds-in-windows-7-from-a-command-line-script
@echo off
setlocal enabledelayedexpansion
if {%1}=={} (
echo Usage: %~nx0 [vhd] [letter]
exit /b 1
)
set vhdPath=%~dpnx1
set driveLetter=%2