分类 配置 的文章 累计 13 条

dhso dhso 统计中 2018-05-21 14:48

Linux使用wget安装jdk8

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
[ 阅读更多 ]
dhso dhso 统计中 2017-10-20 10:11

Nginx解决下载json静态文件乱码

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_f
[ 阅读更多 ]
dhso dhso 统计中 2017-10-17 13:30

Sublime Text个人自定义按键绑定

插件推荐

  • 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&quo
[ 阅读更多 ]
dhso dhso 统计中 2017-10-16 09:27

Mac下Mysql的启停及自启动方法

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"?>  
<!
[ 阅读更多 ]
dhso dhso 统计中 2017-07-19 10:22

linux安装htop来管理进程

源安装

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 http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-r
[ 阅读更多 ]
博客介绍
写好程序在于点滴积累,多做笔记!
热评文章
最新评论