Skip to content

Instantly share code, notes, and snippets.

@Ynn
Ynn / eisvogel.latex
Last active March 16, 2018 15:28
eisvogel modified to include logo
%%
% Copyright (c) 2018, Pascal Wagler;
% Copyright (c) 2014--2018, John MacFarlane
%
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions
% are met:
%
all : latex pdf html odt cat
install :
#wget -c https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template/master/eisvogel.tex --output-document=eisvogel.latex
wget -c https://gist.githubusercontent.com/Ynn/7907470ea0e68c909ba0a51752a9f308/raw/80c97266638c796decea342e6392207c5883f036/eisvogel.latex
mkdir -p pandoc
wget -c https://github.com/jgm/pandoc/releases/download/2.1.2/pandoc-2.1.2-linux.tar.gz
tar xvzf pandoc-2.1.2-linux.tar.gz --strip-components 1 -C ./pandoc/
sudo pip install pandoc-fignos
@Ynn
Ynn / main.cpp
Created February 14, 2018 15:56
esp8266 : sniff, send in udp, then sniff another channel
#include <Arduino.h>
#ifdef ESP8266
extern "C" {
#include "user_interface.h" //to gain access to promiscuous mode
}
#endif
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
@Ynn
Ynn / obix-proxy.go
Created November 7, 2017 19:34
example curl -l http://localhost:8080/example.com/obix/org/lon/@XBureau922/@XLocations/@XLSI/@XSunSensor/@XnvoSunLux_2/$@CSNVT_lux/?name=lux2&format=influx
package main
import (
"fmt"
"io/ioutil"
"net/http"
"encoding/xml"
"strconv"
"time"
)
@Ynn
Ynn / proxy.go
Created November 7, 2017 17:02
xml to json proxy
package main
import (
"fmt"
"strings"
xj "github.com/basgys/goxml2json"
"net/http"
"io/ioutil"
)
@Ynn
Ynn / obix.go
Created November 7, 2017 09:11
package main
import "fmt"
import "encoding/xml"
import "net/http"
import "io/ioutil"
type ObixReal struct {
Value float32 `xml:"val,attr"`
}
@Ynn
Ynn / Remove bash comment from config files
Created November 6, 2017 11:03
Remove bash comment from config files
alias rcl='egrep -v "(^[[:blank:]]*#)|(^[[:blank:]]*$)"'
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef unsigned char uint8_t;
void printBits(uint8_t num){
int size = sizeof(uint8_t);
unsigned int maxPow = 1<<(size*8-1);
int i=0,j;
@Ynn
Ynn / main.cpp
Last active July 5, 2017 13:18
Generating private and public key, sha256 (using crypto.h from lib https://github.com/intrbiz/arduino-crypto), sign and check
#include <Arduino.h>
#include <uECC.h>
#include "Crypto.h"
#define NELEMS(x) (sizeof(x) / sizeof((x)[0]))
extern "C" {
static int RNG(uint8_t *dest, unsigned size) {
// Use the least-significant bits from the ADC for an unconnected pin (or connected to a source of
@Ynn
Ynn / gist:dc763734d86e32fd3dabdf7945019722
Created June 13, 2017 11:51
Retrieve temperature from lm35 and publish it to sensor/temperature/1 Use cloudmqtt Requires : PubSubClient and ESP8266WiFi
/*
Retrieve temperature from lm35 and publish it to sensor/temperature/1
Use cloudmqtt
Requires : PubSubClient and ESP8266WiFi
Licence : MIT
Inpired from : http://www.projetsdiy.fr/esp8266-dht22-mqtt-projet-objet-connecte/
*/
#include <Arduino.h>