This script is modeled after tee
(see [man tee
][2]).
It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable
set-option -g mouse on | |
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'" | |
# Resize panes with arrow keys because alt-arrow keys doesn't work | |
bind-key -r Up resize-pane -U | |
bind-key -r Down resize-pane -D | |
bind-key -r Left resize-pane -L | |
bind-key -r Right resize-pane -R |
#!/bin/bash | |
set -e | |
# Default working directory to current directory, but allow override via WORKDIR environment variable. | |
WORKDIR=${WORKDIR:-$PWD} | |
NOW="$(date +%s)" | |
INFLUXDIR="$WORKDIR/influxdb-$NOW" | |
BACKUPDIR="$WORKDIR/backup-$NOW" |
#!/usr/bin/env bash | |
typeofvar () { | |
local type_signature=$(declare -p "$1" 2>/dev/null) | |
if [[ "$type_signature" =~ "declare --" ]]; then | |
printf "string" | |
elif [[ "$type_signature" =~ "declare -a" ]]; then | |
printf "array" |
#!/bin/bash | |
# Paste at Pastebin.com using command line (browsers are slow, right?) | |
# coder : Anil Dewani | |
# date : Novemeber 7, 2010 | |
#help function | |
howto() | |
{ | |
echo "\ | |
Pastebin.com Bash Script \ |
The icinga PPA only provides packages for i386 and amd64. If you're running an ARM-powered device such as the Raspberry Pi or the ODROID U3 (which I use), you have to build the packages yourself. However, compiling the packages is very easy thanks to Debian's excellent build tools and the work of the icinga package maintainer. This howto uses pbuilder which builds in a clean chroot so your original system is not polluted with build packages.
# |Info| | |
# Written by Bryan O'Connell, November 2014 | |
# Purpose: Sample of a functional test script for a RESTful API. | |
# | |
# Thanks to contributors on the 'jsonplaceholder' project for making a publicly | |
# accesible and generic REST API (which is used in the examples below). | |
# - http://jsonplaceholder.typicode.com | |
# - https://github.com/typicode/jsonplaceholder | |
# | |
# |Info| |
#!/bin/bash | |
command=$1 | |
args=${@:2} | |
winrun_pid=$$ | |
pidfile="/tmp/winrun-pid-$(date +%s)" | |
if [[ $args != '' ]]; then | |
argumentlist="-ArgumentList \"$args\"" | |
fi |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
# scp-speed-test.sh | |
# Author: Alec Jacobson alecjacobsonATgmailDOTcom | |
# http://www.alecjacobson.com/weblog/?p=635 | |
# | |
# Test ssh connection speed by uploading and then downloading a 10000kB test | |
# file (optionally user-specified size) | |
# | |
# Usage: | |
# ./scp-speed-test.sh user@hostname [test file size in kBs] |