Skip to content

Instantly share code, notes, and snippets.

@m0ntyG
m0ntyG / smstools3.md
Last active January 24, 2022 18:35 — forked from rez0n/smstools3.md
Linux smstools eventhandel for forward sms to telegram (adapted to Cyrillic alphabet)
sudo apt-get update
sudo apt-get install smstools curl

sudo nano /usr/local/bin/pushsms

#!/bin/bash
@m0ntyG
m0ntyG / bash_strict_mode.md
Created December 20, 2021 11:16 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@m0ntyG
m0ntyG / retry.sh
Created December 8, 2021 11:16 — forked from felipou/retry.sh
Retry command
#!/bin/bash
#
# Created by Felipe Machado - 2016/02/14
#
# A retry command for bash
# Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME
# between each retry. Just put it on your bash_profile and be happy :)
# Usage:
# retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS
#
@m0ntyG
m0ntyG / compress_videos.py
Last active December 7, 2021 19:40 — forked from asdfgeoff/compress_videos.py
Bulk compress phone videos using H.265 HEVC encoding 🔥 More info: https://geoffruddock.com/bulk-compress-videos-x265-with-ffmpeg/
import click
from pathlib import Path
from subprocess import call, check_output
from tqdm import tqdm
@click.command()
@click.argument('directory', type=click.Path(exists=True))
@click.option('--recursive', is_flag=True, help='Recursive')
@click.option('--file-ext', help='File format to process')
def main(directory, file_ext='mp4', recursive=False):
@m0ntyG
m0ntyG / tmux.conf
Last active December 12, 2021 18:37
# Prefix Key
# Default: C-b
# C-b is inconvenient to reach on the keyboard and also vim uses it.
# Download via wget https://gist.github.com/andrestaffe/d6c8acd9a79b0b86d64e85106b485b42/raw/969ecbd0759a6786a9564a828c333a41f8eb4be3/tmux.conf -O .tmux.conf
# This frees the key for other functions
unbind-key C-b
# C-y is very convenient to reach on a german keyboard, YMMV.
# I don't like to use C-a because it's a readline binding to go to the
@m0ntyG
m0ntyG / readme.md
Created September 6, 2021 18:36 — forked from ShannonScott/readme.md
[Transcode h265] Use ffmpeg to transcode a video to h.265 / hvc1 which will play natively on a Mac (and Linux). #tags: video, python, ffmpeg
@m0ntyG
m0ntyG / compile-ffmpeg-nvenc.sh
Created September 6, 2021 12:04 — forked from ransagy/compile-ffmpeg-nvenc.sh
Script to build a static FFMpeg binary with NVENC support
#!/bin/bash
# This script will compile and install a static ffmpeg build with support for nvenc in ubuntu.
# See the prefix path and compile options if edits are needed to suit your needs.
# NOTE: This build is made to target Ubunutu 16.04 Data-Science Azure VMs - With nVidia 418.xx drivers and CUDA SDK 9.0.
# It also relies on a hack described in https://trac.ffmpeg.org/ticket/6431#comment:7 to make glibc dynamic still.
# Long story short, you need to edit your ffmepg's configure script to avoid failures on libm and libdl.
# in function probe_cc, replace the _flags_filter line to: _flags_filter='filter_out -lm|-ldl'
@m0ntyG
m0ntyG / README.md
Created September 3, 2021 10:15 — forked from mikoim/README.md
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@m0ntyG
m0ntyG / python_png2jpg_givenfolder
Last active June 19, 2020 08:18
Script to convert PNG files to JPG files for a given folder (arg).
import os, sys, glob
from PIL import Image
# define path from input
path = os.path.normpath(sys.argv[1])
# loop fir given path and PNG files
for infile in glob.glob(os.path.join(path, "*.png")):
file, ext = os.path.splitext(infile)
# define JPG as output