View kill_zombies.sh
kill $(ps -A -ostat,ppid | awk '/[zZ]/{print $2}')
View crawl_website.sh
# Simple as is
wget --recursive --page-requisites --convert-links www.libero.it
View ifexit.sh
# exit if a command fails
set -e
View send_email_with_attachment.sh
# Setup
apt-get install -y sharutils
# How to
f=image0001.png
uuencode $f `basename $f` | mail -s "see the attachment" root@example.com
View nginx_ssl_proxy.conf
#
# Nginx SSL Proxy
# @link https://gist.github.com/lidio601/aa97397f8cdb5f405ce770dde2fe3c2b
# @link https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins
#
# Redirect all HTTP requests to SSL
server {
View website_validator.sh
#!/bin/bash
#WEBSITE="http://example.com"
#THRES=3
#FORCE=$3
CACHEDIR=/tmp
if [ -t 1 ]
then
View movie2gif.sh
#!/bin/bash
IN="quickcast.mp4"
OUT="output.gif"
# INPUT FILE: quickcast.mp4
# OUTPUT FILE: output.gif
ffmpeg -y -i $IN -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
ffmpeg -i $IN -i palette.png -filter_complex "fps=5,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" -y $OUT
View print_debug_information.sh
#!/bin/bash
if [ -t 1 ]
then
: # running from terminal
debug="1"
else
: # not running from terminal, cron maybe
debug="0"
fi
View mac_label.sh
#!/bin/bash
# http://stackoverflow.com/questions/6212219/passing-parameters-to-a-bash-function
# http://superuser.com/questions/168927/mac-os-x-how-to-change-the-color-label-of-files-from-the-terminal
# Set Finder label color
label() {
#echo "Default colors:"
#echo " 0 No color"
#echo " 1 Orange"
View quick_sort.py
import random
__author__ = 'fabiocigliano'
def genarray():
n = int(random.random() * 10) + 1
ris = range(n)
random.shuffle(ris)
return ris