Skip to content

Instantly share code, notes, and snippets.

View lcuevastodoit's full-sized avatar
✔️
Verified

LUIS CUEVAS lcuevastodoit

✔️
Verified
  • Bogota DC, Colombia
View GitHub Profile
@lcuevastodoit
lcuevastodoit / auto_git_file.md
Created August 27, 2020 02:16 — forked from darencard/auto_git_file.md
Automatic file git commit/push upon change

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
git config credential.helper store
@lcuevastodoit
lcuevastodoit / docker-stats.sh
Last active November 24, 2021 14:21
Docker Stats
# Docker Stats
docker stats $(docker ps --format '{{.Names}}')
docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" --no-stream
docker stats --format "table {{.Name}}\t{{.PIDs}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" --no-stream
@lcuevastodoit
lcuevastodoit / Mikrotik-CLI.rsc
Created September 3, 2020 16:08
Mikrotik-CLI
[admin@rack1_b36_CCR1009] /ip address> :put ([/ip route print as-value where gateway="ether1"])
.id=*400ae12f;distance=255;dst-address=111.111.111.1/32;gateway=ether1;pref-src=111.111.111.1
@lcuevastodoit
lcuevastodoit / FIx-Docker-Repository-in-APT.txt
Last active September 14, 2020 02:00
FIx Docker Repository in APT
nano /etc/apt/sources.list
# comment # deb https://apt.dockerproject.org/repo ubuntu-xenial main
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
@lcuevastodoit
lcuevastodoit / Install-Zabbix-Agent-Ubuntu.txt
Last active December 17, 2020 19:32
Install Zabbix Agent Ubuntu
wget https://repo.zabbix.com/zabbix/5.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.2-1%2Bubuntu20.04_all.deb
sudo dpkg -i zabbix-release_5.2-1+ubuntu20.04_all.deb
sudo apt update
sudo apt-get -y install zabbix-agent
sudo nano +117 /etc/zabbix/zabbix_agentd.conf
# modify Server:127.0.0.1,200.200.1.2 (example)
sudo systemctl enable zabbix-agent
sudo systemctl start zabbix-agent
sudo ufw allow 10050
@lcuevastodoit
lcuevastodoit / clean-zabbix-db.txt
Created September 14, 2020 19:49
Clean Zabbix Database
mv /etc/supervisor/conf.d/supervisord_server.conf /etc/supervisor/conf.d/supervisord_server.conf.old
#reboot zabbix container
mysql -uroot -p
use zabbix;
Database changed
mysql> TRUNCATE TABLE history_uint;
Query OK, 0 rows affected (0.66 sec)
mysql> TRUNCATE TABLE history;
--======================================================================
-- PREVAIL MIB
--======================================================================
-- File Name : PREVAIL-MIB.txt
-- Date : Tue Jul 27 10:55:00 CEST 2010
-- Author : frank
prevail-mib DEFINITIONS ::= BEGIN
@lcuevastodoit
lcuevastodoit / faceswap-linux-mint20-cpu.txt
Last active October 10, 2020 03:37
Installing FaceSwap in Linux Mint 20
wget https://github.com/deepfakes/faceswap/releases/download/v2.0.0/faceswap_setup_x64.shwget
chmod +x faceswap_setup_x64.sh
./faceswap_setup_x64.sh
sudo apt install python3-pip python3-tk python3-pil python3-pil.imagetk
pip3 install tqdm
python3 -m pip install matplotlib
pip3 install pynvml
pip3 install tensorflow==2.2
export PATH=$PATH:/home/myuser/.local/bin
python3 /home/myuser/faceswap/faceswap.py gui
@lcuevastodoit
lcuevastodoit / docsis-states.rb
Last active October 15, 2020 17:45
DOCSIS Modem Status
DOCSIS Modem Status Definitions
status definitions
init(o) Option file transfer was started.
init(t) Time-of-day (TOD) exchange was started.
init(r1) CM sent initial ranging parameters.
init(r2) CM is ranging.
init(rc) Ranging is complete.
dhcp(d) DHCP Discover was sent by CM.
dhcp(o) DHCP Offer was received.
@lcuevastodoit
lcuevastodoit / tod-37-tcp.txt
Created October 15, 2020 18:52
TOD 37 TIME SERVER
nc $IP 37 | hexdump
nc localhost 37 | hexdump
nc 132.163.97.1 37 | hexdump
nc time-a-wwv.nist.gov 37 | hexdump