Skip to content

Instantly share code, notes, and snippets.

View bendechrai's full-sized avatar

Ben Dechrai bendechrai

View GitHub Profile
Dear Minister
I write to express my concerns over the draft legislation titled 'The Assistance and Access Bill 2018', and outline these concerns below.
1. This Bill would harm cybersecurity
This Bill would require companies to provide information about how their systems work. It would allow more people physical access to networks. It would require organisations to test and install new functionality built by the government. These measures would undoubtedly introduce new threats and vulnerabilities into the systems that we all use each day.
2. This Bill would lead to an increase in government hacking

Keybase proof

I hereby claim:

  • I am bendechrai on github.
  • I am bendechrai (https://keybase.io/bendechrai) on keybase.
  • I have a public key ASCXAQEd2uuNjpyKeaqsfWzb0d2eOau6PRBWDqzUosoUiQo

To claim this, I am signing this object:

@bendechrai
bendechrai / payment.php
Last active May 26, 2017 03:20
DO NOT USE THIS CODE IN ANY WAY FOR ANYTHING DESTINED FOR PRODUCTION
<?php
$cc_number = "4444 3333 2222 1111";
$p = new Payment();
$p->processPayment($cc_number);
class Payment {
static $url = 'https://api.paypal.com/web_run/f';
@bendechrai
bendechrai / le-nginx-renew.sh
Created July 11, 2016 01:33
LetsEncrypt Nginx Renew
#!/bin/bash
for meta in /etc/letsencrypt/renewal/*conf
do
DOMAIN=`basename $meta | sed 's,.conf$,,'`
# Does the domain appear as a servername in any config file
if [ $(grep -E "^[ \t]*server_name\W+(.*[ \t])?$DOMAIN[ \t;]" /etc/nginx/sites-enabled/*| wc -l) -gt 0 ]
then
@bendechrai
bendechrai / README.md
Created May 9, 2016 00:19
NGINX SSL Config

Creating a dhparam file

screen
openssl dhparam -out dhparams.pem 4096 &```

This can take up to an hour, so starting in `screen` will allow you to come back later :)
@bendechrai
bendechrai / textareaPlaceholderNewlines.css
Last active March 26, 2016 21:31
Textarea Placeholder with Newlines
textarea.placeholder {
color: #aaa;
}
@bendechrai
bendechrai / mailman-discard-ban.user.js
Last active January 12, 2017 17:17
Mailman Always Discard and Ban (Greasemonkey Script)
// ==UserScript==
// @name Mailman Always Discard and Ban
// @namespace https://bendechrai.com/
// @description Automatically selects "Discard" and ticks the "Add" and Ban" checkboxes on Mailman admin requests for pending messages
// @downloadURL TBA
// @match *://*/mailman/admindb/*
// @match *://*/lists/admindb/*
// @version 1
// @grant none
// ==/UserScript==
@bendechrai
bendechrai / parse-westpac
Created October 28, 2014 11:17
Simple parser of Westpac statements
#!/usr/bin/php
<?php
/**
* Simple parser of Westpac statements
* @author Ben Dechrai <ben@dechrai.com>
* @license http://www.json.org/license.html
*
* Run ./parse-westpac input.txt output.csv
*
@bendechrai
bendechrai / meetup_rand.php
Last active August 29, 2015 14:06
Meetup random attendee selector
<?php
$ug = 'Melbourne-PHP-Users-Group'; // Usergroup slug
$eid = '202990892'; // Event ID
$html = file_get_contents("http://www.meetup.com/$ug/events/$eid/");
preg_match_all("#<a href=\"http://www.meetup.com/$ug/members/[0-9]*\">([^<]*)</a>#", $html, $array);
$names = $array[1];
$winner = array_rand( array_unique( $names ));
echo $names[$winner] . "\n";
@bendechrai
bendechrai / gnupg_backup
Last active August 29, 2015 14:03
.gnupg file backup helper
#!/bin/bash
# Helper script used to back up your gnupg directory
#
# Author: Ben Dechrai <ben@ctoforhire.com.au>
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.txt>
#
# Installation instructions:
# wget https://gist.githubusercontent.com/bendechrai/8bbde547642404a4986c/raw/8049dcd7def5b2c96c28c7dd3b09933d2d5c9190/gnupg_backup -O ~/.gnupg/backup