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
# deCOMPILE and old config | |
cd | |
cp /path_to_backup_dconf/user ~/.config/dconf/test | |
printf %s\\n "user-db:test" > db_profile | |
DCONF_PROFILE=~/db_profile dconf dump / > old_settings | |
# remove unused files | |
rm -f ~/db_profile ~/.config/dconf/test | |
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
ffmpeg -i movie_name.mp4 -f srt -i movie_subtitle.srt -c:v copy -c:a copy -c:s mov_text movie_name.SoftSub.mp4 |
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 in */; | |
do | |
tar -cvfz $d > "${d%/}.tar.gz" && echo $d; | |
done |
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 glob import glob | |
from pathlib import Path | |
import re | |
import shutil | |
def main(): | |
# grab movies files | |
movie_files = [item for item in glob('*.mp4')] |
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 pysubs2 | |
from optparse import OptionParser | |
from charset_normalizer import detect | |
def main(): | |
# parse the options | |
parser = OptionParser("python %prog [options] --shift 2s FILE.srt") | |
parser.add_option("-s", "--shift", dest="shift", type=int, | |
help="shift the subtitle time forward.") | |
# check the options values |
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
find . -wholename '*venv/bin/activate' | awk -F'bin' '{print $1}' | xargs -I '{}' rm -r '{}' |
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
find . -size +1M | xargs -I '{}' ls -sh '{}' | sort -h -k1rn |
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
from yt_dlp import YoutubeDL | |
from pandas import DataFrame | |
def extract_info(urls : list): | |
# check parameter type | |
if type(urls) == str: | |
urls = [urls] | |
# extract info | |
data = [] | |
with YoutubeDL({'ignoreerrors':True}) as ytdl: |
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 itertools | |
# index 1 and 2 always will be one, but the index 1 and 3 will be different (zero or one) | |
data = [ ['0', '1'], ['1'], ['1'], ['0', '1'] ] | |
a = itertools.product(*data) | |
print(list(a)) |
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
# Regular Colors | |
Black='\033[0;30m' # Black | |
Red='\033[0;31m' # Red | |
Green='\033[0;32m' # Green | |
Yellow='\033[0;33m' # Yellow | |
Blue='\033[0;34m' # Blue | |
Purple='\033[0;35m' # Purple | |
Cyan='\033[0;36m' # Cyan | |
White='\033[0;37m' # White | |
NC='\033[0m' # No Color]' |