Skip to content

Instantly share code, notes, and snippets.

build php from source x86_64-unknown-cygwin
./configure --prefix=/opt/php/5.5.12 --with-config-file-path=/opt/php/5.5.12/etc --with-openssl --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-enchant --with-gd --with-t1lib --enable-gd-native-ttf --with-gettext --with-gmp --with-mhash --with-iconv --with-imap --with-imap-ssl --enable-intl --enable-mbstring --with-libmbfl --with-onig --with-mcrypt --with-mysql --with-mysqli --enable-embedded-mysqli --enable-pcntl --enable-opcache --with-pdo-mysql --with-pdo-pgsql --with-pgsql --with-pspell --with-libedit --with-readline --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-pear --enable-mysqlnd
@iongion
iongion / gist:9229105
Created February 26, 2014 13:01
Shell execution with chain support, break on error, break if invoked command does not exist, print error message in red :P
def shell(*cmds)
output = ""
cmds.each do |cmd|
begin
stop = false
stdout_str, stderr_str, status = Open3.capture3(cmd)
output = "#{output}#{stdout_str}#{stderr_str}"
if status.success?
context = "#{cmd}\n#{stdout_str}"
else
@iongion
iongion / networktools
Created February 13, 2014 14:49
Check if IP or hostnames are local, with loose restrictions on host name
function ipv42long(addr) {
var octets = addr.split('.')
return (parseInt(octets[0]) * 16777216) + (parseInt(octets[1]) * 65536) + (parseInt(octets[2]) * 256) + parseInt(octets[3])
}
function isPrivateIP(addr) {
var is_private = false,
ranges = [
['10.0.0.0', '10.255.255.255'],
['172.16.0.0', '172.31.255.255'],