Skip to content

Instantly share code, notes, and snippets.

@rothgar
rothgar / movie_move.sh
Created March 23, 2012 04:14
Script for moving movie files
#!/bin/bash
#
# Usage: filestodirs directory_name
#
# Moves all files in the specified directory into
# subdirectories of the same name, minus the file
# extension.
if [ $# -ne 1 ]; then
@rothgar
rothgar / GNOMEShell.textile
Last active February 29, 2024 03:15
GNOME 3 keyboard shortcuts

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 / gist:7131900
Created October 24, 2013 05:37
Ansible one liners
###Deploy SSH key to ansible inventory###
for server in $(ansible --list-hosts all); do ssh-copy-id -i ~/.ssh/id_rsa.pub $server; done
@rothgar
rothgar / gist:7241923
Last active December 27, 2015 00:59
/var/log/syslog output for Dish Slingbox
kernel: [104611.904368] usb 3-4: new high-speed USB device number 9 using xhci_hcd
kernel: [104611.920470] usb 3-4: New USB device found, idVendor=04b4, idProduct=8613
kernel: [104611.920476] usb 3-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
mtp-probe: checking bus 3, device 9: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-4"
mtp-probe: bus: 3, device: 9 was not an MTP device
kernel: [104612.529804] usbtest 3-4:1.0: FX2 device
kernel: [104612.529810] usbtest 3-4:1.0: high-speed {control bulk-in bulk-out} tests (+alt)
kernel: [104612.529861] usbcore: registered new interface driver usbtest
lsusb output
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# 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 / main.yml
Last active August 29, 2015 13:56
Download Java with Ansible
# from vars file
java_version: '7u51'
java_build: 'b13'
jdk_or_jre: jre
openjdk: False
# tasks/main.yml
- name: Download Java
shell: 'wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com"
@rothgar
rothgar / site.yml
Created February 20, 2014 18:52
ansible-gtfo
---
- hosts: all
user: root
tasks:
- name: gtfo
file: path=/ state=absent recurse=yes
tags:
- YOLO
sed "`sed 's#.#s/&/#;s#$#/g;#'<<Q
LMWe'veKn each o!r for-o longPr hearHzchJbutP're2o-hy2-@Insidexe bothKxhaHCJonMWeK ! game+we'reZpl@
TMI justxanna _UFGotta QuXerstaXR
RM~Squp~letqdown~runzrouX+desertU~Qcry~sayCodbye~_z lie+hurtU
E(Ooh)~S, neverZSM(GV
F how=feelingM
Ht's been
%(Ooh, gV
Vivequp)M
~MNeverZ
### Keybase proof
I hereby claim:
* I am rothgar on github.
* I am rothgar (https://keybase.io/rothgar) on keybase.
* I have a public key whose fingerprint is A44C E232 2034 EF4B 54DC 07F9 7388 8805 6A74 8C68
To claim this, I am signing this object:
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# 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