Skip to content

Instantly share code, notes, and snippets.

@mbenegas
mbenegas / rsync-retry.sh
Created November 7, 2017 03:16 — forked from iangreenleaf/rsync-retry.sh
rsync with retries
#!/bin/bash
### ABOUT
### Runs rsync, retrying on errors up to a maximum number of tries.
### Simply edit the rsync line in the script to whatever parameters you need.
# Trap interrupts and exit instead of continuing the loop
trap "echo Exited!; exit;" SIGINT SIGTERM
MAX_RETRIES=50
#!/bin/sh
set -e
set -x
mkdir temp
cd temp
wget http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe
cabextract -L -F ppviewer.cab PowerPointViewer.exe
cabextract ppviewer.cab
@mbenegas
mbenegas / ensite.sh
Created September 22, 2012 17:59 — forked from mateusg/ensite.sh
Script for enabling a site, just like a2ensite, from Apache2.
#! bin/bash
# Enables a site, just like a2ensite command, from Apache2.
SITES_AVAILABLE_CONFIG_DIR="/opt/nginx/sites-available";
SITES_ENABLED_CONFIG_DIR="/opt/nginx/sites-enabled";
if [ $1 ]; then
if [ -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already enabled!";
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
@mbenegas
mbenegas / gist:3139481
Created July 18, 2012 22:46 — forked from blitline-dev/gist:3137772
Trim, Watermark, Resize to fit
{
"application_id": "APP-ID",
"src" : "http://www.google.com/logos/2011/houdini11-hp.jpg",
"functions" :
[
{
"name" : "trim",
"functions" : [
{
"name": "watermark",