Skip to content

Instantly share code, notes, and snippets.

View glidenote's full-sized avatar

Akira Maeda glidenote

View GitHub Profile
colorscheme solarized
set background=dark
let g:solarized_termcolors=256
let g:solarized_termtrans=1
check_ssl() {
openssl s_client -connect $1:443 -showcerts << EOF
HEAD / HTTP/1.0
EOF
}
#!/bin/sh
syntax_errors=0
error_msg=$(mktemp /tmp/error_msg.XXXXXX)
if git rev-parse --quiet --verify HEAD > /dev/null
then
against=HEAD
else
# Initial commit: diff against an empty tree object
# open current directory in Finder
alias f='open .'
# cd to the path of the front Finder window
cdf() {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [ "$target" != "" ]; then
cd "$target"; pwd
else
echo 'No Finder window found' >&2

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)

require 'formula'
class Ncurses < Formula
url 'http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz'
homepage 'http://www.gnu.org/software/ncurses/'
md5 '8cb9c412e5f2d96bc6f459aa8c6282a1'
# depends_on 'cmake'
def install
# log output
bind-key H pipe-pane 'cat >> $HOME/.tmux/tmux-#W.log' \; display-message 'Started logging to $HOME/.tmux/tmux-#W.log'
bind-key h pipe-pane \; display-message 'Ended logging to $HOME/.tmux/tmux-#W.log'
---
bitbucket:
username: glidenote
password: !!hogemoge!!
@glidenote
glidenote / .vimrc
Last active December 10, 2015 22:18
vimで編集中のmarkdownをmarkedでプレビューする
let g:quickrun_config = {}
let g:quickrun_config.markdown = {
\ 'outputter' : 'null',
\ 'command' : 'open',
\ 'cmdopt' : '-a',
\ 'args' : 'Marked',
\ 'exec' : '%c %o %a %s',
\ }
#=============================
# source zsh-syntax-highlighting
#=============================
if [ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi