Skip to content

Instantly share code, notes, and snippets.

View sumardi's full-sized avatar
🏠
Working from home

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
@sumardi
sumardi / nginx.www.conf
Created December 19, 2012 14:49
Add the www to the url with nginx redirect
server {
server_name domain.com;
rewrite ^(.*) http://www.domain.com$1 permanent;
}
server {
server_name www.domain.com;
#The rest of your configuration goes here#
}
@sumardi
sumardi / gist:4307780
Created December 16, 2012 14:23
Installing posix extension for PHP
$ mkdir tmp
$ wget http://php.net/get/php-5.3.19.tar.bz2/from/sg2.php.net/mirror
$ tar xzvf php-5.3.19.tar.bz2
$ cd php-5.3.19/ext/posix
$ phpize
$ ./configure
$ make
$ cp modules/posix.so /usr/lib64/php/modules
@sumardi
sumardi / mpnml
Created November 21, 2012 10:32 — forked from romanr/mpnml
Mysql, Php-fpm, Nginx on OSX Mountain Lion
sudo port -v install mysql5-server
sudo -u _mysql mysql_install_db5
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9)
# do this:
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
@sumardi
sumardi / mysql
Created November 21, 2012 09:26
Brew Nginx + PHP-fpm + MySQL on Mac OS X 10.8.2
$ brew install mysql
$ brew list mysql
/usr/local/Cellar/mysql/5.5.28/bin/resolveip
/usr/local/Cellar/mysql/5.5.28/bin/resolve_stack_dump
/usr/local/Cellar/mysql/5.5.28/bin/replace
/usr/local/Cellar/mysql/5.5.28/bin/perror
/usr/local/Cellar/mysql/5.5.28/bin/mysqltest
/usr/local/Cellar/mysql/5.5.28/bin/mysqlslap
/usr/local/Cellar/mysql/5.5.28/bin/mysqlshow
@sumardi
sumardi / org.php.php-fpm.plist
Created November 20, 2012 09:28
Install Nginx + PHP-fpm + MySQL on Mac OS X Lion 10.7.2
# First install requirements for BREW
# http://mxcl.github.com/homebrew/
# https://github.com/mxcl/homebrew/wiki/installation
# Requirements
# - An Intel CPU 2
# - OS X 10.5 or higher
# - Command Line Tools for Xcode (https://developer.apple.com/downloads)
# or Xcode with X11 (http://itunes.apple.com/us/app/xcode/id448457090)
# - Java Developer Update (https://connect.apple.com/)
@sumardi
sumardi / example.php
Created November 18, 2012 14:30
MyDNSToolBox API PHP class
<?php
define('TOKEN', 'INSERT_YOUR_TOKEN_HERE');
require_once 'mydnstoolbox.php';
$t = new MyDNSToolbox(TOKEN, 'json');
// var_dump($t->createZone('domain.com', '[email protected]'));
// var_dump($t->deleteZone('domain.com'));
// var_dump($t->createRecord('domain.com', 'testapi', 'A', '202.188.0.133'));
@sumardi
sumardi / gist:4057873
Created November 12, 2012 06:56
[Git] Clone remote branch
$ git clone git://example.com/myproject
$ cd myproject
$ git branch
* master
$ git branch -a
* master
origin/HEAD
origin/master
origin/v1.0-stable
origin/experimental
@sumardi
sumardi / gist:3982350
Created October 30, 2012 19:14
PHP Developer - Contract Basis

I am looking for a Web Application Developer (PHP) to help with our in-house apps development. We can talk about the app in more details after NDA signed.

You MUST have experience (that you can evidence) in;

  • PHP / OO Programming
  • Laravel 3 Framework
  • HTML5 / CSS3
  • jQuery/Javascript
  • oAuth 1.0a / 2.0
  • Git
  • Reading APIs
@sumardi
sumardi / gist:3936651
Created October 23, 2012 04:26
Laravel nginx config
server {
listen 80;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
root /var/www/example.com;
index index.php;
@sumardi
sumardi / gist:3819725
Created October 2, 2012 14:47
Installing OAuth extension
cd /usr/local/directadmin/custombuild
wget http://pecl.php.net/get/oauth
tar xvzf oauth-1.2.3.tgz
cd oauth-1.2.3
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make test
make install
cp modules/oauth.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/