This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ctrl-C to exit | |
# I use this by making a terminal full screen on a monitor and blanking it so I can focus on one monitor | |
trap "tput cnorm" EXIT INT TERM | |
tput civis; tput clear | |
sleep infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from this blog post | |
# http://chrigl.de/blogentries/ssh-jump-host-without-nc-netcat | |
# Add the following to ~/.ssh/config, and adapt for your usage | |
# | |
# ProxyCommand ssh -A proxy_through_host -W %h:22 | |
# -A -- ssh-agent forwarding [optional] | |
# (can be added to proxy host definition) | |
# proxy_through_host -- hostname of server to proxy through [required] | |
# -W %h:22 -- forward standard io to %h:22 (port 22) [required] | |
# %h is replaced with the host you're actually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var $ = jQuery; | |
var styles = [ | |
"position: fixed;", | |
"top: 0; right: 0; z-index: 1000;", | |
"width: 200px; height: 30px; line-height: 30px;", | |
"font-size: 14px; text-align: center;", | |
"background: rgba(0,0,0,0.3);" | |
]; | |
var el = $("<div style='" + styles.join(' ') + "'></div>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var l = ['#000', '#A00', '#0A0', '#A50', '#00A', '#A0A', '#0AA', '#AAA']; | |
document.body.innerHTML = document.body.innerHTML.replace(/\u001b\[([0-9;]*)m/g, function (m, k) { | |
return k - 30 < 8 ? "<span style='color: " + l[k - 30] + "'>" : k == 39 ? "</span>" : "<span>"; | |
}); | |
document.body.style.backgroundColor = "#000"; | |
document.body.style.color = "#AAA"; | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "You must run this as root." | |
exit 1 | |
fi | |
I=lo | |
PORT=${PORT-23000} | |
DELAY=${DELAY-25ms} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This was taken and adapted from some reddit thread with a bunch of prompts. | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
PS1="\n\$(s=\$(printf '%*s' \$COLUMNS); echo \${s// /―})\n\D{%Y-%m-%d} \t\n" | |
PS1="$PS1\w\$(__git_ps1)\n" | |
PS1="$PS1${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]\$ "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Desktop Notifications for zendesk | |
// @include https://*.zendesk.com/agent/* | |
// ==/UserScript== | |
setTimeout(function () { | |
var initNotifications = window.webkitNotifications ? function () { | |
var notify = window.webkitNotifications; | |
var n = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Include the hostname in the prompt, and add a * when in a transaction | |
-- The default PROMPT2 doesn't make it obvious enough nothing has been sent to the server yet | |
\set PROMPT1 '%M:%/%R%x%# ' | |
\set PROMPT2 '> ' | |
-- Always be in a transaction. It's safer this way | |
\set AUTOCOMMIT off | |
-- Turn the pager on always. This is best used with "export PAGER=less -S -F -X" added to your .bashrc | |
\pset pager always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### UPDATE: ruby-debuy19 is no longer maintained, use https://github.com/cldwalker/debugger | |
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/3899673) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p0 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem |
NewerOlder