Skip to content

Instantly share code, notes, and snippets.

@mr337
mr337 / .tmux.conf
Last active May 25, 2021 22:38
My Tmux conf - emulates screen keys since they are burned into my brain.
set-option -g history-limit 100000
bind r source-file ~/.tmux.conf
# turning this off since it will capture the standard mouse interactions such as right click
# and paster buffer using mouse3
set -g mouse off
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
@mr337
mr337 / gist:bbcf3be444e4743a3447c0eaa3830303
Created August 7, 2016 22:58
Handy way to mointor serial traffic with socat
socat /dev/ttyUSB0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt'
@mr337
mr337 / HTTPSClient.java
Created April 4, 2016 15:55
Java SSL client tester
import java.net.*;
import java.io.*;
import java.security.*;
import javax.net.ssl.*;
public class HTTPSClient {
public static void main(String[] args) {
if (args.length == 0) {
@mr337
mr337 / xmonad.hs
Created December 29, 2015 08:44
Xmonad for Lenovo X1 Carbon Gen 3
--
-- xmonad example config file
--Shout out to @mathom for using this as a base.
--
import XMonad
import Data.Monoid
import System.Exit
import qualified XMonad.StackSet as W
@mr337
mr337 / import_openTSD.py
Last active August 29, 2015 14:06
Import test data into openTSD
import urllib
import urllib2
import json
import time
from random import randint
#microsecond precision must be in 13 digit format, no period
t_old = '{:0<13}'.format(''.join(str(time.time()).split('.')))
while True:
@mr337
mr337 / get_s3_totals.py
Created September 20, 2013 21:01
Used to calculate daily totals of files changes with file size. Great for determining how much data may have to be synced with offsite backups.
import aniso8601
from boto.s3.connection import S3Connection
from datetime import datetime, timedelta
import pytz
from hurry.filesize import size
con = S3Connection()
bucket = con.get_bucket('britecorepro')