Skip to content

Instantly share code, notes, and snippets.

@pantuts
pantuts / tmux.conf
Last active August 29, 2015 14:26 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
# this is notes for video: http://www.youtube.com/watch?v=mNz5Lrc06_s
#-------- FFMPEG X11GRAB Screencasting
#------------------------------------------------------
# compile ffmpeg: http://ubuntuforums.org/showthread.php?t=786095
# proper screencast: http://ubuntuforums.org/showthread.php?t=1392026
# http://nowardev.wordpress.com/2011/05/23/how-to-screencast/
# press q to quit
# orginal one line code for fullscreen
@pantuts
pantuts / spectrogram.py
Created September 28, 2015 13:34 — forked from maurisvh/spectrogram.py
ANSI art spectrogram viewer that reads audio from a microphone
#!/usr/bin/python
import numpy
import pyaudio
import re
import sys
WIDTH = 79
BOOST = 1.0
@pantuts
pantuts / preprocessor_fun.h
Created December 19, 2015 13:06 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@pantuts
pantuts / on_stateful_code.txt
Created March 8, 2016 23:15 — forked from josteink/on_stateful_code.txt
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?
@pantuts
pantuts / gist:13623a7ba5e7e1c4ce44
Created March 29, 2016 12:38
i3 wm shutdown/reboot/logout mode
# Create Log out, Reboot, Poweroff bindings
mode "Exit (L)ogout, (R)eboot, (P)oweroff" {
bindsym $mod+r exec systemctl reboot
bindsym $mod+l exit
bindsym $mod+p exec systemctl poweroff
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
@pantuts
pantuts / Linux Static IP
Created April 19, 2016 06:45 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@pantuts
pantuts / DI.m3u
Created August 18, 2016 06:05 — forked from sim642/DI.m3u
Digitally Imported premium streams
use mpv
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
@pantuts
pantuts / RaspberryPi-RFID
Created August 22, 2016 14:04 — forked from mattgorecki/RaspberryPi-RFID
Python script to read RFID card from serial RFID reader attached to a Raspberry Pi. Also has a Exit button. The card swipe releases the maglock on the door.
#!/usr/bin/python2
import serial
import re, sys, signal, os, time, datetime
import RPi.GPIO as GPIO
BITRATE = 9600
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# https://github.com/hughperkins/howto-jenkins-ssl
openssl genrsa -out key.pem # creates key.pem
openssl req -new -key key.pem -out csr.pem
# you need to put the dns name of your website, testweb.local
# for the 'Common Name' question
# other questions, you can just accept defaults
# actually, you can accept defaults for all, will work ok too