Skip to content

Instantly share code, notes, and snippets.

@tjt263
tjt263 / Random Bash Functions
Created June 24, 2016 12:49 — forked from mmstick/Random Bash Functions
Simply a collection of bash functions/scripts that I don't particularly have a practical use for, but decided to make them since I was bored anyway. Feel free to put them in your bash_aliases file.
#!/bin/bash
function package-version {
apt-cache policy $1 | grep Installed | awk -F ' ' '{print $2}'
}
function kernel-current-version {
major=$(uname -r | awk -F '.' '{print $1}')
minor=$(uname -r | awk -F '.' '{print $2}')
if [ $(uname -r | grep rc) ]; then
rc="rc$(uname -r | awk -F '-' '{print $2}' | awk -F 'rc' '{print $2}')"
@tjt263
tjt263 / -
Created February 27, 2016 07:53 — forked from anonymous/-
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------14:28:57
tjt263@osx:~$ port search example |grep @ |cut -d'(' -f1
gnss-sdr @0.0.6_6
gnss-sdr-devel @20151115_5
gnss-sdr-next @20151115_5
gvemod-xforms-example @0.2_1
hs-fingertree @0.1.0.0_3
p5-pod-tests @1.190.0_3
p5.22-pod-tests @1.190.0_3
proxytunnel @1.9.0
@tjt263
tjt263 / -
Created February 27, 2016 07:53 — forked from anonymous/-
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------14:40:54
tjt263@osx:~$ port search example
gnss-sdr @0.0.6_6 (science)
An Open Source Global Navigation Satellite Systems (GNSS)(for example: GPS, Galileo, Glonass, Beidou, etc) Software Defined Radio (SDR) Receiver
gnss-sdr-devel @20151115_5 (science)
An Open Source Global Navigation Satellite Systems (GNSS)(for example: GPS, Galileo, Glonass, Beidou, etc) Software Defined Radio (SDR) Rec
@tjt263
tjt263 / -
Created February 27, 2016 07:52 — forked from anonymous/-
homebrew/completions/ctest-completion Caskroom/cask/aja-system-test Caskroom/cask/colortester Caskroom/cask/nsregextester Caskroom/cask/sqlitestudio
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------14:32:31
tjt263@osx:~$ brew info $(!!)
brew info $(brew search test)
cpptest: stable 1.1.2 (bottled)
Unit testing framework handling automated tests in C++
http://cpptest.sourceforge.net/
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cpptest.rb
@tjt263
tjt263 / tmux-cheatsheet.markdown
Last active August 29, 2015 14:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tjt263
tjt263 / tmux.md
Last active August 29, 2015 14:27 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'