Skip to content

Instantly share code, notes, and snippets.

View Neolot's full-sized avatar
🏠
Make the web great again

Yurii Pokhylko Neolot

🏠
Make the web great again
View GitHub Profile
@Neolot
Neolot / clone_repos.sh
Created January 13, 2026 21:13
Bulk clone git-repositories from the file
#!/bin/bash
# Filename containing the list of repositories
FILE="repos.txt"
# 1. Check if repos.txt exists
if [ ! -f "$FILE" ]; then
echo "Error: File $FILE not found in the current directory."
exit 1
fi
@Neolot
Neolot / update.sh
Created May 10, 2025 00:36
Simple update script for Debian-based distribution (Debian, Ubuntu, etc)
#!/usr/bin/sh
sudo apt update && sudo apt list --upgradable
echo 'Do you want to run the update? (Y/n)'
read INPUT
case $INPUT in
n)
echo 'Update cancelled.'
exit
@Neolot
Neolot / redirects.php
Last active May 22, 2024 21:31
Wordpress. 301 redirects to another domain.
<?php
add_action( 'init', function () {
// Exceptions (do not redirect these URIs)
$exceptions = array(
'/exception1',
'/exception2',
);
// Redirects to special URIs
$special_redirects = array(
@Neolot
Neolot / extract_mkv_track.sh
Created May 1, 2024 14:18
LINUX Extract track from MKV
#!/usr/bin/sh
file=$1
if [ -z "$file" ]; then
echo "USAGE: extract_mkv_track.sh <filename>"
exit 1;
fi
extension="${file##*.}"
@Neolot
Neolot / optimize_svg.sh
Last active March 23, 2023 00:36
SVG optimization in Nautilus with svgo
#!/bin/bash
if ! command -v svgo &> /dev/null; then
echo "SVGO is not installed. Install it by running 'npm install -g svgo'"
exit 1
fi
for file in "$@"; do
if [ -f "$file" ]; then
extension="${file##*.}"
@Neolot
Neolot / resize_images.sh
Last active September 9, 2021 10:41
IMAGEMAGICK Bulk resize images
#!/usr/bin/sh
cd images_processed
# Convert png to jpg
mogrify -format jpg -quality 90 *.png
rm -f *.png
# Resize images
for PHOTO in *
@Neolot
Neolot / gist:902095bee38329de4dc27822c77172fc
Last active August 20, 2022 17:37
fail2ban - Check IP and unban
// Check banned IP
sudo zgrep '<IP>' /var/log/fail2ban.log*
// Unban IP
sudo fail2ban-client set <jail_name> unbanip <IP>
@Neolot
Neolot / 0_reuse_code.js
Created September 12, 2017 08:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Neolot
Neolot / track_404.php
Last active October 8, 2018 16:55
Track 404 error with Universal Analytics
<script type="text/javascript">
ga('send', 'event', 'error_404', '<?php echo $_SERVER['REQUEST_URI']; ?>', '<?php echo ($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'direct'; ?>');
</script>