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
var exec = require('child_process').exec; | |
var cmdStr = 'dir'; | |
exec(cmdStr, function(err,stdout,stderr){ | |
if(err) { | |
console.log('get dir error:'+stderr); | |
} else { | |
console.log(stdout); | |
} | |
}); |
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
worker_processes 1; | |
worker_rlimit_nofile 204800; | |
pid /home/rain/下载/work/nginx.pid; | |
error_log /home/rain/下载/work/logs/error.log; | |
events { | |
use epoll; | |
worker_connections 2048; | |
multi_accept on; | |
} | |
http { |
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
# del default router | |
sudo route del -net 0.0.0.0 | |
# add internet gateway by network card A | |
sudo route add default gw 192.168.8.1 | |
# add LAN gateway for a special IP by network card B | |
sudo route add -host 10.112.39.131 gw 10.112.52.1 |
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
# 安装 | |
sudo apt-get install rails postgresql libpq-dev libmysqld-dev libmysqlclient-dev mysql-client libmagickwand-dev ImageMagick libmagickcore-dev mysql-server curl | |
#安装RVM | |
curl -L https://get.rvm.io | bash -s stable | |
#载入 RVM 环境(新开 Termal 就不用这么做了,会自动重新载入的) | |
source ~/.rvm/scripts/rvm | |
# 检查rvm是否安装正确 | |
rvm -v |
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
sudo apt-get install php5-mysql nginx php5-fpm postgresql php5-pgsql php5-gd php5-ldap php5-imap | |
sudo vi /etc/php5/fpm/php.ini | |
sudo vi /etc/php5/fpm/pool.d/www.conf | |
sudo vi /usr/share/nginx/html/info.php | |
sudo vi /etc/nginx/sites-available/default | |
sudo vi /etc/nginx/nginx.conf | |
sudo service nginx start | |
sudo service php5-fpm restart | |
chmod -R 755 ~/limesurvey/tmp | |
chmod -R 755 ~/limesurvey/upload |
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
alias es='emacsclient -c -a ""' | |
alias -s html=es | |
alias -s py=es | |
alias -s zsh=es | |
export EDITOR="es" |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > | |
<targets async="true"> | |
<target xsi:type="Console" name="console"/> | |
<target xsi:type="File" name="file" fileName="test-nlog.log"/> | |
</targets> | |
<rules> | |
<logger name="*" minlevel="Warn" writeto="console,file" /> |
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
@echo off | |
echo 正在清理系统垃圾文件,请稍等...... | |
del /f /s /q %systemdrive%\*.tmp | |
del /f /s /q %systemdrive%\*._mp | |
del /f /s /q %systemdrive%\*.log | |
del /f /s /q %systemdrive%\*.gid | |
del /f /s /q %systemdrive%\*.chk | |
del /f /s /q %systemdrive%\*.old | |
del /f /s /q %systemdrive%\recycled\*.* | |
del /f /s /q %windir%\*.bak |
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
# ip表示取服务器上tcp/udp等通信包 | |
# -i 选取那块网卡 | |
# -w 把数据包下载到那个文件中 | |
# host 表示主机 | |
# ServerIP表示服务器IP | |
# ClientIP表示客户端IP | |
tcpdump ip -i eth2 -w ~/下载/listen.dump host ServerIP and ClientIP |
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
# 解压缩tar.gz文件 | |
tar -xvzf *.tar.gz | |
# 将windows文件转码为utf8 | |
enconv filename | |
# 看文件编码 | |
enca filename | |
# 查询文本文件内容 神器 |
NewerOlder