This file contains hidden or 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 | |
# Pulisci lo schermo all'inizio | |
clear | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
YELLOW='\033[0;33m' | |
LIGHT_BLUE='\033[94m' | |
BOLD='\033[1m' |
This file contains hidden or 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 the screen at the beginning | |
clear | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
YELLOW='\033[0;33m' | |
LIGHT_BLUE='\033[94m' | |
BOLD='\033[1m' |
This file contains hidden or 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 | |
# Define color codes | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[1;33m' | |
BLUE='\033[1;34m' # Brighter blue | |
LIGHTBLUE='\033[1;36m' # Light blue/cyan | |
CYAN='\033[0;36m' | |
BOLD='\033[1m' |
This file contains hidden or 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 hidden or 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 json | |
import urllib.parse | |
from pathlib import Path | |
class PlaylistConverter: | |
def __init__(self, json_file: str, name: str): | |
self.data = json.load(open(json_file, 'r', encoding='utf-8')) | |
self.name = name | |
self.filename = name.lower().replace(' ', '_') |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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] |
NewerOlder