Skip to content

Instantly share code, notes, and snippets.

@unicolet
unicolet / rd-clean.sh
Created April 8, 2015 10:40
Shell script to purge Rundeck execution history
#!/bin/sh
# setup ~/.pgpass to allow passwordless connection to postgres
# keep last 30 executions for each job
KEEP=30
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
@jetsonhacks
jetsonhacks / installCaffe.sh
Last active July 10, 2020 04:09
Install Caffe on NVIDIA Jetson TK1 LT4 21.2 - CUDA 6.5
#!/bin/sh
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
libboost-dev cmake libleveldb-dev libsnappy-dev \
libboost-thread-dev libboost-system-dev \
libatlas-base-dev libhdf5-serial-dev libgflags-dev \
libgoogle-glog-dev liblmdb-dev -y
@cobyism
cobyism / osx-install-media.md
Last active March 11, 2023 00:42
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@chealwoo
chealwoo / sublimetext-eclipse-shortcut-mac.json
Created June 27, 2013 20:01
Sublime Text Eclipse Shortcuts on Mac
[
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+j"], "command": "join_lines" },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["shift+super+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["super+shift+s"], "command": "save_all" },
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }
import numpy as np
import pylab as pl
x = np.random.uniform(1, 100, 1000)
y = np.log(x) + np.random.normal(0, .3, 1000)
pl.scatter(x, y, s=1, label="log(x) with noise")
pl.plot(np.arange(1, 100), np.log(np.arange(1, 100)), c="b", label="log(x) true function")
pl.xlabel("x")
pl.ylabel("f(x) = log(x)")
@Flet
Flet / gist:5447732
Created April 23, 2013 21:54
Sublime Text: Eclipse Shortcuts keymap
[
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
@heynemann
heynemann / gist:3341234
Created August 13, 2012 14:30
nginx conf for thumbor
upstream thumborbe {
server thumbor.myhost.com:8090 ;
server thumbor.myhost.com:8091 ;
server thumbor.myhost.com:8092 ;
server thumbor.myhost.com:8093 ;
server thumbor.myhost.com:8094 ;
server thumbor.myhost.com:8095 ;
}
location ~* "^/.{28}/.*(jpg|jpeg|gif|png)(#.*)?$" {
@thbkrkr
thbkrkr / Default (Linux).sublime-keymap
Last active August 31, 2022 03:54
Custom & Eclipse shortcuts key bindings (keyboard mapping) for Sublime Text 2 and 3
[
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+à"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+!"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
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