This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $res = popen("ls 2>&1","r")){ | |
while ( !feof($res) ) $result .= fgets( $res, 1024 ); | |
pclose($res); | |
echo $result; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 请注意修改部分参数,如安装mysql-server时,设置 MySQL root 密码,以便自动安装 | |
# 更换为aliyun的源镜像 | |
#mkdir ~/installations | |
#mkdir backups | |
#cd ~/installations | |
#https://gist.githubusercontent.com/fasthold/6d0ac7528a7c528eb886/raw/4cbd8f4709c3c4ec1d2fbbb3e4f3dd65e9694aab/ubuntu-12.04-server-aliyun-mirror.sources.list | |
#sudo mv /etc/apt/sources.list ~/installations/backups/sources.list | |
#sudo cp ~/installations/ubuntu-12.04-server-aliyun-mirror.sources.list /etc/apt/sources.list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// from http://encode-base62.nichabi.com/php-function.php | |
function base62_encode ($data) { | |
$outstring = ''; | |
$len = strlen($data); | |
for ($i = 0; $i < $len; $i += 8) { | |
$chunk = substr($data, $i, 8); | |
$outlen = ceil((strlen($chunk) * 8) / 6); | |
$x = bin2hex($chunk); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 用于digital ocean的vps | |
# System related | |
sudo apt-get update | |
sudo apt-get -y install build-essential ssh curl software-properties-common python-software-properties python g++ make | |
# Editor | |
sudo apt-get -y install vim | |
# VCS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'environment' => 'development', | |
'database' => array( | |
'adapter' => 'mongodb', // set to 'mongodb' | |
/** @see http://cn2.php.net/manual/en/mongoclient.construct.php */ | |
'params' => array( | |
'connection_string' => 'mongodb://localhost:27017', | |
'dbname' => 'wow', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The host, user name and password are stored in variables. | |
# Change the text between the quotes with your own settings. | |
$hostname="192.168.1.x" | |
$user="username" | |
$password="password" | |
# Variables are also used to store the local and remote path | |
# of the website. | |
$localwebfolder="D:\path\to\backup\folder" | |
$remotewebfolder="/remote/sub/foler" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class for working with wood Adjacency List | |
* see down sql 'show create table' | |
* | |
* @author Alexander Kapliy <[email protected]> | |
*/ | |
class AdjacencyList { | |
protected $tbl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PHP] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |