董昊的个人博客 - 配置
type: channel
link: https://www.minws.com/tag/配置/
items: Linux使用wget安装jdk8
items: Nginx解决下载json静态文件乱码
items: Sublime Text个人自定义按键绑定
items: Mac下Mysql的启停及自启动方法
items: linux安装htop来管理进程
items: 如何在windows下升级node & npm
items: mac终端设置代理
items: electron安装sqlite3
items: sourcetree设置代理
items: 私有DNS服务器之dnsmasq搭建

Linux使用wget安装jdk8
type: item
date: 2018-05-21T06:48:43+08:00
description: 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

Nginx解决下载json静态文件乱码
type: item
date: 2017-10-20T02:11:19+08:00
description: 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'; } }

Sublime Text个人自定义按键绑定
type: item
date: 2017-10-17T05:30:00+08:00
description: 插件推荐 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的启停及自启动方法
type: item
date: 2017-10-16T01:27:07+08:00
description: 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

linux安装htop来管理进程
type: item
date: 2017-07-19T02:22:55+08:00
description: 源安装 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

如何在windows下升级node & npm
type: item
date: 2017-06-23T07:49:35+08:00
description: 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也一并更新了：

mac终端设置代理
type: item
date: 2017-05-15T02:31:05+08:00
description: export http_proxy="http://127.0.0.1:1080"export https_proxy="http://127.0.0.1:1080"

electron安装sqlite3
type: item
date: 2017-05-14T07:38:50+08:00
description: 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

sourcetree设置代理
type: item
date: 2017-04-14T01:27:33+08:00
description: 打开需要设置代理的仓库 选择 仓库 > 仓库设置 ，会弹出仓库设置面板 选择 远程仓库 > 编辑配置文件 在打开的 config 文本中添加代理设置 [http] proxy = 10.51.1.140:8080 保存

私有DNS服务器之dnsmasq搭建
type: item
date: 2017-04-12T02:13:57+08:00
description: 安装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