代码改变世界

阅读排行榜

Revel示例 - 验证

2013-01-30 17:00 by Danny.tian, 1318 阅读, 收藏,
摘要: 验证validation应用程序展示了每一种验证系统的使用方式。validation/app/ models user.go # User struct and validation routine. controllers app.go # Introduction sample1.go # Validating simple fields with error messages shown at top of page. sample2.go # Validating simple fields wi... 阅读全文

交叉编译Go程序

2013-01-06 15:06 by Danny.tian, 1165 阅读, 收藏,
摘要: (1)首先进入go/src 源码所在目录,执行如下命令创建目标平台所需的包和工具文件。$ cd /usr/local/go/src$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./make.bash如果是 Windows 则修改 GOOS 即可。$ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 ./make.bash(2) 现在可以编译 Linux 和 Windows 平台所需的执行文件了。$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build$ CGO_ENABLED=0 GOOS. 阅读全文

Centos7安装vagrant+virtualbox

2015-01-28 15:12 by Danny.tian, 1081 阅读, 收藏,
摘要: vim /etc/yum.repos.d/virtualbox.repo[virtualbox]name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBoxbaseurl=http://download.virtualb... 阅读全文

go get code.google.com 没有反应

2013-01-11 14:59 by Danny.tian, 856 阅读, 收藏,
摘要: $cd$GOROOT/src/cmd/go$vimvcs.go#将里面https://code.google.com改为http://code.google.com$goinstall$gogetcode.google.com/xxx 阅读全文

网络安全 - SQL Injection

2012-12-31 11:12 by Danny.tian, 815 阅读, 收藏,
摘要: 1.1.1 摘要 日前,国内最大的程序员社区CSDN网站的用户数据库被黑客公开发布,600万用户的登录名及密码被公开泄露,随后又有多家网站的用户密码被流传于网络,连日来引发众多网民对自己账号、密码等互联网信息被盗取的普遍担忧。 网络安全成为了现在互联网的焦点,这也恰恰触动了每一位用户的神经,由于设计的漏洞导致了不可收拾的恶果,验证了一句话“出来混的,迟早是要还的”,所以我想通过专题博文介绍一些常用的攻击技术和防范策略。 SQL Injection也许很多人都知道或者使用过,如果没有了解或完全没有听过也没有关系,因为接下来我们将介绍SQL Injection。1.1.2 正文 SQL Injec 阅读全文

putty 中文乱码解决方法

2013-02-18 16:27 by Danny.tian, 677 阅读, 收藏,
摘要: 打开putty主程序,选择window-〉Appearance-〉Font settings-〉Change...,选择Fixedsys字体,字符集选择CHINESE_GB2312。在window-〉Translation中,Received data assumed to be in which character set 中,把Use font encoding改为UTF-8如果经常使用,把这些设置保存在session里面.现在打开putty,登录成功后,在shell中输入:export LC_ALL='zh_CN.utf8' 阅读全文

Asp.net MVC 添加httpOnly属性

2013-01-01 20:14 by Danny.tian, 634 阅读, 收藏,
摘要: <httpCookieshttpOnlyCookies="false"requireSSL="false"/> 阅读全文

CentOS7安装Docker registry

2015-02-05 17:25 by Danny.tian, 619 阅读, 收藏,
摘要: 1、使用fedora 20(IP为192.168.1.103)作为测试服务器(centos 7,redhat 7通用)2、安装dockerJava代码yum-yinstalldocker docker-registry特别说明,fedora更新的docker 1.3.1提交到本地库有问题,有1.3.... 阅读全文

Go代码转到定义功能

2013-01-11 14:17 by Danny.tian, 619 阅读, 收藏,
摘要: 1. 安装ctagssudo apt-get install exuberant-ctags2. 添加 ~/.ctags文件,内容如下:--langdef=Go--langmap=Go:.go--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/3. 在sublime text 2中安装CTAGS 阅读全文

慢连接

2013-06-10 09:38 by Danny.tian, 565 阅读, 收藏,
摘要: static void Main(string[] args) { string host = "target"; int port = 8080; int max_number_of_connection = 3000; List<TcpClient> clients = new List<TcpClient>(); for (int i = 0; i < max_number_of_connection; i++) { ... 阅读全文