Skip to content

Instantly share code, notes, and snippets.

View brucewu16899's full-sized avatar

Bruce.Wu brucewu16899

  • Hsinchu, Taiwan
View GitHub Profile
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
/**
* jQuery MD5 hash algorithm function
*
* <code>
* Calculate the md5 hash of a String
* String $.md5 ( String str )
* </code>
*
* Calculates the MD5 hash of str using the » RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
* MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data.
<?php
/*
@author : Giriraj Namachivayam
@date : Mar 20, 2013
@demourl : http://ngiriraj.com/socialMedia/oauthlogin/msn.php
@document : http://ngiriraj.com/work/hotmail-connect-by-using-oauth/
@license : Free to use,
@History : V1.0 - Released oauth 2.0 service providers login access
@oauth2 : Support following oauth2 login
Bitly
# Command Line to run from terminal
# Logs result to file s3_backup.log
# Command will run in the background
s3cmd sync -v /path/to/folder/ s3://s3-bucket/folder/ > s3_backup.log 2>&1 &
# Crontab command to sync folder to S3
# Command will run 1am every day and logs result to /root/s3_backup.log
0 1 * * * /usr/bin/s3cmd sync -rv /path/to/folder/ s3://s3-bucket/folder/ >> /root/s3_backup.log
<?php
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
$iPod = stripos( $_SERVER['HTTP_USER_AGENT'], "iPod" );
$iPhone = stripos( $_SERVER['HTTP_USER_AGENT'], "iPhone" );
$iPad = stripos( $_SERVER['HTTP_USER_AGENT'], "iPad" );
$Android = stripos( $_SERVER['HTTP_USER_AGENT'], "Android" );
$webOS = stripos( $_SERVER['HTTP_USER_AGENT'], "webOS" );
/var/www/site1/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
/var/www/site2/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
/var/www/site3/nginx.conf IN_MODIFY,IN_NO_LOOP /usr/local/sbin/nginx-reload.sh
@brucewu16899
brucewu16899 / EC2_URL
Last active August 29, 2015 14:07 — forked from gnuyoga/EC2_URL
Region Endpoint Protocol
US East (Northern Virginia) ec2.us-east-1.amazonaws.com HTTP and HTTPS
US West (Oregon) ec2.us-west-2.amazonaws.com HTTP and HTTPS
US West (Northern California) ec2.us-west-1.amazonaws.com HTTP and HTTPS
EU (Ireland) ec2.eu-west-1.amazonaws.com HTTP and HTTPS
Asia Pacific (Singapore) ec2.ap-southeast-1.amazonaws.com HTTP and HTTPS
Asia Pacific (Tokyo) ec2.ap-northeast-1.amazonaws.com HTTP and HTTPS
South America (Sao Paulo) ec2.sa-east-1.amazonaws.com HTTP and HTTPS
#################
#### MODULES ####
#################
$ModLoad imuxsock # provides support for local system logging
$ModLoad imfile
###########################
#### GLOBAL DIRECTIVES ####
###########################
$InputFileName /var/log/nginx/access.log
$InputFileTag nginx-acess:
$InputFileStateFile stat-nginx-access
$InputFileSeverity info
$InputRunFileMonitor
server {
server_name localhost;
listen 80;
auth_basic "Restricted Area";
auth_basic_user_file /etc/nagios3/htpasswd.users;
root /usr/share/nagios3/htdocs;
index index.php index.html;