Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env bash | |
| cat /var/log/apache2/access_log | awk '{print $1}' > ips.txt | |
| uniq ips.txt > uniqips.txt | |
| IPS=`cat uniqips.txt` | |
| for i in $IPS | |
| do | |
| echo "$i,`geoiplookup $i | cut -d "," -f2 | sed -e 's/^[\t]//'`" >> ipinfo.csv | |
| done |
| // simple example of the cake pattern | |
| // abstract DAO trait | |
| trait Repository[A, B]{ | |
| // saves an entity, returns an ID | |
| def save(entity: A): B | |
| // more features.. | |
| } | |
| trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
| ========================================== ========================================== | |
| TMUX COMMAND WINDOW (TAB) | |
| ========================================== ========================================== | |
| List tmux ls List ^b w | |
| New new -s <session> Create ^b c | |
| Attach att -t <session> Rename ^b , <name> | |
| Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
| Kill kill-session -t <session> Close ^b & |
| package object mail { | |
| implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
| implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
| sealed abstract class MailType | |
| case object Plain extends MailType | |
| case object Rich extends MailType | |
| case object MultiPart extends MailType |
| 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 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)