Skip to content

Instantly share code, notes, and snippets.

View gtrabanco's full-sized avatar
:octocat:

Gabriel Trabanco gtrabanco

:octocat:
  • Spain
View GitHub Profile
#!/bin/bash
# /volume1/UDMBackup is the path to the NFS share on the Synology
# /nfs/UDMBackup is the mount point on the local Linux server where the script runs
# /opt/scripts/UDM_pass is a text file containing the root account password on the UDM
# I run this script on an Ubuntu VM for ease of maintenance and save the backups on a Synology using NFS
LOGFILE="/opt/scripts/udmpro-backup.log"
BKUPSCRIPT="sshpass -f /opt/scripts/UDM_pass scp -o StrictHostKeyChecking=no -r root@<<UDM PRO IP ADDRESS>>:/mnt/data/unifi-os/unifi/data/backup/autobackup/* /nfs/UDMBackup"
mount <<SYNOLOGY IP ADDRESS>>:/volume1/UDMBackup /nfs/UDMBackup
@gtrabanco
gtrabanco / semver_compare.sh
Created April 9, 2021 00:25
Bash semver compare
# Used as reference: https://gist.github.com/maxrimue/ca69ee78081645e1ef62
platform::semver_compare() {
normalize_ver() {
echo "${${1//./ }//v/}"
}
compare_ver() {
[[ $1 -lt $2 ]] && echo -1 && return
[[ $1 -gt $2 ]] && echo 1 && return
@gtrabanco
gtrabanco / adding-for-the-first-time.sh
Created February 19, 2021 15:03 — forked from ericboehs/adding-for-the-first-time.sh
Keybase.io + GitHub Verified Commits + macOS Keychain
# Install keybase and pinentry-mac
brew update
brew install keybase pinentry-mac
# Create a Keybase.io account and key
keybase signup
# Or if you have an account
keybase login
@gtrabanco
gtrabanco / keybase.md
Created February 14, 2021 00:24 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@gtrabanco
gtrabanco / remove-bg.css
Created February 3, 2021 12:46
Remove solid Bg?
<!--- Show here: https://twitter.com/latteandcode/status/1356584007199318016 --->
.remove-bg {
filter: brightness(1.1);
mix-blend-mode: multiply;
}
@gtrabanco
gtrabanco / TunnelToLocalhost.sh
Last active February 17, 2024 11:16
Tunnel remote connection to ssh server tunneling to localhost to move files to local, copy files, use copy&paste...
#!/usr/bin/env bash
# To use this script see comments
write::out() {
echo "$@"
}
write::log() {
[[ ! -z "$DEBUG" ]] && write::out "$@"
@gtrabanco
gtrabanco / eth0.30.network
Created October 9, 2020 12:03
Network file in Cloud Key Gen2 to configure a second interface for a VLAN. File must be in: /etc/systemd/network/eth0.30.network
[Match]
Name=eth0.30
[Network]
DHCP=no
Gateway=192.168.X.1
DNS=192.168.X.1
Domains=localnetwork.local
[Address]
@gtrabanco
gtrabanco / eth0.30.netdev
Created October 9, 2020 12:02
NetDev file in Cloud Key Gen2 to configure a second interface for a VLAN. File must be in: /etc/systemd/network/eth0.30.netdev
[NetDev]
Name=eth0.30
Kind=vlan
[VLAN]
Id=30
@gtrabanco
gtrabanco / index.html
Last active October 3, 2020 20:15
Generador de códigos para ZigbeeMQTT (http://zigbeekeys.fwok.org)
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Generador de claves Zigbee para Home Assistant</title>
<style>
body {
font-family: helvetica, arial, sans-serif;
}
@gtrabanco
gtrabanco / osx_defaults.sh
Created September 27, 2020 17:17
OSX Defaults to setup a brand new machine
#!/usr/bin/env bash
# TODO: Need to figure out the settings for the following:
# 1) Dock: Items with order (not capturing binary data - since that is dependent on installed apps)
# 2) Security & Privacy Preferences: Full Disk Access, Camera, Microphone
# 3) Login items for my user (i.e. apps started when I login)
# 4) Retina displays
##
# This is a script with useful tips taken from: