Skip to content

Instantly share code, notes, and snippets.

View gtrabanco's full-sized avatar
:octocat:

Gabriel Trabanco gtrabanco

:octocat:
  • Spain
View GitHub Profile
@gtrabanco
gtrabanco / get-system-stats.sh
Created September 15, 2020 00:12
Get some hardware and running process information
#!/bin/bash
#Number of cores
cores=$(grep -c ^processor /proc/cpuinfo) # Count all lines that starts with processor
print "This system has ${cores} cores"
nproc --all # This will also show a number
grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}' # Hyper-Threading
cat /proc/cpuinfo # Human readable information about all the processors
@gtrabanco
gtrabanco / introrx.md
Created September 15, 2020 00:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@gtrabanco
gtrabanco / S00-backnifi.sh
Last active February 20, 2023 09:50
Script to do a backup of unifi or protect files with udm
#!/usr/bin/env sh
{ # Ensure all script is loaded
#
# Backup unifi or protect configuration files to a remote server
# You should install first the public key remotely.
#
# To do ssh authentication if you have a Cloud Key Gen2, it is like any other
# debian. Just use "ssh-keygen" and "ssh-copy-id"
#
@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:
@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 / 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 / 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 / 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 / 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 / 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