Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Frank syphernl

🚀
  • The Netherlands
View GitHub Profile
@mtigas
mtigas / gist:952344
Last active Nov 26, 2022
Mini tutorial for configuring client-side SSL certificates.
View gist:952344

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:

@diogok
diogok / OnlineUsers.php
Created May 4, 2011
Online Users using PHP and Redis
View OnlineUsers.php
<?php
include 'predis/predis.phar';
class OnlineUsers {
/* time to consider user online */
private $minutes = 5 ;
function online() {
/* current hour and minute */
@tomerd
tomerd / gauge.js
Last active Aug 6, 2022
google style gauges using javascript d3.js
View gauge.js
function Gauge(placeholderName, configuration)
{
this.placeholderName = placeholderName;
var self = this; // for internal d3 functions
this.configure = function(configuration)
{
this.config = configuration;
@markrickert
markrickert / giratchive.sh
Created Jun 12, 2012
Git Archive Bash Script
View giratchive.sh
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
View Module.php
<?php
/**
* @author Antoine Hedgecock
*/
/**
* @namespace
*/
namespace Application;
use Zend\Acl\Acl,
View layout.phtml
<?php
echo $this->navigation('default-navigation')
->menu()
->setPartial('default/navigation/sub_menu')
->render(
null,
array(
'indent' => 4,
'ulClass' => '',
'minDepth' => 1,
@quiver
quiver / zabbix_get.py
Created Oct 13, 2012
Python port of zabbix_get command
View zabbix_get.py
# zabbix_get.py : Python port of zabbix_get
# http://www.zabbix.com/documentation/1.8/protocols/agent
# http://www.zabbix.com/wiki/doc/tech/proto/zabbixagentprotocol
import argparse
import socket
import struct
import sys
def str2packed(data):
@KartikTalwar
KartikTalwar / Documentation.md
Last active Nov 18, 2022
Rsync over SSH - (40MB/s over 1GB NICs)
View Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@luchaos
luchaos / User.php
Last active Aug 29, 2015
OAuth - Remembering granted authorization
View User.php
class User extends Eloquent implements UserInterface, RemindableInterface {
// ...
public function scopesAuthorizedByClientId($clientId)
{
$scopesAuthorized = array();
$session = DB::table('oauth_sessions')
->where('client_id', $clientId)
@SqyD
SqyD / ventilation.yaml
Last active Aug 23, 2022
ESPHome PWM fan using a Wemos D1 mini lite
View ventilation.yaml
# Controlling my Buva Qstream ventilation system using:
# * A Wemos D1 mini lite (an ESP8266 based board)
# * A Wemos power shield so I can power the Wemos from the ventilation units 12V supply.
# * A simple PWM to 10V convertor like this: https://www.cheaptech.nl/pwm-signaal-te-voltage-converter-1-3-khz-0-10-v-pw.html
# * The amazing ESPHome firmware tool: https://esphome.io
# * Home Assistant to tie it all together: https://www.home-assistant.io
#
# I used to use a Raspberry Pi and some Python code for this. See https://gist.github.com/SqyD/a927ab612df767a0cc892bcde23d025c
# The Wemos approach seems more stable and doesn't require external USB power.