Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
@dashed
dashed / gulpfile-env.js
Created January 7, 2014 12:38
Interesting and useful gulp snippets.
/*
From https://github.com/gulpjs/gulp/issues/101. Organize gulpfile.js using concept of environment variables.
1. Set up sub-tasks to behave in a certain according to env var; may be env agnostic.
2. Set up high-level tasks to run a group of sub-tasks to orchestrate a behaviour (testing, staging, prod, etc)
*/
var R = 0;
var ENV_SWITCH = void 0;
@nrocine
nrocine / Installation of Kafka
Created January 9, 2014 18:15
Installation of Kafka on Vagrant Ubuntu Base Box. We may not want to use the ppa:webupd8team/java PPA to install HotSpot JDK. http://kafka.apache.org/documentation.html#quickstart
mkdir ~/kafka
vagrant init metrics http://files.vagrantup.com/precise64.box
vagrant up
vagrant ssh
sudo apt-get update
sudo apt-get install curl
sudo apt-get install python-software-properties
@mtigas
mtigas / gpg.conf
Last active April 7, 2016 03:41
hide your PGP version & other info
#~/.gnupg/gpg.conf
# Hide your PGP version & other PGP version metadata with these two config lines.
# This line hides the "Version: GnuPG vX.XX.XX" line
no-emit-version
# This line hides the "Comment: XXXXX" lines
no-comments
# NOTE if you are using Thunderbird+Enigmail you probably need to set this again in
# the Enigmail->Preference settings:
@pudquick
pudquick / informant2.py
Last active April 29, 2016 19:56
A multiple file sender for https://github.com/Steveice10/FBI (version 2.0+ only!), written in python
#!/usr/bin/env python
import socket, shutil, os.path, struct, sys
def usage():
print "For FBI 2.0+ only! https://github.com/Steveice10/FBI"
print "If you need 1.0 compatibility, check: https://gist.github.com/pudquick/66ae2238367ae76528e1"
print "Usage: informant2.py ip.address.here filename.cia [second.cia third.cia ...]"
sys.exit(1)
def main():
@peterc
peterc / irb3.rb
Created September 19, 2011 14:17
irb3 - Run an IRB-esque prompt over multiple Ruby implementations at once using RVM
#!/usr/bin/env ruby
# encoding: utf-8
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple
# versions of Ruby at once (using RVM)
#
# By Peter Cooper, BSD licensed
#
# Main dependency is term-ansicolor for each impl:
# rvm exec gem install term-ansicolor
@philip-loggly
philip-loggly / Loggly rsyslog on EC2 boot
Last active April 22, 2017 18:05
An init.d script that automatically configures rsyslog logging to Loggly
#!/bin/sh
#
# This script automatically configures rsyslog for Loggly. This script requires that the
# your Customer Token is passed in via EC2 user-data, on its own line, as follows:
#
# LOGGLY_AUTH=<your auth token>
#
# For example, if your Customer Token is 727bae3d-750c-4e44-96ed-ad83230208bb, then pass
#
# LOGGLY_AUTH=727bae3d-750c-4e44-96ed-ad83230208bb
@phrawzty
phrawzty / extant_infra_terraform.md
Last active June 16, 2017 00:40
Dealing with extant AWS resources in Terraform

What it is

Problem: Terraform doesn't play nicely with pre-existing infrastructure.

Solution: Officially there isn't one - but here's a work-around that does the trick.

Summary

  • Declare a new, temporary resource in your Terraform plan that is nearly identical to the extant resource.
  • Apply the plan, thus instantiating the temporary "twinned" resource and building a state file.
@benr77
benr77 / MemcachedWrapper.php
Last active September 17, 2017 08:23
Memcached wrapper for persistent connections
<?php
namespace ChaletOps\BaseBundle\Utils;
/**
* Class MemcachedWrapper
*/
class MemcachedWrapper extends \Memcached
{
@viccherubini
viccherubini / build.xml
Created November 10, 2012 11:26
Symfony Phing build.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project name="Sample Symfony Application" default="build">
<resolvepath propertyName="root_path" file="./" />
<resolvepath propertyName="config_path" file="./app/config/" />
<php function="date" returnProperty="build_date">
<param value="c" />
</php>