Skip to content

Instantly share code, notes, and snippets.

Avatar
🤷‍♂️
fine

Justin Garrison rothgar

🤷‍♂️
fine
View GitHub Profile
@rothgar
rothgar / GNOMEShell.textile
Last active May 21, 2021
GNOME 3 keyboard shortcuts
View GNOMEShell.textile

Keyboard Shortcuts – GNOME Shell 3.8+

General Navigation

Super or Alt + F1 or Super + S Activities Overview
Alt + F2 Command window
Super + A Application View
Super + M Toggle Message Tray
Super + N Focus Notification
Ctrl + Alt + Tab Toggle System Focus (Windows, Top Bar, Messages)
@rothgar
rothgar / main.yml
Last active May 20, 2021
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@rothgar
rothgar / tmux_local_install.sh
Last active May 3, 2021 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
View tmux_local_install.sh
#!/bin/bash
TMUX_VERSION="2.1"
LIBEVENT_VERSION="2.0.20"
NCURSES_VERSION="6.0"
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
@rothgar
rothgar / streamyard-tampermonkey.js
Last active Apr 10, 2021
Streamyard Keyboard Shortcuts
View streamyard-tampermonkey.js
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace http://streamyard.com
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author justinleegarrison@gmail.com
// @match https://streamyard.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@rothgar
rothgar / tmate-compile.sh
Created Jan 19, 2017
Compile tmate on centos 7
View tmate-compile.sh
#!/bin/bash
set -e
yum install -y epel-release
yum makecache
yum install -y @development git cmake ruby zlib-devel openssl-devel libevent-devel ncurses-devel libssh-devel msgpack-devel
git clone https://github.com/nviennot/tmate.git
@rothgar
rothgar / incognito.sh
Created Jun 28, 2016
incognito shell function
View incognito.sh
#!/bin/bash
incognito() {
if [[ -z ${SHELL} ]]; then
echo "Could not determin shell.\nUsing /bin/bash"
SHELL=bash
fi
case "${SHELL}" in
*bash)
set -o history
;;
View packetloss.sh
# ping once per minute. Every minute for a day
ping -i 60 -c 1440 google.com | grep loss | awk -F ',' '{print $3}'
# print avg latency (ms) per hour. One ping per minute
ping -i 60 -c 60 google.com | awk '{print $8}' | sed -n '/^time/p' | awk -F '=' '{print $2}' | awk '{ sum += $1 } END { if (NR > 0) print sum / NR }'
@rothgar
rothgar / install-tmux
Last active Jan 29, 2021 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
View install-tmux
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
View move-window-down-workspace.sh
#!/bin/bash
CURRENT_DESKTOP=$(wmctrl -d | grep '*' | awk '{print $1}')
wmctrl -r :ACTIVE: -t $(( ${CURRENT_DESKTOP}+1 ))
View gist:a6ed5803fa925ed04cd82f25e6b6d59b
# my profile is configured for us-west-2
export AWS_DEFAULT_REGION=us-west-1
export AWS_REGION=us-east-1
aws ec2 describe-instances --query 'Reservations[].Instances[].Placement.AvailabilityZone' --output text
us-east-1c
unset AWS_REGION
aws ec2 describe-instances --query 'Reservations[].Instances[].Placement.AvailabilityZone' --output text
us-west-1c
unset AWS_DEFAULT_REGION