Verifying that +dralbert is my blockchain ID. https://onename.com/dralbert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /usr/local/bin/listAliasByDomain | |
# | |
# Lists all aliases for mailboxes and distribution lists associated with a particular domain | |
# | |
# Syntax: listAliasByDomain someMailDomain.com | |
# | |
# The settings for the LDAP queries are guesses. They work for me, but if I have overlooked | |
# something, please let me know! | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# @author Emiliano Gabrielli <albert@superalbert.it> | |
# @license MIT | |
# | |
BASE_DIR="${BASE_DIR:=.}" | |
WRT_DIRS="${WRT_DIRS:=}" | |
HTTPD_USR=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('FORCE_HTTPS', true); //set true if you want only https | |
//@see https://github.com/maxmind/geoip-api-php | |
define('GI_INCLUDE_PATH', __DIR__.'/includes/geoip'); | |
require_once GI_INCLUDE_PATH.'/geoip.inc.php'; | |
//XXX to be improved | |
$languages = array('en', 'it', 'de'); //first is default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to make a locally browseable version of a given URL | |
# | |
# @author Emiliano Gabrielli <albert@faktiva.com> | |
# @license MIT | |
LC_ALL=C | |
LANG=C | |
FONT_DEF=$'\033[0m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIXER_BIN=$(which php-cs-fixer.phar) | |
CFG_FILE=".php_cs" | |
COMMAND="${FIXER_BIN} fix --config=${CFG_FILE} -vvv --path-mode=intersection --dry-run --no-ansi" | |
TMP_DIR="$(mktemp -d -t CS-FIX.XXXXXXXXX)" | |
function do_cleanup { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automated AMI and Snapshot Deletion | |
# | |
# @author Robert Kozora <bobby@kozora.me> | |
# | |
# This script will search for all instances having a tag with "Backup" or "backup" | |
# on it. As soon as we have the instances list, we loop through each instance | |
# and reference the AMIs of that instance. We check that the latest daily backup | |
# succeeded then we store every image that's reached its DeleteOn tag's date for | |
# deletion. We then loop through the AMIs, deregister them and remove all the | |
# snapshots associated with that AMI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automated AMI Backups | |
# | |
# @author Robert Kozora <bobby@kozora.me> | |
# | |
# This script will search for all instances having a tag with "Backup" or "backup" | |
# on it. As soon as we have the instances list, we loop through each instance | |
# and create an AMI of it. Also, it will look for a "Retention" tag key which | |
# will be used as a retention policy number in days. If there is no tag with | |
# that name, it will use a 7 days default value for each AMI. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CONF_DIR="/etc/nginx/sites-enabled" | |
OLD_DEFAULT="default" | |
NEW_DEFAULT="api" | |
# remove old default | |
sed -i'' -e 's/\s*default_server\s*//' "${CONF_DIR}/${OLD_DEFAULT}" | |
# set new default |
OlderNewer