Skip to content

Instantly share code, notes, and snippets.

View gist:3089059
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 ]
creshal / gist:3089077
Created Jul 11, 2012
1st npm debug log
View gist:3089077
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
creshal / fix-shell-escapes.patch
Created Oct 29, 2014
Patch against lsyncd version in Debian stable
View fix-shell-escapes.patch
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 @@
View gist:649e48e11d8addac56e6
# ------------------------------------------------------------------------------
# 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.
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
creshal / ssh-benchmark
Last active Aug 29, 2015
View ssh-benchmark
#! /bin/bash
pgrep sshd >/dev/null || (echo "Please make sure SSH is running _locally_." && exit 1)
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.)"
View backup-rsync
#! /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]
creshal /
Last active Dec 23, 2015
Tunnel Nagios NRPE over SSH
#! /bin/bash
# Author: Sven Schwedas <> 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 $pnum; do
let pnum++