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 | |
# Author: Sven Schwedas <sven.schwedas@tao.at> for TAO Software | |
# Published under MIT license | |
function freeport () { | |
# pick random port to keep collision chance minimal, ideally we don't want | |
# to enter the loop at all | |
pnum=$(shuf -i $(sed 's/\t/-/' /proc/sys/net/ipv4/ip_local_port_range) -n 1) | |
while nc -z 127.0.0.1 $pnum; do | |
let pnum++ |
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/python | |
import sys,os,time,glob,shutil | |
import subprocess as sp | |
def backup (src,dst): | |
src = sys.argv[1] | |
exclude_file = os.path.join (src,'.backup-exclude') | |
dst = sys.argv[2] | |
dst_dir = os.path.join (dst,'%i'%time.time()) | |
lnk_dir = get_old_backups (dst)[-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
info it worked if it ends with ok | |
verbose cli [ '/usr/local/bin/node', | |
verbose cli '/usr/local/bin/npm', | |
verbose cli 'install', | |
verbose cli '-g', | |
verbose cli 'jshint' ] | |
info using npm@1.1.0-beta-4 | |
info using node@v0.8.1 | |
verbose config file /root/.npmrc | |
verbose config file /usr/local/etc/npmrc |
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
0 info it worked if it ends with ok | |
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', '-g', 'jshint' ] | |
2 info using npm@1.1.33 | |
3 info using node@v0.8.1 | |
4 verbose config file /root/.npmrc | |
5 verbose config file /usr/local/etc/npmrc | |
6 verbose config file /usr/local/lib/node_modules/npm/npmrc | |
7 verbose read json /usr/local/lib/package.json | |
8 verbose read json /usr/local/lib/package.json | |
9 verbose cache add [ 'jshint', 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
#! /bin/bash | |
pgrep sshd >/dev/null || (echo "Please make sure SSH is running _locally_." && exit 1) | |
sz=${1:-128} | |
testfile=$(mktemp -p /run/user/$UID) | |
filename=$(basename $testfile) | |
echo "Generating temporary file, $sz MiB size. Supply a size argument to change. (Should be small enough to fit in RAM twice.)" |
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
# ------------------------------------------------------------------------------ | |
# tlp - Parameters for power save | |
# Hint: some features are disabled by default, remove the leading # to enable | |
# them. | |
# Set to 0 to disable, 1 to enable TLP. | |
TLP_ENABLE=1 | |
# Seconds laptop mode has to wait after the disk goes idle before doing a sync. |
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
Sanitize mv arguments: | |
1. Fixes crashes on file names containing `, $ or " | |
2. Also prevents shell execution of ``, $() … in file names, which can be | |
used to gain remote shell access as lsyncd's (target) user. | |
Index: lsyncd-2.0.7/default-rsyncssh.lua | |
=================================================================== | |
--- lsyncd-2.0.7.orig/default-rsyncssh.lua 2012-02-16 08:24:20.000000000 +0100 | |
+++ lsyncd-2.0.7/default-rsyncssh.lua 2014-10-29 13:59:51.165553255 +0100 | |
@@ -29,14 +29,17 @@ |