wget下载源文件wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz 解压tar包tar -zxvf jdk-8u111-linux-x64.tar.gz 创建文件夹并拷贝java文件sudo mkdir -pv /usr/java sudo cp -r jdk1.8.0_111/ /usr/java 配置环境变量sudo nano /etc/profile export JAVA_HOME=/usr/java/jdk1.8.0_111 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH //立即生效 source /etc/profile
Linux下采用的是utf-8的字符编码，默认情况下我们的浏览器在服务器没有指定编码或者静态页面没有声明编码的情况下会以GBK的编码去渲染页面，这样默认情况下返回中文的话浏览器用gbk来解析utf-8编码，显然会出现乱码，这时要在nginx location块中主动添加header来输出正确编码添加配置add_header Content-Type 'text/html; charset=utf-8';示例location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 7d; } location ~ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Content-Type 'text/html; charset=utf-8'; } }
插件推荐 html格式化插件 HTMLBeautify js格式化插件 JsFormat css格式化插件 CSS Format 快捷键绑定找到 Key Bindings 菜单，打开如图在右侧加入如下代码[{ "keys": ["ctrl+alt+j"], "command": "js_format", "context": [{ "key": "selector", "operator": "equal", "operand": "source.js,source.json" }] }, { "keys": ["ctrl+alt+c"], "command": "css_format", "args": { "action": "expand" } }, { "keys": ["ctrl+alt+h"], "command": "html_beautify" }] 快捷键解释 ctrl+alt+h html格式化，可部分选中，不选则当前文件。 ctrl+alt+j js格式化，可部分选中，不选则当前文件。 ctrl+alt+c css格式化，可部分选中，不选则当前文件。
Mac Mysql 启停命令mysql.server start mysql.server stop mysql.server restart Mac Mysql自启动配置 用brew安装的可以通过以下语句查看安装目录 brew --prefix mysql 从安装目录下找到homebrew.mxcl.mysql.plist文件复制到～/Library/LaunchAgents目录下 cp /usr/local/opt/mysql/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 设置自启动 launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 如果不是brew命令安装的，没有homebrew.mxcl.mysql.plist文件，则自己新建如下，再按照步骤执行 <?xml version="1.0" encoding="UTF-8"?> KeepAlive <true/> Label com.mysql.mysqld ProgramArguments /usr/local/mysql/bin/mysqld_safe --user=root
源安装 On RHEL/CentOS – 32-bit OS -------------- For RHEL/CentOS 6 -------------- # wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm # rpm -ihv epel-release-6-8.noarch.rpm -------------- For RHEL/CentOS 5 -------------- # wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # rpm -ihv epel-release-5-4.noarch.rpm On RHEL/CentOS – 64-bit OS -------------- For RHEL/CentOS 7 -------------- # wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-13.noarch.rpm # rpm -ihv epel-release-7-13.noarch.rpm -------------- For RHEL/CentOS 6 -------------- # wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ihv epel-release-6-8.noarch.rpm -------------- For RHEL/CentOS 5 -------------- # wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm # rpm -ihv epel-release-5-4.noarch.rpm 添加好源后执行安装 # yum install htop On Fedora OS # yum install htop # dnf install htop [On Fedora 22+ releases] On Debian and Ubuntu # sudo apt-get install htop 编译安装 On RHEL/CentOS and Fedora # yum groupinstall "Development Tools" # yum install ncurses ncurses-devel # wget http://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz # tar xvfvz htop-2.0.2.tar.gz # cd htop-2.0.2 On Debian and Ubuntu $ sudo apt-get install build-essential $ sudo apt-get install libncurses5-dev libncursesw5-dev $ wget http://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz $ tar xvfvz htop-2.0.2.tar.gz $ cd htop-2.0.2 下载好了源码之后编译安装 # ./configure # make # make install 运行htop htop
upgrade nodenode有一个模块叫n，是专门用来管理node.js的版本的。 第一步：安装n模块： npm install -g n第二步： 升级node.js到最新稳定版 n stableBut，这在我的windows环境下报错： Google了一圈: (敲黑板！！)As stated in the readme file of that module, the module does not support Windows, hence the error you are getting. If you would like to update Node.js on Windows you can find binaries at https://nodejs.org/en/download/current/.于是乖乖去nodejs网站上下载.msi并安装，command line下成功，顺带着npm也一并更新了：
npm install sqlite3 --savenpm install electron-rebuild --save npm install electron-prebuilt --save ###貌似无效 .\node_modules\.bin\electron-rebuild.cmd ###手动编译 cd .\node_modules\sqlite3 npm install nan --save npm run prepublish node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-win32-x64 ###target是electron -v的版本 node-gyp rebuild --target=1.6.7 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/electron/ --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.4-win32-x64
打开需要设置代理的仓库 选择 仓库 > 仓库设置 ，会弹出仓库设置面板 选择 远程仓库 > 编辑配置文件 在打开的 config 文本中添加代理设置 [http] proxy = 10.51.1.140:8080 保存
安装yum install dnsmasq -y 配置nano /etc/dnsmasq.confresolv-file=/etc/resolv.dnsmasq.conf //设置解析文件 strict-order //放开#注释 listen-address=公网/局域网IP地址,127.0.0.1 addn-hosts=/etc/dnsmasq.hosts nano /etc/resolv.dnsmasq.confnameserver 127.0.0.1 nameserver 119.29.29.29 nameserver 182.254.116.116 nameserver 114.114.114.114 nameserver 114.114.114.115 nameserver 223.5.5.5 nameserver 223.6.6.6 nano /etc/dnsmasq.hosts10.201.11.222 local //ping local 会指向10.201.11.222 启动service dnsmasq start