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 | |
lesscommand="lessc" | |
inotifywait -qrm $1 | | |
while read line | |
do | |
#echo Plain {$line} |
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
git remote set-url origin $(git remote show origin -n | grep "Fetch" | sed 's/.*\//git@github.com:amedia\//') |
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 | |
TEMP=josm-tested-`date +%F`.jar | |
echo "Fetching josm" | |
wget "http://josm.openstreetmap.de/josm-tested.jar" -O $TEMP | |
REV=$(unzip -p $TEMP REVISION | grep Revision | sed 's/[^0-9]//g'); |
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
# bash completion for tmux | |
# Written by Oystein Steimler <oystein@nyvri.net> | |
# | |
# $ sudo cp tmux-completion.bash /etc/bash_completion.d/tmux | |
# $ . /etc/bash_completion.d/tmux | |
# | |
_sessions() { | |
SESSIONS=`tmux ls -F#{session_name} | xargs echo` | |
} |
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 | |
mvn clean; mvn --batch-mode -Darguments=-Dmaven.test.skip=true -DpreparationGoals="clean install" release:prepare; mvn -Darguments="-Dmaven.test.skip=true -Dmaven.javadoc.skip=true" -Dgoals=deploy release:perform |
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
import sys | |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
HandlerClass = SimpleHTTPRequestHandler | |
ServerClass = BaseHTTPServer.HTTPServer | |
Protocol = "HTTP/1.0" | |
if sys.argv[1:]: |
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
aptitude::Keep-Unused-Pattern "^linux-image.*$ | ^linux-restricted-modules.*$ | ^linux-ubuntu-modules.*$"; | |
aptitude::Get-Root-Command "sudo:/usr/bin/sudo"; | |
Aptitude::UI::Styles { | |
Default {fg white; bg default; set bold;}; | |
}; |
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
//Scramble text | |
[].forEach.call(document.querySelectorAll('h1, h2, h3, p'), function(el){ el.textContent = el.textContent.replace(/([a-z])/g, function(m){ return String.fromCharCode(m.charCodeAt() - 1) } ) }); | |
// Remove images | |
[].forEach.call(document.querySelectorAll('img'), function(img){ img.setAttribute('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'); img.style.backgroundColor = '#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 | |
# | |
# AutoSSH to host and create or connect to tmux session | |
# | |
# Author: Oystein Steimler <oystein@nyvri.net> | |
if [[ -z "$1" || -z "$2" ]] | |
then | |
echo -e "Missing parameter.\n\nUsage:\n\tremux <host> <session> [ssh-opts]\n\nExample:\n\tremux user@host.example.com session -4\n"; | |
exit 1 |
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
# To list selections from a file backup | |
$ dpkg --admindir=/path/to/backup/of/var/lib/dpkg/ --get-selections |
OlderNewer