Skip to content

Instantly share code, notes, and snippets.

@dmaynor
dmaynor / gist:1f54e539e5efa237faae
Created February 10, 2015 19:36
python sqlite snippet
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
# Create table
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)''')
# Insert a row of data
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
@dmaynor
dmaynor / gist:723adc9390c95eb3c403
Created February 12, 2015 04:51
rtl blacklists
blacklist dvbusbrt128xxu
blacklist e4000
blacklist rtl2832
@dmaynor
dmaynor / gist:1c2aab9bf35b8ff89551
Created March 18, 2015 20:19
Making Spark less noisy
cd ~/code/spark-1.3.0-bin-hadoop2.4/conf/
cp log4j.properties.template log4j.properties
change log4j.rootCategory=INFO, console to log4j.rootCategory=WARN, console
@dmaynor
dmaynor / gist:3b168abd8ef62bc11d05
Created April 15, 2015 16:39
git keygen steps (OSX)
ssh-keygen -t rsa -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
ssh -T [email protected]
DTE SPEED : 115200
DTE FORMAT : 8N1
GSM DATA MODE : Not Transparent
AUTOBAUD : +IPRxxx00=NO
COMMAND ECHO : E0=NO
RESULT MESSAGES : Q0=YES
VERBOSE MESSAGES : V1=YES
EXTENDED MESSAGES : X1=YES
LINE SPEED : F0=autodetect
CONSTANT DTE SPEED : YES
### Keybase proof
I hereby claim:
* I am dmaynor on github.
* I am dave_maynor (https://keybase.io/dave_maynor) on keybase.
* I have a public key whose fingerprint is 2BB9 EB57 C8D6 0EA2 4363 6085 A666 82A5 6568 5938
To claim this, I am signing this object:
@dmaynor
dmaynor / gist:0bb250c6007b288b63d5
Created June 11, 2015 20:12
Echo date range in bash
#!/usr/bin/env bash
# Snippet that finds the current date, subtracts a week, and
# echoes the date range from a week ago to current.
DATE=date
FORMAT="%Y-%m-%d"
now=`$DATE +$FORMAT`
start_time=`$DATE +$FORMAT -d "$now - 1 week"`
@dmaynor
dmaynor / checklist
Last active August 29, 2015 14:25
raspberry pi, adhoc wifi, cjdns
- hostname
- publickey auth
- apt-get update/upgrade
- modprobe ipv6
- vim, htop, build-essential
- https://github.com/voltz/nacl4raspi.git
- http://nodejs.org/dist/v0.11.10/node-v0.11.10-linux-arm-pi.tar.gz
- ./cjdroute --genconf >> cjdroute.conf
- ./cjdroute < cjdroute.conf > cjdroute.log
-
@dmaynor
dmaynor / tmux-cheatsheet.markdown
Created February 19, 2020 02:25 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
The main direcotry for this will be ~/code/gr-radio. All projects are built from there.
Everything built and installed will go in /usr/local
sudo apt install mlocate
#dependecy installs
sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy \
python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev \
libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 \
liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins \