Skip to content

Instantly share code, notes, and snippets.

View Lathanao's full-sized avatar

Lathanao Lathanao

View GitHub Profile
@Lathanao
Lathanao / Install Mozjpeg 4 on Debian Ubuntu Mint
Last active March 19, 2024 14:07 — forked from Kelfitas/mozjpeg-install-debian
Install Mozjpeg 4 on debian / Ubuntu
#!/bin/bash
echo ""
echo "---------------------------------"
echo "| AUTO COMPILE MOZJPEG |"
echo "---------------------------------"
echo ""
echo "Apt update"
sudo apt update && apt upgrade && apt remove $(deborphan) && apt autoremove && apt clean
echo "Update"
sudo apt update
@Lathanao
Lathanao / Performance_tracker.sh
Last active March 18, 2024 14:12
Performance tracker
#!/bin/bash -xe
# Performance tracker (MIT License)
# By Lathanao (last update: 24/11/2023)
#
# Script work well when that has been set:
# $ echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/no-more-password"
# $ sudo ln -s /dir/of/Scripts/* /etc/cron.daily/
@Lathanao
Lathanao / Obsidian backup on Google Drive
Last active March 18, 2024 13:57
Obsidian backup on Google Drive
#!/bin/bash
# Backup Obsidian vault (MIT License)
# by Lathanao (last update: 2023/12/01)
PATH_OBSIDIAN="$HOME/Documents/Obsidian_Vault"
PATH_GDRIVE='/run/user/1000/gvfs/google-drive:host=gmail.com,user=you/xxxxxxxxxx'
PASS="password_for_the_backup"
SLUG=$(date "+%Y%m%d_%H%M%S")_$(whoami)_obsidian_vault
LOG_DIR=/var/log/usercron
@Lathanao
Lathanao / Ip_tracker.sh
Last active March 18, 2024 13:55
Ip tracker
#!/bin/bash -xe
# Ip tracker (MIT License)
# By Lathanao (last update: 18/03/2024)
#
# Script work well when that has been set:
# $ echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/no-more-password"
# $ sudo ln -s /dir/of/Scripts/* /etc/cron.daily/
LOG_DIR=/var/log/usercron
@Lathanao
Lathanao / prefetch-lookupIP
Last active March 18, 2024 13:54
Enhance performance through prefetching lookup IP in hosts file
#!/bin/bash +xe
# Enhance performance through prefetching lookup IP in hosts file (MIT License)
# by Lathanao (last update: 24/02/2024)
USER=$(last | grep "login screen" | tail -n 1 | awk '{print $1}')
TMP_DIR="$(mktemp -d)"
PATH_HISTORY="/home/$USER/.config/chromium/Default/History"
@Lathanao
Lathanao / Alias_password_generator_for_terminal.zshrc
Last active March 16, 2024 07:12
Alias password generator for terminal
alias pass='pwgen 14 1'
alias passs="python -c 'import secrets; print(secrets.token_hex())'"
alias passss="head -c 14 /dev/urandom | sha1sum | cut -d' ' -f1"
@Lathanao
Lathanao / Build FalkorDB on Manjaro.md
Last active March 12, 2024 10:53
Compile FalkorDB on Manjaro

First:

$ pamac install cmake

Then:

$ cd ~/Download
$ wget https://www.piumarta.com/software/peg/peg-0.1.18.tar.gz
$ sudo tar -xzvf *.tar.gz 
@Lathanao
Lathanao / .zshrc
Created February 24, 2024 07:42
Supercharge my shell with that in my .zshrc
expiration_password=$(passwd -S $USER | awk '{print $3}')
expiration_password_unix=$(date -d "$expiration_password" +%s)
date_actuelle=$(date +%s)
diff=$((date_actuelle - expiration_password_unix))
if [ $diff -gt 2592000 ]; then
echo "\e[36m\e[5m Password too old. Update it with $ passwd \${whoami}.\e[0m" | bat --style grid
fi
w | awk 'NR>2' | bat --style grid
@Lathanao
Lathanao / 15 thing to check-Linux install.md
Last active January 21, 2024 22:11
15 things to do after a fresh Linux install

15 things to do after a fresh Linux install

1. Set low latency kernel

  • sudo apt-get install linux-lowlatency linux-headers-lowlatency

1. Configure Update Manager

  • choose best mirrors

2. Install Drivers

  • open driver manager
@Lathanao
Lathanao / my.cnf
Last active January 10, 2024 15:54
Percona Server 8.0 configuration file
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.