Skip to content

Instantly share code, notes, and snippets.

@granella
granella / generate-certificate-chain.sh
Created June 27, 2016 11:15
Create self-signed certificate with root and ca for development
#!/bin/bash
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
echo "===================================================="
# generate private keys (for root and ca)
@jberger
jberger / websocket.pl
Last active August 29, 2015 14:05
Updated WebSocket DBI Example
#!/usr/bin/env perl
use Mojolicious::Lite;
use DBIx::Connector;
my $dbname = $ENV{MOJO_DBNAME} || 'database.db';
# add helper methods for interacting with database
helper connector => sub {
state $db = DBIx::Connector->new("dbi:SQLite:$dbname","","") or die "Could not connect";
@MattRK
MattRK / dhcpc-event
Last active August 29, 2015 14:03
CloudFlare Dynamic DNS Update Script for AsusWRT-Merlin
#!/bin/sh
#Wait 30 seconds so that the WAN can come up properly before continuing
sleep 30
#Get the new IP
IP=`wget -O - -q http://icanhazip.com`
#Update Cloudflare with the new IP
/opt/bin/wget -O - -q https://www.cloudflare.com/api_json.html --no-check-certificate --post-data "a=rec_edit&tkn=[YOUR API TOKEN]&email=[YOUR EMAIL ADDRESS]&z=[YOUR ZONE NAME]&id=[YOUR RECORD ID]&type=A&name=[RECORD NAME]&ttl=1&content=$IP"