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
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
def get_video_info(file_path): | |
"""Retrieve codec and bitrate information for a video file using ffprobe.""" | |
cmd = [ | |
"ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries", | |
"stream=codec_name,bit_rate", "-of", "default=noprint_wrappers=1:nokey=1", file_path |
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
#!/usr/bin/env bash | |
# Check if argument provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 /path/to/media" | |
exit 1 | |
fi | |
BASE_DIR="$1" |
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
REM You need to change the DPI settings to "Use the DPI that's set for my main display when: I open this program" for this trick to work. | |
@ECHO OFF | |
explorer ms-settings:display | |
ping -n 2 127.0.0.1 > nul | |
:VBSDynamicBuild | |
SET TempVBSFile=%tmp%\~tmpSendKeysTemp.vbs | |
IF EXIST "%TempVBSFile%" DEL /F /Q "%TempVBSFile%" |
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 | |
# Function to convert bytes to human-readable format | |
to_human_readable() { | |
local size=$1 | |
if [ $size -lt 1024 ]; then | |
echo "${size}B" | |
elif [ $size -lt $((1024*1024)) ]; then | |
echo "$((size/1024))KB" | |
elif [ $size -lt $((1024*1024*1024)) ]; then |
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
{ | |
"global": { | |
"ask_for_confirmation_before_quitting": true, | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false, | |
"unsafe_ui": false | |
}, | |
"profiles": [ | |
{ |
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
$username=( ( Get-WMIObject -class Win32_ComputerSystem | Select-Object -ExpandProperty username ) -split '\\' )[1] | |
$newPath = "D:\$($username)" | |
$key1 = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" | |
$key2 = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" | |
set-ItemProperty -path $key1 -name Desktop "$($newPath)\Desktop" | |
set-ItemProperty -path $key2 -name Desktop "$($newPath)\Desktop" | |
set-ItemProperty -path $key1 -name Pictures "$($newPath)\Pictures" | |
set-ItemProperty -path $key2 -name Pictures "$($newPath)\Pictures" | |
set-ItemProperty -path $key1 -name "My Pictures" "$($newPath)\Pictures" | |
set-ItemProperty -path $key2 -name "My Pictures" "$($newPath)\Pictures" |
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 | |
#Usage bash <(curl -Ls https://gist.githubusercontent.com/maciekish/dc1f9372916eacf06efe10aa6e9469cd/raw) | |
if [ `whoami` != 'root' ] | |
then | |
echo "You must be root to do this." | |
exit | |
fi | |
if [ -z "$1" ] |
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
;TOOL 0 START | |
M109 S{material_print_temperature} T0; Set active extruder to T0 Temperature and wait for it to reach temperature before proceeding. | |
G1 E10 F500 ; Prime 10mm, | |
G92 E0 ; Reset Extruder to 0, | |
G1 E-0.5 F500 ; Retract 3.5mm, | |
; Wipe nozzle | |
G1 X0 F5000 | |
G1 X-40 | |
G1 X0 | |
G1 X-40 |
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
pkg=${pkg/\/share/""}#!/bin/bash | |
# crontab -e as admin on Qnap. | |
# https://gist.github.com/maciekish/a6e3dc65523c2b25ff312b8f7689fd1c/ | |
pkg=$(find /share/Media/plexmediaserver* | head -n 1) | |
localpkg=${pkg/\/share/""} | |
docker=$(which docker) | |
if [ -f "$pkg" ] | |
then |
NewerOlder