This file contains 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
2016/11/25 09:47:39 [19567] params.c:Parameter() - Ignoring badly formed line in config file: ignore errors | |
2016/11/25 09:47:39 [19567] name lookup failed for 119.162.158.222: Name or service not known | |
2016/11/25 09:47:39 [19567] connect from UNKNOWN (119.162.158.222) | |
2016/11/25 01:47:39 [19567] rsync on ftpuserhome/13/test/ from rsyncer@UNKNOWN (119.162.158.222) | |
2016/11/25 01:47:39 [19567] building file list | |
2016/11/25 01:47:39 [19567] 2016/11/25 01:47:39 119.162.158.222 ftpuserhome 13/test/1234.jpg 83186 | |
2016/11/25 01:47:39 [19567] sent 83,292 bytes received 55 bytes total size 83,135 | |
2016/11/25 09:53:21 [19640] params.c:Parameter() - Ignoring badly formed line in config file: ignore errors | |
2016/11/25 09:53:21 [19640] name lookup failed for 119.162.158.222: Name or service not known | |
2016/11/25 09:53:21 [19640] connect from UNKNOWN (119.162.158.222) |
This file contains 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
/*genarate javascript namspace function*/ | |
var _ns= {}; | |
_ns.genNameSpace= function(path, loseMe){ | |
var reg = /^[_$a-z]+[_$a-z0-9]*/i; | |
var nsAr = path.split('.'); | |
var stringCommond = ""; | |
var stringNS = ""; | |
var n = loseMe ? nsAr.length - 1 : nsAr.length; | |
for (var i = 0; i < n; i++){ | |
if(!reg.test(nsAr[i])) { |
This file contains 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
#!/bin/bash | |
machine_type=f1-micro | |
image=ubuntu-14-04 | |
gcloud compute instances create shadowsocks-1 \ | |
--can-ip-forward --image $image --restart-on-failure \ | |
--zone asia-east1-b --machine-type $machine_type \ | |
--metadata-from-file startup-script=bin/shadowsocks-startup.sh |
This file contains 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 A { | |
public static $name = null; | |
public static function whoami() { | |
if (!static::$name) { | |
static::$name = get_called_class(); | |
} | |
return static::$name; | |
} | |
} |
This file contains 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 fileCacheHandler | |
{ | |
private static $_instance = null; | |
private static $cacheDir = "/dev/shm/cache_file/"; | |
public static function getInstance() | |
{ | |
if (!static::$_instance) { | |
static::$_instance = new static; | |
} |
This file contains 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 redisFileCacheHandler | |
{ | |
private static $_instance = null; | |
private static $cacheDir = "filecache:"; | |
protected $redisWrite = null; | |
public static function getInstance() | |
{ | |
if (!static::$_instance) { | |
static::$_instance = new static; |
This file contains 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
abstract class Singleton | |
{ | |
private static $instances = array(); | |
protected function __construct() {} | |
public static function getInstance() | |
{ | |
$class = get_called_class(); | |
if (!isset(self::$instances[$class])) { | |
self::$instances[$class] = new static(); | |
} |
This file contains 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
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
This file contains 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
#How to clear the local DNS cache | |
#macOS Sierra 10.12.0 | |
sudo killall -HUP mDNSResponder | |
#OSX 10.11.0 | |
sudo killall -HUP mDNSResponder | |
#OSX 10.10.4 | |
sudo killall -HUP mDNSResponder |
This file contains 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
1.查看系统支持的字符集 | |
# locale -a | |
2.更改系统支持的字符集支持 | |
# vi /etc/sysconfig/i18n | |
LANG="en_US.UTF-8" | |
SUPPORTED="zh_CN.UTF-8:zh_CN:zh" |