Skip to content

Instantly share code, notes, and snippets.

View paranoidjk's full-sized avatar

paranoidjk paranoidjk

View GitHub Profile
@paranoidjk
paranoidjk / setup-dev.sh
Created December 22, 2015 11:44
Install homebrew, nginx, mysql, php55, and composer on Mac OS X
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
@paranoidjk
paranoidjk / setup-iptables-on-centos6.sh
Last active December 31, 2015 05:37
Setup IPTables Firewall on CentOS 6
#!/bin/bash
#
# Step 1: Determine the services and ports used on your server
# I assume that this server will only host a WordPress blog, and it will not be used as a router or provide other services (for example, mail, FTP, IRC, etc.).
# Here, we need the following services:
# HTTP (TCP on port 80)
# HTTPS (TCP on port 443)
# SSH (TCP on port 22 by default, can be changed for security purposes)
@paranoidjk
paranoidjk / .bashrc
Created December 31, 2015 05:39
linx bash alias example: la ll ls lt
#-------------------------------------------------------------
# The 'ls' family (this assumes you use a recent GNU ls).
#-------------------------------------------------------------
# Add colors for filetype and human-readable sizes by default on 'ls':
alias ls='ls -h --color'
alias lx='ls -lXB' # Sort by extension.
alias lk='ls -lSr' # Sort by size, biggest last.
alias lt='ls -ltr' # Sort by date, most recent last.
alias lc='ls -ltcr' # Sort by/show change time,most recent last.
alias lu='ls -ltur' # Sort by/show access time,most recent last.
@paranoidjk
paranoidjk / nginx.conf.default
Created December 31, 2015 05:41
default nginx configure file
#定义nginx运行时的用户和用户组
#user nobody;
#nginx进程数,建议设置为cpu总核心数
worker_processes 1;
#全局错误日志定义类型
#error_log logs/error.log;
#error_log logs/error.log notice;
@paranoidjk
paranoidjk / .bashrc
Created December 31, 2015 05:42
auto open exist tmux session when open bash or zsh etc
tmux_init()
{
tmux new-session -s "kumu" -d -n "local" # 开启一个会话
tmux new-window -n "other" # 开启一个窗口
tmux split-window -h # 开启一个竖屏
tmux split-window -v "top" # 开启一个横屏,并执行top命令
tmux -2 attach-session -d # tmux -2强制启用256color,连接已开启的tmux
}
# 判断是否已有开启的tmux会话,没有则开启
@paranoidjk
paranoidjk / .tmux.conf
Created December 31, 2015 05:43
a recommanded tmux configure file
# 本书使用的 .tmux.conf 文件
# 把前缀键从 C-b 更改为 C-a
set -g prefix C-a
# 释放之前的 Ctrl-b 前缀快捷键
unbind C-b
# 设定前缀键和命令键之间的延时
set -sg escape-time 1
@paranoidjk
paranoidjk / author.sublime.snippet
Created December 31, 2015 05:45
a sublime snippet which generate code author info
<snippet>
<content><![CDATA[
/**!
* ${1:[appName]} - $TM_FILEPATH
* Copyright(c) XXX Group Holding Limited.
*
* Authors:
* 江木 <hust2012jiangkai@gmail.com> (http://paranoidjk.github.io/)
*/
]]></content>
@paranoidjk
paranoidjk / comment.sublime.snippet
Created December 31, 2015 05:45
a sublime snippet which generate jsdoc style code comments
<snippet>
<content><![CDATA[
/**
* ${1:Summary of this block}
*
* @since ${2:0.8.0}
* @${3:method} ${4:ClassName#methodName}
* @${5:param} {${6:String}} ${7:argName} - ${8:notes of arg}
* @return {${9:String}}
* @example
@paranoidjk
paranoidjk / Preferences.sublime-settings
Created December 31, 2015 05:47
a recommended sublime setting
{
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"font_size": 14,
"ignored_packages":
[
"Markdown",
"Vintage"
],
@paranoidjk
paranoidjk / SublimeLinter.sublime-settings
Created December 31, 2015 05:47
use eslint in sublime
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"eslint": {