Skip to content

Instantly share code, notes, and snippets.

View leogdion's full-sized avatar

leogdion leogdion

View GitHub Profile
#!/bin/sh
ipaddress=`ifconfig eth0 | awk '/inet addr/ {print $2}' | cut -f2 -d:`
sed -e "s/^/${ipaddress} /" /usr/local/etc/hostnames
@leogdion
leogdion / php_cgi.sh
Created June 13, 2013 18:27
php script for
#!/bin/sh
#
# php-cgi - php-fastcgi swaping via spawn-fcgi
#
# chkconfig: - 85 15
# description: Run php-cgi as app server
# processname: php-cgi
# config: /etc/sysconfig/phpfastcgi (defaults RH style)
# pidfile: /var/run/php_cgi.pid
# Note: See how to use this script :
#!/bin/bash
# Generate a random password
# $1 = number of characters; defaults to 32
# $2 = include special characters; 1 = yes, 0 = no; defaults to 1
function randpass() {
[ "$2" == "0" ] && CHAR="[:alnum:]" || CHAR="[:graph:]"
cat /dev/urandom | tr -cd "$CHAR" | head -c ${1:-32}
echo
}
node_modules
config.json
examples
examples.zip