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 wand.image import Image | |
| from wand.display import display | |
| folder = './' # Replace with your folder | |
| # Loop over all files in the given folder | |
| for filename in os.listdir(folder): | |
| # Check if current file is a HEIC file | |
| if filename.lower().endswith('.heic'): |
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
| #!/usr/bin/env sh | |
| # Original author: Michalis Georgiou <mechmg93@gmail.comr> | |
| # Modified by Andrew http://www.webupd8.org <andrew@webupd8.org> | |
| # Current version by Kassius Iacchus https://github.com/iacchus/ | |
| # Depends on: `wget` | |
| # | |
| # Install `wget` on Debian/Ubuntu with: | |
| # apt install wget |
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 | |
| import shutil | |
| import subprocess | |
| _7Z_PATH = 'C:\\Program Files\\7-Zip\\7z.exe' | |
| def zip_and_remove_directory(directory): | |
| # Construct the command to zip the directory. | |
| command = [_7Z_PATH, 'a', '-r', f'{directory}.7z', directory] | |
| # Call the command. |
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
| sudo apt install smartctl | |
| sudo apt install smartmontools | |
| sudo fdisk -l | |
| sudo umount /dev/sdd1 | |
| sudo smartctl -s standby,now /dev/sdd | |
| # or | |
| hdparm -S 1 /dev/sdd | |
| # or | |
| sudo smartctl -s standby,now /dev/sdd |
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
| for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X\" |
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
| REGEDIT4 | |
| ;comment it to do not open a folder at double-click | |
| [HKEY_CLASSES_ROOT\Folder\shell] | |
| @="Total_Commander" | |
| [HKEY_CLASSES_ROOT\Folder\shell\Total_Commander] | |
| @="Total Commander" | |
| ; /0 for open in existing instance |
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 | |
| def delete_all_files(directory): | |
| for root, dirs, files in os.walk(directory): | |
| for file in files: | |
| file_path = os.path.join(root, file) | |
| try: | |
| os.remove(file_path) | |
| print(f"Deleted {file_path}") | |
| except Exception as e: |
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 | |
| import ffmpeg | |
| import pysubs2 | |
| from pysrt import open as open_srt | |
| def srt_to_lrc(srt_path, lrc_path): | |
| subs = pysubs2.load(srt_path) | |
| with open(lrc_path, "w") as lrc_file: | |
| for sub in subs: | |
| start_time = sub.start / 1000.0 # Convert milliseconds to seconds |
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
| python -V | |
| python3 -V | |
| sudo apt update | |
| sudo add-apt-repository ppa:deadsnakes/ppa | |
| sudo apt install software-properties-common | |
| sudo add-apt-repository ppa:deadsnakes/ppa | |
| sudo apt update | |
| sudo apt install python3.9 | |
| python3.9 -V | |
| sudo apt install python3.9 |
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
| strtrim() is the new name of trim(). | |
| strltrim() is the new name of ltrim(). | |
| replace X=subinstr(X," ","",.) | |
| substr(s,n1,n2) | |
| usubstr() and udsubstr(). | |
| subinstr(s1,s2,s3,n) | |
| regexm | |
| strpos | |
| ustrlower | |
| ustrupper |
NewerOlder