Skip to content

Instantly share code, notes, and snippets.

@rothgar
rothgar / tmux_local_install.sh
Last active March 3, 2024 04:24 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/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.
[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 / 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'
@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 / .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 / set-matrix.sh
Last active August 29, 2015 14:27
set hdmi matrix output
#!/bin/bash
# Set matrix spliter display
# Designed for Monoprice 4x4 Matrix Switch
# http://www.monoprice.com/Product?p_id=5704
declare -A INPUT_HASH
declare -A OUTPUT_HASH
CHECKSUM='\xd5\x7b'
if [[ $# -eq 0 ]] && [ -z $MATRIX_CONFIG ]; then
@rothgar
rothgar / c2b.sh
Created June 3, 2015 15:37
curl2bash
# Curl to bash
# c2b http://random/script/you/shouldn't/trust.sh
c2b() {
curl -L ${1} | sudo bash
}
#!/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 / bitch.zsh
Last active August 29, 2015 14:14
bitch
# create bitch function
bitch() {
if [[ "${BUFFER}" == *" bitch" ]] && [[ "${BUFFER}" != su(do|)\ * ]]; then
# add sudo to beginning of line (remove bitch from end)
BUFFER="sudo ${BUFFER% bitch}"
elif [[ "${BUFFER}" == "bitch" ]]; then
LAST_CMD=$(fc -l -1)
BUFFER="sudo ${LAST_CMD#* }"
fi
# still need to run accept-line widget
@rothgar
rothgar / gsettings
Created January 14, 2015 00:37
gnome 3 gconf settings
# disable terminal scrollbar
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ scrollbar-policy never