Skip to content

Instantly share code, notes, and snippets.

View Darkflib's full-sized avatar
🏠
The real problem is not whether machines think, but whether men do.

Mike Preston Darkflib

🏠
The real problem is not whether machines think, but whether men do.
View GitHub Profile
@Darkflib
Darkflib / grab.php
Created February 10, 2013 13:04
fontsquirrel grabber, using their open api. Please don't abuse their great service.
<?php
$data=file_get_contents('http://www.fontsquirrel.com/api/fontlist/all');
$json=json_decode($data,true);
function grabfont($fontname) {
$url='http://www.fontsquirrel.com/fontfacekit/'.$fontname;
$fp=fopen('fonts/'.$fontname.'.zip','w');
@Darkflib
Darkflib / conky3-centre.conf
Created June 7, 2013 09:20
Set of conky confs from when I had my AAO running linux.
background yes
use_xft yes
xftfont 123:size=7
xftalpha 0.1
update_interval 10
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
@Darkflib
Darkflib / gist:7369802
Created November 8, 2013 11:37
motp in php
<?php
/*
php-fuction to validate
Mobile One Time Passwords
by Ralf Neumann (ralf@njumaen.de)
based on
motp.sourceforge.net
*/
function checkOTP($pin,$otp,$initsecret)
@Darkflib
Darkflib / keybase.md
Created June 15, 2014 15:18
keybase.md

Keybase proof

I hereby claim:

  • I am darkflib on github.
  • I am darkflib (https://keybase.io/darkflib) on keybase.
  • I have a public key whose fingerprint is CC8C 22D1 B95D 957A 59EE 7665 D5E5 F691 45F5 BBA2

To claim this, I am signing this object:

<?php
/*
* This file an extension for the Monolog package that implements an AMQP handler based on
* the amqp library at https://github.com/videlalvaro/php-amqplib
*
* (c) Mike Preston <mike@technomonk.com>
*
*/
$id='1227feacf41c472e5ee34e20b510a240ad81ea6e';
echo 'id '.$id."\n";
$url = 'http://example.com/activity/pub?id='.$id;
echo 'url '.$url."\n";
$data = array( 'foo' => 'bar' );
$data_json = json_encode($data);
echo $data_json."\n";
@Darkflib
Darkflib / slack signup
Created July 12, 2015 10:36
Slack signup
<?php
//requires guzzle
require_once '../vendor/autoload.php';
$token='xoxp-3180528888-111111-98229-b4e1b7';
$email='darkflib@example.com';
$teamname='example';
$url="https://${teamname}.slack.com/api/users.admin.invite";
@Darkflib
Darkflib / supervisord.sh
Created April 1, 2016 11:40 — forked from mhayes/supervisord.sh
init.d for supervisord for Amazon Linux AMI
#!/bin/sh
# Amazon Linux AMI startup script for a supervisor instance
#
# chkconfig: 2345 80 20
# description: Autostarts supervisord.
# Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/usr/bin/supervisorctl"
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
<?
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the