This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
echo && echo Update package lists and upgrade packages | |
sudo apt update | |
sudo apt dist-upgrade -y | |
echo && echo Install NetworkManager without recommended packages | |
sudo apt install --no-install-recommends network-manager -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
A="/var/www/html/admin/scripts/pi-hole/js/index.js" | |
valori() { | |
echo | |
sed -i 's/topItems/topItems='$f'/' $A | |
sed -i 's/getQuerySources\&topClientsBlocked/getQuerySources='$t'\&topClientsBlocked='$b'/' $A | |
echo "Now queries number are:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Specify the file name | |
file_name = "text.txt" | |
# Check if the file exists | |
if os.path.exists(file_name): | |
# Read the content of the file with explicit encoding (e.g., 'utf-8') | |
with open(file_name, "r", encoding="utf-8") as file: | |
content = file.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import requests | |
def get_outdated_packages(): | |
try: | |
print("Searching for outdated packages...") | |
# Execute the 'pip list --outdated' command to get the list of packages to update | |
outdated_packages = ( | |
subprocess.check_output(["pip", "list", "--outdated"]) | |
.decode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow | |
def show_current_time(): | |
current_time = arrow.utcnow() | |
formatted_current_time = current_time.format("YYYY-MM-DD HH:mm:ss") | |
unix_time = int(current_time.timestamp()) | |
print(f"Current Time: {formatted_current_time}") | |
print(f"Unix Time: {unix_time}") | |
def convert_unix_time(unix_time): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from mutagen import File | |
class AudioFile: | |
def __init__(self, file_path): | |
self.audio = File(file_path, easy=True) | |
def get_title(self): | |
return self.audio.get("title", [None])[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tput clear | |
echo | |
echo "********************* Hello $USER! *********************" | |
echo | |
echo "Please paste MAC address that you want to convert into IPv6:" | |
read A | |
ipv6() { | |
IFS=':'; set $1; unset IFS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tput clear | |
echo | |
echo "********************* Hello $USER! *********************" | |
echo | |
echo "Please paste DNS name that you want to convert into IP:" | |
read A | |
echo | |
echo "IP of $A is: `dig $A | awk '/^;; ANSWER SECTION:$/ { getline ; print $5 }'`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tput clear | |
echo | |
echo "********************* Hello $USER! *********************" | |
echo | |
echo "Please paste link of folder that you want to download:" | |
read A | |
echo | |
wget -m -np -c --no-check-certificate -R "index.html*" $A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
# Define dimensions for various icon images | |
sizes = [(16, 16), (32, 32), (48, 48), (256, 256)] | |
try: | |
# Open the source image (replace 'icon.png' with the path to your image file) | |
source_image = Image.open("icon.png") | |
# Check if the source image size is at least 256x256 |