Skip to content

Instantly share code, notes, and snippets.

View yannick's full-sized avatar
🏗️

Yannick Koechlin yannick

🏗️
View GitHub Profile
[root@archiso /]# fdisk -l
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 00EEF3FE-772D-493B-A040-289A3AFD319F
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 923647 921600 450M Windows recovery environment
import std.stdio;
import louio.epoll;
void main()
{
Loop l = Loop();
l.init();
l.doLoop();
/+ dub.json:{
"name": "kafka2s3",
"dependencies": {
"asdf": "~>0.1.0-alpha3",
"vibe-s3": {"path": "vibe-s3"},
"vibe-d": "~>0.7.29"
},
"versions": ["VibeCustomMain"]
}+/
@yannick
yannick / kiss.py
Last active January 24, 2017 12:51
well, here is a hint: make it simple but significant
intervall = 60
unique_ids = {}
last_flush = 0
for msg in stream:
unique_ids[msg["uid"]] = True #KISS
if (msg["ts"] - intervall > last_flush):
uniques = len( unique_ids.keys()) #ouch... but works
print( "\t".join( ( msg["ts"], uniques ) ))
last_flush = msg["ts"]
unique_ids = {}
@yannick
yannick / gist:5e46e524100e6ba8fd6e1821d0e9c717
Created July 13, 2016 14:12 — forked from strathmeyer/gist:4990173
Improve OSX Bluetooth quality
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
user: nobody
hosts:
"foo.example.com:443":
listen:
host: 0.0.0.0
port: 443
ssl:
certificate-file: /etc/pki/tls/certs/foo.example.com-2015.crt
key-file: /etc/pki/tls/certs/foo.example.com-2015.key
minimum-version: TLSv1
server {
listen 80 default_server;
listen [::]:80 default_server;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
module main;
//import foo;
import std.stdio;
class Foo
{
import vibe.core.core;
import vibe.http.server;
import vibe.http.router;
import ddb.postgres;
import asdf : serializeToJson, jsonSerializer, serializeValue;
import std.algorithm : map;
import std.array : array;
import vibe.core.connectionpool;
@yannick
yannick / arch-xhyve.sh
Created May 22, 2016 18:00 — forked from lloeki/arch-xhyve.sh
Run Arch Linux in xhyve
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"