start new:
tmux
start new with session name:
tmux new -s myname
# Usage: | |
# source iterm2.zsh | |
# iTerm2 tab color commands | |
# https://iterm2.com/documentation-escape-codes.html | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
tab-color() { | |
echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
echo -ne "\033]6;1;bg;green;brightness;$2\a" |
# install zsh-5.0.0 | |
# prerequisite: gcc ncurses-devel readline-devel pcre-devel zlib-devel | |
curl -L http://jaist.dl.sourceforge.net/project/zsh/zsh/5.0.0/zsh-5.0.0.tar.bz2 | tar jx | |
cd zsh-5.0.0/ | |
./configure --prefix=/usr/local/zsh/5.0.0 --enable-cap --enable-pcre --enable-multibyte | |
make | |
sudo make install | |
sudo alternatives --install /usr/local/bin/zsh zsh /usr/local/zsh/5.0.0/bin/zsh 50000 |
#!/bin/sh | |
## | |
# Install autoconf, automake and libtool smoothly on Mac OS X. | |
# Newer versions of these libraries are available and may work better on OS X | |
# | |
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html | |
# | |
export build=~/devtools # or wherever you'd like to build |
/usr/bin/a2p5.16 | |
/usr/bin/afida | |
/usr/bin/btmmdiagnose | |
/usr/bin/c2ph5.16 | |
/usr/bin/config_data5.16 | |
/usr/bin/corelist5.16 | |
/usr/bin/cpan2dist5.16 | |
/usr/bin/cpan5.16 | |
/usr/bin/cpanp-run-perl5.16 | |
/usr/bin/cpanp5.16 |
# Short of learning how to actually configure OSX, here's a hacky way to use | |
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise | |
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _' |
Sometimes brew updates break your computer or a piece of software. This is usually really unpleasant as it can take some time to diagnose which formula at which version did so. Even if you can diagnose, it's not very clear how to roll back homebrew softwares to previous versions.
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"syscall" | |
) | |
const ( |
$ nvcc simpleCallback.cu -O2 -o simpleCallback
$ nvprof -f -o simpleCallback.nvvp ./simpleCallback | grep elapsed
No callback: elapsed time = 1.534s
One callback: elapsed time = 1.498s
Two callback: elapsed time = 3.718s
Four callback: elapsed time = 5.194s
As increasing callbacks, it becomes slow...