shtuff.it is a collection of online IT resources and projects.

Latest Additions

Digital Ocean offers a free $10 credit when you try out their service. Sign up here to try them out and get your $10 credit.
Targeting specific minions in salt stack can lead to some length command, the following bash snippet will generate a bash alias of the minion_id example:
salt data01.shtuff.it cmd.run 'ls /'
is shortened to
data01.shtuff.it 'ls /' 
The only requirement is jq to be installed on your salt master
for i in `salt-key --out=json | jq -r '.minions[]'`; do 
    alias $i="salt $i cmd.run"
StartSSL - https://www.startssl.com/

Provides everything from free low-assurance SSL certificates up to the most advanced PKI and security solutions for your business and personal use.

CAcert - http://www.cacert.org/

CAcert.org is a community-driven Certificate Authority that issues certificates to the public at large for free.

Instant SSL - http://www.instantssl.com/ssl-certificate-products/free-ssl-certificate.html

Free trial cert for 90 days

Comodo - http://ssl.comodo.com/free-ssl-certificate.php

Comodo Free SSL is a fully functional Digital Certificate, recognized and trusted by 99.9% of browsers. Your visitors will see the golden padlock and won't see security warnings.

Godaddy - http://www.godaddy.com/ssl/ssl-open-source.aspx

Free SSL certificates for open source projects

RapidSSL - http://www.freessl.com/

Free 30 day trial SSL

Positive SSL - http://www.positivessl.com/free_ssl_certificate.php

Free 30 day trial SSL

GeoTrust - https://www.geotrust.com/ssl/free-ssl-certificate/

The free* GeoTrust® SSL Trial offers a fully functioning SSL certificate. Now you can make a true evaluation of your SSL needs before you purchase.

Gandi.net - http://wiki.gandi.net/en/ssl/standard/free

Free Certs for 1 year

GlobalSign - https://www.globalsign.com/ssl/ssl-open-source/

Free SSL certificates for open source projects

Place a .gitignore file in the root of your projects to have the excluded from the watch-full eyes of git. Here's a simple use, i don't want the swap files from vim or the compiled version of python files:
$ cat ~/.gitignore
Additional the .gitignore can be placed in your home directory and made use of globally by your user. Create the desired ~/.gitignore and issues the following command to enable it:
$ git config --global core.excludesfile ~/.gitignore
Github has a number of pre-made .gitignore files to make use of here: https://github.com/github/gitignore
In order to remove a pass phrase from a SSL key: Make a copy of your current key:
cp server.key server.key.org
rewrite the key file (you will be propted to enter the pass phrase):
openssl rsa -in server.key.org -out server.key
Enter pass phrase for server.key.org:
writing RSA key
To set IFS to newline in bash run the following:
You can preserve the previous state of IFS by storing the value in variable and resetting after your loop:

for line in `cat filename`; do
    echo $line

The following script will dump your existing crontab and create a .pp file for use with puppet:


OUTFILE="crons-$(date +%s).pp"

touch $OUTFILE

for CRON in $(crontab -l | grep -v '^#\|^$\|^[A-Za-z]'); do
	echo "Processing $CRON"

	COMMAND=$(echo $CRON | awk '{print substr($0, index($0,$6))}')

	if [[ $CRON == '^@' ]]; then
		SPECIAL=$(echo $CRON | awk '{print $1}' | sed 's/@//g')
		MINUTE=$(echo $CRON | awk '{print $1}')
		HOUR=$(echo $CRON | awk '{print $2}')
		DAY=$(echo $CRON | awk '{print $3}')
		MONTH=$(echo $CRON | awk '{print $4}')
		DOW=$(echo $CRON | awk '{print $5}')

	BEFORE=$(crontab -l | grep -B1 $CRON | head -1)

	if [[ $before == '^#*' ]]; then
		TITLE=$(echo $BEFORE | sed 's/^#//g' | sed 's/^ //g')

	echo "cron{'$TITLE':" >> $OUTFILE 
	echo "  command  => '$COMMAND'," >> $OUTFILE
	echo "  ensure   => 'present'," >> $OUTFILE
	if [[ -z $SPECIAL ]]; then
		echo "  minute   => '$MINUTE'," >> $OUTFILE
		echo "  hour     => '$HOUR'," >> $OUTFILE
		echo "  monthday => '$DAY'," >> $OUTFILE
		echo "  month    => '$MONTH'," >> $OUTFILE
		echo "  weekday  => '$DOW'," >> $OUTFILE
		echo "  special  => '$SPECIAL'," >> $OUTFILE
	echo "}" >> $OUTFILE
	echo " " >> $OUTFILE


Use pip's freeze command to generate a requirements.txt file for your project:
pip freeze > requirements.txt
The US Census Bureau offers downloads of shape files outlining US congressional districts for free here:
The US Census Bureau offers downloads of shape of all US rail roads for free here: ftp://ftp2.census.gov/geo/tiger/TIGER2012/RAILS/