Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nilton Vasques niltonvasques

🎯
Focusing
View GitHub Profile
@niltonvasques
niltonvasques / audit_ssh_logins.sh
Last active Jul 5, 2021
Easily identify the accepted SSH Logins in a Linux Host - bash < <(curl -s -L https://git.io/Jc6hV)
View audit_ssh_logins.sh
#!/bin/bash
# ssh_sha256_owners.txt file should be generated by finding the SHA256 fingerprint
# for each line present inside .ssh/authorized_keys with
# ssh-keygen -lf /tmp/user_key.pub >> ssh_sha256_owners.txt
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
EMPTY=" "
@niltonvasques
niltonvasques / knockd_generator.sh
Created Oct 13, 2019
Generate knockd configuration file
View knockd_generator.sh
#!/bin/bash
PINS=$1
HOSTNAME=$2
USERNAME=$3
PINDIPS=`shuf -i 1024-65534 -n $PINS`
OUTLOCK="knockd.conf"
# CHECK SYNTAX
View dpms_privacy_policy.md

Privacy Policy

KAEFER built the DPMS app as a commercial app. This SERVICE is provided by KAEFER to its internal companies and is intended for use as is.

This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.

If you choose to use our Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that we collect is used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at DPMS unless otherwise defined in this Privacy Policy.

@niltonvasques
niltonvasques / install_docker.sh
Created Dec 12, 2017
Script to bootstrap drone in a empty server
View install_docker.sh
#!/bin/bash
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce fail2ban
docker run hello-world
@niltonvasques
niltonvasques / pre-commit-msg
Created Aug 24, 2017
Put pronto warnings on git commit msg
View pre-commit-msg
# .git/hooks/pre-commit-msg
#!/bin/sh
echo "# Pronto Violations:" >> $1
bundle exec pronto run -c upstream/master | sed -e 's/^/# /' >> $1
@niltonvasques
niltonvasques / git_author_stats.sh
Created Jul 21, 2017
Collect some metrics from some author on git history
View git_author_stats.sh
#!/bin/bash
AUTHOR=zequinha
git log origin/master..HEAD --shortstat --author=$AUTHOR | grep "files changed" | awk '{ FILES += $1; INS += $4; DEL += $6 } END { print FILES,INS,DEL }'
@niltonvasques
niltonvasques / split_pdf_pages.sh
Created Jul 18, 2017
Split a pdf in individual pdf files
View split_pdf_pages.sh
#!/bin/bash
PAGES=17
PDF_FILE=full.pdf
for i in $(seq 1 $PAGES); do
gs -dBATCH -sOutputFile="page$i.pdf" -dFirstPage=$i -dLastPage=$i -sDEVICE=pdfwrite $PDF_FILE;
done
@niltonvasques
niltonvasques / detect_page_change.sh
Created Feb 17, 2017
Detect page changes and emit a high beep
View detect_page_change.sh
# lynx --dump URL > old.html && watch -n 10 "./detect_page_change.sh"
#
#!/bin/bash
RESULT=`diff old.html <(lynx --dump URL)`
if [ "x`printf '%s' "$RESULT" | tr -d "$IFS"`" = x ]; then
echo "NOTHING NEW"
else
( speaker-test -t sine -f 1000 )& pid=$! ; sleep 3.1s ; kill -9 $pid
@niltonvasques
niltonvasques / xp_sessions_notifier.sh
Created Oct 13, 2016
A script to manage XP programming sessions between coders.
View xp_sessions_notifier.sh
#!/bin/bash
while true; do
sleep 20m
xmessage -buttons OK:0 -default OK -nearmouse "SESSION IS OVER!!!" -timeout 60
done
@niltonvasques
niltonvasques / Makefile
Last active Jul 30, 2016
Basic android Makefile
View Makefile
APP_NAME=MyAppName
PACKAGE=com.example.package
CC=./gradlew
ADB=adb
.PHONY: build uninstall install log
all: build uninstall install log