Skip to content

Instantly share code, notes, and snippets.

View Synchro's full-sized avatar

Marcus Bointon Synchro

View GitHub Profile
@Synchro
Synchro / gist:1139429
Created August 11, 2011 11:29
PHP Base-62 encoder/decoder
<?php
/**
* This is an example of a practical encoder and decoder for base-62 data in PHP
* It differs from the majority of examples in that it's fast enough for moderate data sizes, unlike multiprecision converters
* To be practical, base-62 encoding needs to use internal chunking and padding because base-62 does not fit exactly into any integral number of bits
* This means the output is not quite compatible with multiprecision conversions,
* but the encoded data retains all the desirable properties of base-62, so (unlike any base-64 encoding) it's URL, DNS, email address and pathname safe
* @author Marcus Bointon <marcus@synchromedia.co.uk>
* @copyright 2011 Marcus Bointon
* @license http://www.opensource.org/licenses/mit-license.html MIT License
#!/bin/sh
#Provides add-apt-repository
sudo apt-get install -y python-software-properties
#use jtimberman's chef ppa for installation
sudo add-apt-repository ppa:jtimberman/opschef
sudo apt-get update
sudo apt-get upgrade -y
#This step asks for a chef server url to put in /etc/chef/client.rb
sudo apt-get install -y chef