Skip to content

Instantly share code, notes, and snippets.

View BaylorRae's full-sized avatar

Baylor Weathers BaylorRae

View GitHub Profile
@BaylorRae
BaylorRae / install.sh
Created October 12, 2012 01:30 — forked from pateketrueke/install.sh
Apache & PHP / Heroku pre-compile script
mkdir /app
# Compiling Apache
curl http://www.us.apache.org/dist/httpd/httpd-2.2.22.tar.gz | tar xzf -
cd httpd-2.2.22
./configure --prefix=/app/apache --with-z=/usr/local/zlib --enable-rewrite --enable-so --enable-deflate --enable-expires --enable-headers
make && make install
@BaylorRae
BaylorRae / bcrypt.php
Created July 30, 2011 16:47 — forked from dzuelke/bcrypt.php
How to use bcrypt in PHP to safely store passwords (PHP 5.3+ only)
<?php
// secure hashing of passwords using bcrypt, needs PHP 5.3+
// see http://codahale.com/how-to-safely-store-a-password/
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt
// just an example; please use something more secure/random than sha1(microtime) :)
$salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22);
// 2a is the bcrypt algorithm selector, see http://php.net/crypt