Skip to content

Instantly share code, notes, and snippets.

View gtrabanco's full-sized avatar
:octocat:

Gabriel Trabanco gtrabanco

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gtrabanco on github.
  • I am gtrabanco (https://keybase.io/gtrabanco) on keybase.
  • I have a public key whose fingerprint is 6C91 B4F1 9091 B6B9 D9A3 1A31 1D3F F6B4 CD36 35D3

To claim this, I am signing this object:

@gtrabanco
gtrabanco / gist:f9f799bcb289fa24138da76611a5606f
Created March 13, 2017 20:50 — forked from Dufgui/gist:72debe81068bf3ecd7d8
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
var dec = function (arr) {
var result = '';
arr.forEach(function (v) {
var letter = String.fromCharCode(parseInt(parseInt(v,16).toString(10)));
result += letter;
});
return result;
};
@gtrabanco
gtrabanco / cleanallunuseddockerimages.sh
Created June 10, 2017 13:56
Script to remove all unused and old images of docker from the system
#!/bin/bash
# Remove all the dangling images
DANGLING_IMAGES=$(docker images -qf "dangling=true")
if [[ -n $DANGLING_IMAGES ]]; then
docker rmi "$DANGLING_IMAGES"
fi
# Get all the images currently in use
USED_IMAGES=($( \
@gtrabanco
gtrabanco / addCert.sh
Last active June 16, 2017 16:10
Add a domain to letsencrypt without generate a new cert using nginx
#!/usr/bin/env bash
LETSENCRYPT_BIN="/opt/certbot/certbot-auto
$LETSENCRYPT_BIN --expand certonly \
-a webroot --webroot-path=/var/www/letsencrypt \
--agree-tos --staple-ocsp --hsts \
-d previous.domain.example.com \
-d newdomain.example.com,www.newdomain.example.com
@gtrabanco
gtrabanco / createCert.sh
Created June 16, 2017 16:08
Generate a new Let's Encrypt certificate
#!/usr/bin/env bash
LETSENCRYPT_BIN="/opt/certbot/certbot-auto
$LETSENCRYPT_BIN certonly --renew-by-default -a webroot --webroot-path=/var/www/letsencrypt \
--agree-tos --staple-ocsp --hsts \
-d example.com,www.example.com \
-d sub.example.com
@gtrabanco
gtrabanco / mac-vendor.txt
Created August 23, 2019 08:57 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
@gtrabanco
gtrabanco / ddns-update.sh
Last active July 16, 2020 00:03
Script to update in ovh the ip address of dynamic DNS and send the IP using Telegram Bot when update the ip.
#
# CONFIG
#
#FQDN
HOST="example.com"
# Telegram
BOT_API_KEY=""
BOT_CHAT_ID=""
#!/bin/sh
#
# Github: github.com/gtrabanco
# Author: Gabriel Trabanco
# Website: gabi.io
# Description: This script append a publickey on UDMB/P because it deleted in every reboot/provision
# and I hate writing the password.
#
# You should have installed on_boot.d from https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script
#!/bin/bash
# Delete all duplicate rules
/sbin/service iptables save
/sbin/iptables-save | awk '/^COMMIT$/ { delete x; }; !x[$0]++' > /tmp/iptables.conf
/sbin/iptables -F
/sbin/iptables-restore < /tmp/iptables.conf
/sbin/service iptables save
/sbin/service iptables restart
if [ -f /tmp/iptables.conf ] ; then /bin/rm -f /tmp/iptables.conf ; fi