Skip to content

Instantly share code, notes, and snippets.

View leeuwte's full-sized avatar

Benny de Leeuw leeuwte

View GitHub Profile
@leeuwte
leeuwte / gist:57b8f0604370d5a83b70bc8fda09620d
Created May 10, 2023 17:46 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

sudo apt-get update
sudo apt-get install python-dev python-pip
sudo pip install glances bottle
sudo curl https://gist.githubusercontent.com/leeuwte/155c5dbc179a047b4495f37dcba3a00c/raw/526ee23d677bf92787d75c974b174af44a89649e/glances_rpi_service --output /etc/systemd/system/glances.service
sudo systemctl enable glances.service
sudo systemctl start glances.service
@leeuwte
leeuwte / sysctl.conf
Created July 1, 2020 12:20
/etc/sysctl.conf for homeassistant
# Bigger buffers (to make 40Gb more practical). These are maximums, but the default is unaffected.
net.core.wmem_max=268435456
net.core.rmem_max=268435456
net.core.netdev_max_backlog=10000
# Avoids problems with multicast traffic arriving on non-default interfaces
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
# Force IGMP v2 (required by CBF switch)
@leeuwte
leeuwte / install
Created August 2, 2017 08:40
Installing InfluxDB and Grafana
# check latest version at https://packages.debian.org/sid/armhf/influxdb/download
wget http://ftp.de.debian.org/debian/pool/main/i/influxdb/influxdb_1.1.1+dfsg1-4+b1_armhf.deb
sudo dpkg -i influxdb_1.1.1+dfsg1-4+b1_armhf.deb
# download Grafana via https://github.com/fg2it/grafana-on-raspberry/
wget https://bintray.com/fg2it/deb/download_file?file_path=main%2Fg%2Fgrafana_4.3.2_armhf.deb -O grafana.deb
sudo dpkg -i grafana.deb
# it might fail (was in my case) with the error 'Package libfontconfig is not installed'
# install it with
@leeuwte
leeuwte / query
Created August 2, 2017 06:00
Query min/max temp
Graph type: 'Table'
A:
SELECT max("value") FROM "°C" WHERE "entity_id" = 'outside' AND $timeFilter GROUP BY time(24h) fill(null)
B:
SELECT min("value") FROM "°C" WHERE "entity_id" = 'outside' AND $timeFilter GROUP BY time(24h) fill(null)
In tab 'Time range'
change 'Override relative time' to Last 30d (or wathever suits you)
@leeuwte
leeuwte / demo.sh
Created June 30, 2016 12:00 — forked from rock3r/README.md
A simple bash script to enable demo mode on a Marshmallow+ device via ADB (based on http://bit.ly/295BHLx)
#!/bin/sh
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
#
# Based on http://bit.ly/295BHLx
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by benny on 15/10/15.
*/
public abstract class HeaderFooterAdapter<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public static final int FOOTER = 8769;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzXxASTlNDdXN0
b21Db2xvclNwYWNlViRjbGFzc1xOU0NvbG9yU3BhY2VVTlNSR0JHMCAwIDAgMYACgAYQ
AUYwIDAgMADTCxQVFhcYVU5TSUNDVE5TSUSABYADEAfSCxobHFdOUy5kYXRhgARPEQxI
package x.y.z;
import android.content.Context;
import android.graphics.*;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by Benny de Leeuw on 13-11-14.
*
buildscript {
repositories {
...
maven { url 'https://www.testfairy.com/maven' }
}
dependencies {
...