Skip to content

Instantly share code, notes, and snippets.

View pcdinh's full-sized avatar

Pham Cong Dinh pcdinh

View GitHub Profile
# php 5.3 snow leopard
# need 64 bit mysql as /usr/local/mysql
# compile apache
./configure --enable-layout=Darwin --enable-mods-shared=all
make
sudo make install
# now configure php. then make; sudo make install
CFLAGS="-arch x86_64" \
./configure \
--with-apxs2=/usr/sbin/apxs --prefix=/usr/local/php5.2.8 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d \
--with-config-file-path=/usr/local/php5.2.8/php.d \
--disable-posix \
--enable-cli \
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-jpeg-dir=/opt/local/include --with-png-dir=/opt/local/include --enable-gd-native-ttf --with-freetype-dir=/usr/local/php5.2.8 \
--with-zlib \
--enable-pdo --with-pdo-sqlite --with-sqlite=shared --enable-sqlite-utf8 \
var Iamstef = Iamstef || {};
(function(lib){
var url = document.URL,
api = {};
api.path = function(regex,fcn){
var result = url.match(regex);
if(result){
fcn(result);
tail -f /usr/local/apache2/logs/access.log | awk '{print $1,$7,$10,$8}'
@pcdinh
pcdinh / utils.js
Created December 9, 2009 09:34 — forked from bavardage/utils.js
function randomColor() {
var color = (0xffffff * Math.random()).toString(16);
return "#" + color.replace(/\./i,"").slice(0,6);
};
function fallbackFor(arg, fallback) {
return (typeof arg !== 'undefined') ? arg : fallback;
}
function require(arg, name) {
// collapse table sections
$(document).ready(function() {
$('tbody:has(th)').addClass('collapse')
.find('tr:first-child th')
.wrapInner('<a href="#"></a>')
.find('a')
.click(function() {
var $thisLink = $(this);
$thisLink
PHPLOC by Sebastian Bergmann.
Date: 2009-12-12
-----------------------
@name Spica Framework
@author pcdinh
@since March 14, 2009
-----------------------
import java.util.Random;
import org.jredis.JRedis;
import org.jredis.RedisException;
import org.jredis.ri.alphazero.JRedisClient;
public class Redis {
private static final int THREAD_COUNT = 2;
private static final int SETS_PER_THREAD = 100;
private static final int RANDOM_GETS_PER_THREAD = 500;
#!/bin/bash
# --- Version history ---
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
# Usage: cputrack [PID] [filename]
[root@m-2 ~]# procstat 32321
pid: 32321
tcomm: (DarwinStreaming)
state: S
ppid: 32320
pgid: 32320
sid: 32320
tty_nr: 0
tty_pgrp: -1
flags: 4202816