Skip to content

Instantly share code, notes, and snippets.

View lichti's full-sized avatar
👨‍💻
🏊🏻🚴🏻🏃🏻

Gustavo Lichti lichti

👨‍💻
🏊🏻🚴🏻🏃🏻
View GitHub Profile
@lichti
lichti / new_relic_alert.sh
Last active May 7, 2019 13:48
Script to enable or disable newrelic alerts
#!/bin/bash
if [ ! -x /usr/bin/curl ]; then
echo "Please install curl"
exit 1
fi
if [ ! -x /usr/bin/jq ]; then
echo "Please install jq"
exit 1
@lichti
lichti / gist:4dd5ce25da71ad2a9092ea7c5d42f9bc
Created August 31, 2016 20:33
fix vmware 12 driver - linux 4.4+
cd /usr/lib/vmware/modules/source
tar xvf vmmon.tar
sed -i s/get_user_pages/get_user_pages_remote/g ./vmmon-only/linux/hostif.c
tar cvf vmmon.tar vmmon-only
rm -rf vmmon-only
tar xvf vmnet.tar
sed -i s/get_user_pages/get_user_pages_remote/g ./vmnet-only/userif.c
tar cvf vmmon.tar vmnet-only
rm -rf vmnet-only
@lichti
lichti / install-wildfly.sh
Last active November 23, 2018 20:17
Install Wildfly 10 - Debian, Centos, RHEL
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.Final
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.1.0.Final
#tested-distros2 :Debian 8, Centos 6
WILDFLY_VERSION=10.1.0.Final
#!/bin/bash
hook_url='https://hooks.slack.com/services/'
hook_hash='XXXXXXXXXXXXXXX/YYYYYYYYYYYYYYYYYYYYYYYYYY'
username='INFRA-BOT'
url="$hook_url/$hook_hash"
to="${1:-"#lichtiteste"}"
#!/bin/bash
hook_url='https://hooks.slack.com/services/'
hook_hash='XXXXXXXXXXXXXXXXXXXXXXXXXX'
username='INFRA-BOT'
url="$hook_url/$hook_hash"
to="${1:-"#generic"}"
@lichti
lichti / LogAlert.mikrotik.script
Last active October 7, 2023 14:49
LogAlert.mikrotik.script
:global lastTimeLogingFailure;
:local varEmail "[email protected]";
:local varEmailSubj "failure login";
:local Hostname [/system identity get name];
:local filter "login failure";
:local varDate [/system clock get date];
:local varMonth [:pick $varDate 0 3];
:local varDay [:pick $varDate 4 6];
@lichti
lichti / backup.mikrotik.script
Created July 5, 2016 21:43
backup.mikrotik.script
:log info "backup beginning now";
:local varEmail "[email protected]";
:local varEmailSubj "Backup";
:local Hostname [/system identity get name];
:local varDate [/system clock get date];
:local varMonth [:pick $varDate 0 3];
:local varDay [:pick $varDate 4 6];
:local varYear [:pick $varDate 7 11];
@lichti
lichti / gist:428abbba42002a2aaa993f42ea6bb2eb
Created July 5, 2016 19:00
get a table from a full backup
zcat my-full-backup.sql.gz | sed -n '/^-- Table structure for table `mytable`/,/^-- Table structure for table /p' > my-table.sql
@lichti
lichti / GetUsers.sh
Created June 28, 2016 14:54
List users and groups
while read line; do if [ $(echo $line | cut -d: -f3) -ge $(grep -w UID_MIN /etc/login.defs | awk '{print $2}') ] && [ $(echo $line | cut -d: -f3) -lt $(grep -w UID_MAX /etc/login.defs | awk '{print $2}') ]; then echo "$(date +%d/%m/%Y-%H:%M) => $(id $(echo $line | cut -d: -f1))"; fi; done < /etc/passwd
@lichti
lichti / pgp_key_signing.txt
Created February 2, 2016 14:48
pgp Key signing
Find the key ID on the fingerprint. The fingerprint will have an 8-character ID listed after the key size. Typically it looks like this: '1024D/64011A8B'. The actual ID portion is the '64011A8B'. You'll notice this is also the last 8 characters of the fingerprint itself.
Fetch the public key using the key ID. If you're running GnuPG on the command line, you can do this by typing
gpg --keyserver pgp.mit.edu --recv-keys <KeyID>
(where KeyID is obviously the ID of the key you want).
Check that the fingerprint of the key you've just fetched matches the fingerprint on the slip of paper: run
gpg --fingerprint <KeyID>
and compare it with the hard copy in front of you.
If (and only if) you are happy that the fingerprints match and the person showed you sufficient ID, you can do the actual 'signing' part of the process: type