Skip to content

Instantly share code, notes, and snippets.

@ekyo
ekyo / explain
Created August 30, 2013 11:47
Bash script for querying explainshell.com from the command line. Requires curl to be installed.
#!/bin/bash
URL=$(echo "http://explainshell.com/explain/$1?args=${@:2}" | sed -e 's/ /+/g')
curl -s "$URL" | sed -n '/<pre/,/<\/pre>/p' | sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | \
sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)