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 / .bashrc
Created October 15, 2015 21:19 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@rothgar
rothgar / owncloud-docker-compose.yml
Created November 6, 2015 21:06 — forked from MickaelBergem/ owncloud-docker-compose.yml
Docker Compose file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db
@rothgar
rothgar / command.rb
Last active December 11, 2015 20:41
test hammer foreman plugin
require 'hammer_cli'
require 'hammer_cli_foreman'
require 'hammer_cli_foreman/fact'
module HammerCLIForemanHi
class Command < HammerCLIForeman::Command
resource :hosts
command_name 'hi'
[ERROR 2015-12-11 13:03:36 Modules] Error while loading module hammer_cli_foreman_hi
Warning: An error occured while loading module hammer_cli_foreman_hi
[ERROR 2015-12-11 13:03:36 Modules] <LoadError> cannot load such file -- hammer_cli_foreman_hi
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:126:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:126:in `require'
/usr/share/gems/gems/hammer_cli-0.3.0/lib/hammer_cli/modules.rb:78:in `require_module'
/usr/share/gems/gems/hammer_cli-0.3.0/lib/hammer_cli/modules.rb:57:in `load!'
/usr/share/gems/gems/hammer_cli-0.3.0/lib/hammer_cli/modules.rb:72:in `load'
/usr/share/gems/gems/hammer_cli-0.3.0/lib/hammer_cli/modules.rb:83:in `block in load_all'
/usr/share/gems/gems/hammer_cli-0.3.0/lib/hammer_cli/modules.rb:82:in `each'
@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 / 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
#!/usr/bin/env bash
# Creates a dialog using Zenity that lists all of your open windows and then switches to whatever window matches your input
# Requires Zenity and wmctrl packages
IFS_BAK=$IFS
IFS_LINE=$'\n'$'\r'
IFS=$IFS_LINE
i="0"
WINDOW_LIST=$(wmctrl -l | grep -v "\-1")
@rothgar
rothgar / dev_k8s.sh
Created March 29, 2016 04:47
local dev kubernetes server
# stolen from http://www.charliedrage.com/kubernetes-dev-in-one-command
dev_k8s(){
local choice=$1
K8S_VERSION=1.2.0
if [ ! -f /usr/bin/kubectl ] && [ ! -f /usr/local/bin/kubectl ]; then
echo "No kubectl bin exists! Install the bin to continue :)."
return 1
fi
@rothgar
rothgar / Dockerfile
Created July 21, 2016 15:09
kubectl pod
FROM scratch
LABEL BUILD_CMD="docker build -t docker-registry:5000/kubernetes/kubectl:v1.3.0"
# Put your kubectl binary in the local folder
ADD kubectl /
ENTRYPOINT ["/kubectl"]