Skip to content

Instantly share code, notes, and snippets.

View garoto's full-sized avatar
💭
All I wanted was an Atari 2600

garoto

💭
All I wanted was an Atari 2600
View GitHub Profile
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@garoto
garoto / disable-defender.bat
Created May 17, 2023 12:41 — forked from tranphuquy19/disable-defender.bat
Disable Windows Defender scripts
@echo off
rem A modified version of the disable defender script from: https://pastebin.com/kYCVzZPz
@echo on
rem ==========================================
rem This section will Disable Windows Defender
rem You can ignore error messages
rem 1 - Disable Real-time protection
reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@garoto
garoto / ffmpeg-hevc-encode-nvenc.md
Created July 10, 2017 17:15
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile>  \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_hq \

@garoto
garoto / mpvhistory.lua
Last active April 6, 2024 11:53
Simple media logger Lua script for mpv
-- Not my code: originally from https://redd.it/3t6s7k (author deleted; failed to ask for permission).
-- Only tested on Windows. Date is set to dd/mmm/yy and time to machine-wide format.
-- Save as "mpvhistory.lua" in your mpv scripts dir. Log will be saved to mpv default config directory.
-- Make sure to leave a comment if you make any improvements/changes to the script!
local HISTFILE = (os.getenv('APPDATA') or os.getenv('HOME')..'/.config')..'/mpv/mpvhistory.log';
mp.register_event('file-loaded', function()
local title, logfile;