Skip to content

Instantly share code, notes, and snippets.

View webee's full-sized avatar
🎯
Focusing

webee.yw webee

🎯
Focusing
View GitHub Profile
######################
# Options
######################
NULL=
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@webee
webee / install_xapian_inside_virtualenv_osx.sh
Created October 30, 2015 06:16 — forked from carymrobbins/install_xapian_inside_virtualenv_osx.sh
Install xapian in a virtualenv on Mac OS X using Homebrew.
#/bin/bash
set -e
if [ -z "$(which brew)" ]; then
echo "This script requires Homebrew."
exit
fi
if [ -z "$VIRTUAL_ENV" ]; then
@webee
webee / supervisord.service
Last active September 26, 2016 07:47 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
#!/bin/bash
###########
# add crontab
# 0 0 1 * * /root/src/renew_ssl_cert.sh <site> 2>>/var/log/acme_tiny.log
###########
site=$1
domains=$2
if [ -n "${domains}" ]; then
# init
#!/bin/bash
# /etc/nginx/ssl/<site>/
site=$1
# DNS:www.abc.xyz,DNS:xyz.abc.xyz
domains=$2
OPENSSL_CNF=/etc/pki/tls/openssl.cnf
ssl_dir=/etc/nginx/ssl
mkdir -p ${ssl_dir}
@webee
webee / .tmux.conf
Created January 17, 2017 12:50
my tmux config.
set -g prefix ^a
unbind ^b
bind a send-prefix
set -g mode-keys vi
set -g status-utf8 on
setw -g utf8 on
# window select.
bind-key -n F1 previous-window
@webee
webee / .vimrc
Created April 6, 2017 15:52
vim configs.
" vimrc
"
" Maintainer: webee.yw <[email protected]>
" Last change: 2013.11
"
" 使用vim的配置,必须放在最前面,会对其它设置产生影响
set nocompatible
let mapleader = ","
@webee
webee / mytmux.sh
Created April 6, 2017 15:56
mytmux.sh
#!/bin/bash
if [ "$1" == '.' ];then
shift;
exec tmux $*
exit 0
fi
name=$1
n=$2
if [ "$name" == "" ];then
@webee
webee / pathmunge
Created April 6, 2017 15:59
pathmunge
function pathmunge {
if echo $PATH | /usr/bin/egrep -q "(^|:)$1($|:)";then
a=${1//\//\\\/}
PATH=$(echo $PATH|/usr/bin/sed -e "s/\([:^]*\)$a\([$:]*\)/\1\2/g")
PATH=$(echo $PATH|/usr/bin/sed -e 's/::/:/g'|/usr/bin/sed -e 's/^://g'|/usr/bin/sed -e 's/:$//g')
fi
if [ "$2" = "after" ];then
PATH=$PATH:$1
else
PATH=$1:$PATH
@webee
webee / postgres_queries_and_commands.sql
Created March 22, 2018 03:25 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'