Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

(async function(){
const endpointShifts = 'https://api.factorialhr.com/attendance/shifts';
const endpointPeriods = 'https://api.factorialhr.com/attendance/periods';
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1;
const times = [[ '08:00', '14:00' ], [ '15:30', '17:30' ]];
const allowFuture = true;
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@eusonlito
eusonlito / README.md
Last active January 1, 2024 11:36
Strong iptables and ipset protection

Protect your server with a strong iptables rules and ipset lists.

1. Install ipset to manage ipstables lists

apt install ipset

2. Install iptables-persistent to preserve iptables rules on reboot

@eusonlito
eusonlito / apt-dist-upgrade.sh
Last active June 21, 2022 06:28
Execute automated apt dist-upgrade
# Save on /usr/local/bin/apt-dist-upgrade with 700 permissions to root
# Execute: sudo apt-dist-upgrade
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
export DEBIAN_PRIORITY=critical
apt clean
apt autoclean
@eusonlito
eusonlito / local-backup.sh
Last active June 26, 2023 04:25
Easy backup script into a local computer
#!/bin/bash
# -------------------------------------
# Script to do incremental rsync backups
# into a local computer
#
# This script is freely distributed under the GPL
# -------------------------------------
@eusonlito
eusonlito / bash-prompt.sh
Last active April 22, 2021 10:31
Simple bash promp configuration
## User installation:
#
# 1) Append to user file ~/.bashrc
#
# Wide System installation:
#
# 1) Create /etc/bash.bashrc.d folder
# 2) Paste this file into /etc/bash.bashrc.d/custom.sh file
# 3) Append ". /etc/bash.bashrc.d/custom.sh" at end of /etc/bash.bashrc file
#
@eusonlito
eusonlito / backup-mysql.sh
Last active June 26, 2023 04:25
Automate your MySQL backups
#!/bin/bash
# -------------------------------------
# Databases backup with X days storage history
#
# User executing this script must have FULL permissions
# to mysql and mysqldump
#
# Use $HOME/.my.cnf to store MySQL auth
#
#!/bin/bash
# -------------------------------------
# Script to do incremental rsync backups
# from a central backup server
#
# This script is freely distributed under the GPL
# -------------------------------------
# -------------------------------------
#!/bin/bash
if [ "`whoami`" != 'root' ]; then
echo ""
echo "This script only can be executed by root"
echo ""
exit 1
fi