存档

作者存档

我的 VIM 配置以及配色

2012年7月5日 没有评论

仅仅是做存档备份用。

.vimrc

set nocompatible
syntax on
set noeb
set confirm
set autoindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set nu
set history=1000
set nobackup
set noswapfile
set ignorecase
set hlsearch
set incsearch
set gdefault
set enc=utf-8
set langmenu=zh_CN.UTF-8
set helplang=cn
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\
set laststatus=2
set ruler
filetype on
filetype plugin on
filetype indent on
set viminfo+=!
set iskeyword+=_,$,@,%,#,-
set backspace=2
set showmatch
set matchtime=5
set pastetoggle=<F9>
colorscheme lucius
set t_Co=256

阅读全文…

分类: L.A.M.P 标签:

自己写的一些 Shell 脚本备份

2012年7月3日 没有评论

php-fpm + nginx + msyql 的控制脚本

配合 systemd 使用。

#!/bin/bash

case “$1” in
    start)
        if [ -z “$2” -o “$2” = ‘php’ ]; then
            echo “Start php-fpm”
            sudo systemctl start php-fpm.service
        fi
        if [ -z “$2” -o “$2” = ‘nginx’ ]; then
            echo “Start nginx”
            sudo systemctl start nginx.service
        fi
        if [ -z “$2” -o “$2” = ‘mysql’ ]; then
            echo “Start mysql”
            sudo systemctl start mysqld.service
        fi
        ;;
    stop)
        if [ -z “$2” -o “$2” = ‘php’ ]; then
            echo “Stop php-fpm”
            sudo systemctl stop php-fpm.service
        fi
        if [ -z “$2” -o “$2” = ‘nginx’ ]; then
            echo “Stop nginx”
            sudo systemctl stop nginx.service
        fi
        if [ -z “$2” -o “$2” = ‘mysql’ ]; then
            echo “Stop mysql”
            sudo systemctl stop mysqld.service
        fi
        ;;
    restart)
        $0 stop $2
        sleep 1
        $0 start $2
        ;;
    *)
        echo “usage: $0 {start|stop|restart} {php|nginx|mysql}”
esac

分类: L.A.M.P 标签:

Systemd 的一些启动脚本存档

2012年6月25日 没有评论

nginx

[Unit]
Description=Nginx Server
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/nginx -c /etc/nginx/conf/nginx.conf
ExecStop=/usr/sbin/nginx -s quit
ExecReload=/usr/sbin/nginx -s reload
PIDFile=/var/run/nginx.pid
Restart=always

[Install]
WantedBy=multi-user.target

分类: L.A.M.P 标签:

Linux 下的 netbeans 启动问题

2012年5月22日 2 条评论

最近把主开发环境移到了 archlinux 系统下。在使用 netbeans 时发现,无论是下载安装包直接安装还是从系统软件库里更新安装,都会出现运行一次后,无法再次启动 netbeans 的情况。

网上找了很久也没找到结果,偶然发现删除 ~/.netbeans 里的 cache 文件夹就可以启动了,关掉再次启动又不行,又需要删除 cache 一次。

经过几番排查,最终确定是 ~/.netbeans/7.1.2/var/cache/splash.png 文件导致无法启动,删除即可,但关掉后又会生成这个文件。于是只能临时修改 netbeans 的启动文件,在最前面加一行 “rm ~/.netbeans/7.1.2/var/cache/splash.png” 搞定。

分类: L.A.M.P 标签: