This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(( $(curl -I facebook.com 2>/dev/null | grep -c X-FB-Debug) )) && echo 'succeed' || echo 'failed' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
additional_strace_args="$1" | |
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6) | |
while read -r pid; | |
do | |
if [[ $pid != $MASTER_PID ]]; then | |
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(cmd) | |
local f = assert(io.popen(cmd, 'r')) | |
--local f = assert(io.open('a', 'r')) | |
local cur_station = '' | |
local result = {} | |
for line in f:lines() do | |
fst_char = string.sub(line, 0, 1) | |
if fst_char == "S" then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
set autoindent | |
set smartindent | |
set cindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set cinoptions=(0,:0,l1,t0 | |
filetype plugin indent on | |
au FileType make setlocal noexpandtab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto_modules() { | |
# Perform auto detection of modules via sysfs. | |
local mods= | |
IFS=$'\n' read -rd '' -a mods < \ | |
<(find /sys/devices -name modalias -exec sort -u {} + | | |
# delimit each input by a newline, expanded in place | |
xargs -d $'\n' modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" | | |
sort -u) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pathlookup() { | |
# a basedir aware 'type -P' (or which) for executables | |
# $1: binary to find | |
local path= | |
local -a paths= | |
IFS=: read -r -a paths <<< "$PATH" | |
for path in "${paths[@]}"; do |
NewerOlder