As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
def countLinesOfCode(path): | |
"""Procedure to count total lines of code in each file | |
""" | |
total = 0 | |
listing = os.listdir(path) | |
for fname in listing: | |
if fname[-2:] == "py": | |
with open(fname) as f: | |
for i, l in enumerate(f): | |
if len(l) > 80: |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import fnmatch | |
def Walk(root='.', recurse=True, pattern='*'): | |
""" | |
Generator for walking a directory tree. | |
Starts at specified root folder, returning files | |
that match our pattern. Optionally will also |
#!/bin/bash | |
# Bash Script to do quick counts of common source code types under the current or specified directory | |
# https://gist.github.com/3901863 | |
# To quickly grab it, just type | |
# wget https://gist.github.com/raw/3901863/dgSniffCode.sh && chmod +x dgSniffCode.sh | |
# Features to add: | |
# multiple params ...A hack until I support * arguments: ls | xargs -L 1 ~/dgSniffCode |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
usage: | |
cat about.txt | python soinput.py | |
''' | |
import sys |
# download latest libevent2 and tmux sources, and extract them somewhere | |
# (thx bluejedi for tip on latest tmux URL) | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel |