Skip to content

Instantly share code, notes, and snippets.

View paul91's full-sized avatar

Paul Lewis paul91

  • Domino Data Lab
  • New York, NY
View GitHub Profile
@paul91
paul91 / nyct-gtfs.js
Created September 17, 2014 15:00
Nodejs NYCT GTFS decoding example
// All thanks goes to: http://stackoverflow.com/a/25733922
var ProtoBuf = require("protobufjs");
var http = require('http');
// MTA Realtime endpoint http://datamine.mta.info/mta_esi.php?key=xxxx
var feedUrl = "...";
// Initialize from .proto file
// Requires nyct-subway.proto and gtfs-realtime.proto
@paul91
paul91 / zero.pl
Created July 9, 2014 12:18
zero.pl
#!/usr/bin/perl -w
use strict;
use Socket;
use IO::Handle;
if($#ARGV+1 != 2){
print "$#ARGV $0 Remote_IP Remote_Port \n";
exit 1;
}
@paul91
paul91 / pecl-memcached.sh
Created May 5, 2014 14:33
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@paul91
paul91 / GraphicsMagick.sh
Last active September 20, 2020 17:02
How to install GraphicsMagick on CentOS 6.4
#!/bin/bash
# Install build dependencies
yum install -y gcc libpng libjpeg libpng-devel libjpeg-devel ghostscript libtiff libtiff-devel freetype freetype-devel
# Get GraphicsMagick source
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.9.tar.gz
tar zxvf GraphicsMagick-1.3.9.tar.gz
# Configure and compile
@paul91
paul91 / collectd.sh
Last active January 22, 2020 06:40 — forked from tnolet/gist:7361441
Install collectd 5.4.1 from source on CentOS 6.5
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel perl-devel libgcrypt-devel gcc make gcc-c++ yajl-devel
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.1.tar.gz
tar zxvf collectd-5.4.1.tar.gz
@paul91
paul91 / pecl-mongo.sh
Created October 17, 2014 16:47
PECL install mongo client on CentOS 6.5
#!/bin/bash
# Resolve dependencies. If you are using a custom version of php (ex. php55w) replace it here.
yum install -y php php-devel php-pear gcc
# Use PECL to compile the extension
pecl install mongo
# Enable the mongo extension
echo "extension=mongo.so" > /etc/php.d/mongo.ini
@paul91
paul91 / keybase.md
Created November 14, 2017 17:43
keybase.md

Keybase proof

I hereby claim:

  • I am paul91 on github.
  • I am paullewis (https://keybase.io/paullewis) on keybase.
  • I have a public key ASDb1mA4t5nRJxRYXA3CHybkq0XmNZ1B3ewFWNSCtPBRiwo

To claim this, I am signing this object:

@paul91
paul91 / mac-dev.pp
Last active May 15, 2017 22:36
An example Puppet manifest for installing AppDmg and Pkg files on Mac OS X.
# An example Puppet manifest for installing AppDmg and Pkg files on Mac OS X.
#
# Great for installing all required Applications for new developers.
#
# Requirments:
# Install Puppet/Hiera/Facter
#
# Running the Provisioner:
# sudo puppet apply mac-developer.pp
#
@paul91
paul91 / ffmpeg-install.sh
Last active February 24, 2016 19:48
Install ffmpeg v1.2.4 on CentOS 6.4
#!/bin/bash
# Can be obtained from RepoForge
yum install -y yasm
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
git checkout n1.2.4
@paul91
paul91 / apache strace
Created April 7, 2014 19:47
strace_apache
# Strace an Apache request
ps auxw | grep httpd | awk '{print"-p " $2}' | xargs strace