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
#receiver has ip | |
#receiver | |
nc sender-IP sender-port > rece.file | |
#sender | |
nc -l sender-port < send.file | |
#receiver doesn't have ip | |
#sender |
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
Summary: PHP 5 - A powerful scripting language | |
Name: php5 | |
Version: 5.4.14 | |
Release: 1 | |
Source0: php-5.4.14.tar.gz | |
Group: Networking/Daemons | |
License: GPLv2 | |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot | |
BuildPrereq: libmcrypt-devel | |
BuildPrereq: libmcrypt |
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
#vim下查看换行符 | |
set list | |
#vim下查看windows换行符 | |
e ++ff=unix % | |
#替换windows换行符 | |
%s/^M$//g |
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
#select data group by day 按天统计数据 | |
select count(id),DATE_FORMAT(time,'%Y-%m-%d') from user where TO_DAYS(NOW()) - TO_DAYS(time)<=100 group by DATE_FORMAT(time,'%Y-%m-%d') order by time desc; |
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
NSError *error = nil; | |
NSData *jsonData = [json dataUsingEncoding:NSUTF8StringEncoding]; | |
if (jsonData) { | |
id jsonObjects = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error]; | |
if (error != nil) { | |
NSAssert(true, @"error is %@", [error localizedDescription]); | |
} |
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
#计算脚本运行时间 | |
time xxxx | |
#输出文件长度 | |
ls -l | awk '{ print $5}' | |
#判断文件是否为空 | |
ls -l | awk '{ if(!$5) print "empty" }' | |
#计算目录下所有.c文件行数 |
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
/** | |
* group by day | |
* @link https://gist.github.com/phnessu4/5636642 | |
* @param query document {key1:123,key2:456} | |
*/ | |
var count_by_day = function(query){ | |
return db.action.group( | |
{ | |
keyf: function(doc) { | |
var date = new Date(doc.time); |
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 | |
//Export Caesar Hash | |
$hash = array_flip(array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f')); | |
$hash_length = count($hash); | |
$arr = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); | |
foreach ($hash as $key => $value) { | |
$arr_index = rand(0, count($arr)-1); | |
$hash[$key] = $arr[$arr_index]; |
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
/** | |
* @doc http://fuelphp.com/docs/classes/mongo/methods.html | |
* has changed by remove profiling setting | |
* | |
* sample config | |
* 'mongodb' => array( | |
* 'hostname' => 'localhost', | |
* 'database' => 'database', | |
* 'username' => 'admin', | |
* 'password' => 'admin', |
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
#删除git submodule | |
git rm --cached /path/to/source |
OlderNewer