Skip to content

Instantly share code, notes, and snippets.

View serweb-labs's full-sized avatar

Luciano Rodríguez serweb-labs

View GitHub Profile
@alobato
alobato / start-stop-example.sh
Created March 3, 2012 23:09
start-stop-example
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=foo
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/usr/local/bin/bar
@aeurielesn
aeurielesn / util.php
Created July 31, 2011 03:47
Decode Unicode strings in PHP
<?php
#source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char
function replace_unicode_escape_sequence($match) {
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
}
function unicode_decode($str) {
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str);
}
@jbarber
jbarber / 10-install_binaries.sh
Created July 20, 2011 10:18
Quick Oracle 11g install on RHEL5
#!/bin/bash
set -e
. CONFIG
# Satisfy the prerequisites for Oracle 11g and install the binaries
for i in oinstall dba oper asmadmin asmdba asmoper; do groupadd $i; done
useradd -g oinstall -G dba,oper,asmdba oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper grid