Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alexbilbie's full-sized avatar
👋

Alex Bilbie alexbilbie

👋
View GitHub Profile
@alexbilbie
alexbilbie / hook.rb
Created March 4, 2016 14:19 — forked from asimihsan/hook.rb
Hook for letsencrypt.sh to do DNS challenges
#!/usr/bin/env ruby
require 'aws-sdk'
require 'pry'
require 'awesome_print'
# ------------------------------------------------------------------------------
# Credentials
# ------------------------------------------------------------------------------
# pick up AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY by default from
DOCKER_ENV="$HOME/.dockerenv"
DOCKER_MACHINE_NAME="default"
# Docker environment helpers
denv() {
eval "$(cat $DOCKER_ENV)"
}
dstart() {
####################################################################################################
# PrimeWireProxy.co.uk - a reverse proxy to allow blocked users access to PrimeWire.ag.
#
# When ever a proxy falls victim to internet censorship, another needs to replace it. A single,
# cheap ($15 per month) VPS is all you need to provide this service to others. NGINX is brilliant
# for this and will serve thousands of requests with no trouble. Just replace `primewire.ag` and
# `primewireproxy.co.uk` below to suite your needs.
#
# Say NO to Internet Censorship!
#
@alexbilbie
alexbilbie / gist:6976275
Created October 14, 2013 14:10
Find nodes with duplicate properties
// Replace <INDEX> and <PROPERTY>
START n=node:<INDEX>('*:*')
WITH n
ORDER BY id(n) DESC // Order by descending to delete the most recent duplicated record
WITH n.<PROPERTY>? as DuplicateKey, COUNT(n) as ColCount, COLLECT(id(n)) as ColNode
WITH DuplicateKey, ColCount, ColNode, HEAD(ColNode) as DuplicateId
WHERE ColCount > 1 AND (DuplicateKey is not null) AND (DuplicateId is not null)
WITH DuplicateKey, ColCount, ColNode, DuplicateId
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@alexbilbie
alexbilbie / jenkins.md
Created August 13, 2013 14:36 — forked from skl/jenkins.md

Creating a new Jenkins Server

First step, make sure java -version reports 1.6 or higher. If the command fails or the version isn't high enough, download the latest version of Java JDK from Oracle (http://www.oracle.com/technetwork/java/javase/downloads/index.html) (jdk-7u25-linux-x64.tar.gz at the time of writing) - a quick uname -m will let you know if you need the 32 or 64bit version. Installation instructions are available here (http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html#install-64).

My preference is to extract these to /usr/local and then ln -s /usr/local/jdk1.7.0_25 /usr/local/jdk.

Add /usr/local/jdk/bin to your $PATH.

Download the latest Jenkins WAR (1.519 currently) file from http://mirrors.jenkins-ci.org/war/latest/.

#!/usr/local/bin/bash
COMPASS="/usr/local/bin/compass"
case "$1" in
   ""|start)
   echo "Starting compass watch..."
   if [ -f ./cwatch.pid ]
then
echo "Sorry, but compass is already watching this folder..."
@alexbilbie
alexbilbie / paths.php
Created March 30, 2013 13:54
Laravel 3 autoload Composer
# Add after $paths['public']
// --------------------------------------------------------------
// The path to the composer vendors directory.
// --------------------------------------------------------------
$paths['composer'] = 'vendor';
$regions = [];
$potentialRegion = 0;
function adjacentPixelIsBlack($x, $y)
{
if ( ! isset($matrix[$x][$y+1]))
{
return false;
}
Holly Madison has settled on a name for her newborn daughter - and it's very colourful indeed.
The 33-year-old former Playboy model and her boyfriend, Pasquale Rotella, 38, have called the little girl Rainbow Aurora Rotella.
'I wanted to give my daughter a unique name,' she told E! on Friday.
'So happy': New mother Holly Madison shared this picture of herself and partner Pasquale Rotella on Friday
'Growing up, there was a girl in my school named Rainbow and I was so envious of that name. I thought it was so pretty and unique'