Skip to content

Instantly share code, notes, and snippets.

@dcai
dcai / configure-cli.sh
Created March 5, 2012 14:37
confgiure of php 5.4 for OS X 10.7 Lion
'./configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/private/etc' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-dba' '--with-ndbm=/usr' '--enable-exif' '--enable-ftp' '--with-gd' '--with-freetype-dir=/usr/X11/' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/X11/' '--enable-gd-native-ttf' '--with-icu-dir=/usr' '--with-iodbc=/usr' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--with-libedit=/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--without-pear' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/mysql/mysql.sock' '--with-readline=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy' '--enable-wddx' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr' '--enabl
@dcai
dcai / configure-cli.sh
Created March 6, 2012 05:55
php 5.3.10 for OS X Lion
'./configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/private/etc' '--with-config-file-path=/etc' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--with-curl=/usr' '--enable-dba' '--with-ndbm=/usr' '--enable-exif' '--enable-ftp' '--with-gd' '--with-freetype-dir=/usr/X11' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/X11' '--enable-gd-native-ttf' '--with-iodbc=/usr' '--with-ldap=/usr' '--with-ldap-sasl=/usr' '--with-libedit=/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/mysql/mysql.sock' '--with-readline=/usr' '--enable-shmop' '--with-snmp=/usr' '--enable-soap' '--enable-sockets' '--enable-sqlite-utf8' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy' '--enable-wddx' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-xsl=/usr' '--enable-zend-multibyte'
"""""""""""""""""""""""""""""""""""""""
" __ _ "
" ____/ /________ _(_) "
" / __ / ___/ __ `/ / "
" / /_/ / /__/ /_/ / / "
" \__,_/\___/\__,_/_/ "
" "
" Dongsheng Cai <[email protected]> "
" "
"""""""""""""""""""""""""""""""""""""""
@dcai
dcai / .editorconfig
Last active May 6, 2025 07:57
git config gitconfig
root = true
[*]
indent_style = tab
@dcai
dcai / 2010-10-02-14-00-test-migration.py
Created June 26, 2012 14:08 — forked from galvez/2010-10-02-14-00-test-migration.py
A minimalist Python migration management script based on Fabric and sqlwitch
# 2010-10-02 14h00
# Update created field in user_prefs table
def migrate(db):
with db.select('user_id, created', from_='users'):
all_users = db.fetchall()
for user in all_users:
with db.update('user_prefs') as obj:
obj.created = user['created']
db.where('user_id = %s', user['user_id'])
@dcai
dcai / gist:3187294
Created July 27, 2012 10:20
Restore dmg image
sudo asr restore -source /Volumes/saturn/Software/InstallESD.dmg -target /Volumes/InstallOSX/ -erase -noverify --noprompt
@dcai
dcai / tmux.conf-2.x
Last active May 6, 2025 07:57
tmux config
# Author: Dongsheng Cai
#
# Gist: https://gist.github.com/dcai/3824286
#
# c-d to close shell
# <prefix> s to switch to another session
# <prefix> f to find a window
# <prefix> o to switch to another panel
# <prefix> ! to close other panes except current one
# <prefix> x Kill the current pane
@dcai
dcai / gist:3825564
Created October 3, 2012 07:20
Hide/show vbox menubar and status bar
VBoxManage setextradata global GUI/Customizations noMenuBar,noStatusBar
VBoxManage setextradata global GUI/Customizations MenuBar,StatusBar
@dcai
dcai / .bashrc
Last active April 25, 2020 13:35
minimal .bashrc
#!/bin/bash
# https://gist.github.com/dcai/3847582/
[[ -r /etc/bash_completion ]] && source /etc/bash_completion
# TERM COLOR
export WHITE="\033[1;37m"
export YELLOW="\033[1;33m"
export GREEN="\033[1;32m"
@dcai
dcai / item.xml
Last active December 14, 2015 16:09
EQUELLA resource integration information
<xml>
<script/>
<integration>
<moodlecoruseidnumber/>
<moodlecourseid>2</moodlecourseid>
<moodlecourseshortname>M101</moodlecourseshortname>
<moodlecoursefullname>Moodle 101</moodlecoursefullname>
</integration>
<item id="ee50ebe5-82a2-45d7-9868-9ac305a49670" itemdefid="2a6022ef-7947-47c6-bb6d-b1b9c2bbbba4" itemstatus="live" key="1287" moderating="false" version="1">
<itembody>