Skip to content

Instantly share code, notes, and snippets.

View flatlinebb's full-sized avatar
🏠
Working from home

flatlinebb

🏠
Working from home
View GitHub Profile
@flatlinebb
flatlinebb / extract-audio.bat
Last active March 31, 2024 05:33
How to extract audio from video with ffmpeg, into separate files
REM This script will check all MP4 files in the current folder
REM and process them to extract audio into separate files (M4A).
REM The audio files use the same file name as the original video file, with a number, and the M4A extension
REM This is a batch file, to be run on Windows, in Command Line.
REM For Linux, see the "extract-audio.sh" gist below
REM In this example, there are 2 audio tracks, which get split out to 2 separate audio files.
REM The original video file remains unchanged.
REM If you want have a video file with more than 2 audio tracks,
REM just add more "-map 0:a:0 -c copy "%~na audio track 1.m4a"" sections:
REM -map 0:a:0 -c copy "%~na audio track 1.m4a"
@flatlinebb
flatlinebb / .bashrc
Last active March 15, 2024 01:03
bash.rc login info
# Display some useful info at login
echo
# Display your IP hostname & IP addresses
#echo
echo " -------------------------------------------------------------------"
echo " Hostname: `hostname`"
#echo " Your IPv4 Address: `ifconfig | grep 'inet addr:' | grep -v 127.0.0.1 | grep -v 10.32. | grep -v 192.168. | cut -d: -f2 | cut -d' ' -f1`"
echo " Your IPv4 Address: `ip a | grep eth0 | grep inet | cut -d' ' -f8`"
echo " Your IPv6 Address: `ip a | grep inet6 | grep global | cut -d' ' -f6`"
echo
@flatlinebb
flatlinebb / mpv keyboard shortcuts
Last active January 6, 2024 09:38
mpv keyboard shortcuts
Keyboard Control
LEFT and RIGHT
Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek (see --hr-seek).
UP and DOWN
Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see --hr-seek).
Ctrl+LEFT and Ctrl+RIGHT
Seek to the previous/next subtitle. Subject to some restrictions and might not always work; see sub-seek command.
Ctrl+Shift+Left and Ctrl+Shift+Right
Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio.
[ and ]
@flatlinebb
flatlinebb / RemoveWebroot.ps1
Created January 9, 2023 18:00 — forked from mark05e/RemoveWebroot.ps1
PowerShell script to forcefully remove Webroot SecureAnywhere. It is recommended to run the script twice, with a reboot after the first run.
# Removes Webroot SecureAnywhere by force
# Run the script once, reboot, then run again
# Webroot SecureAnywhere registry keys
$RegKeys = @(
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\WRData",
"HKLM:\SOFTWARE\WOW6432Node\WRCore",
"HKLM:\SOFTWARE\WOW6432Node\WRMIDData",
All the various ways to obtain the WAN IP of a Windows or Linux computer:
curl ifconfig.me
(curl ifconfig.me).Content
wget -qO- http://ipecho.net/plain | xargs echo
host myip.opendns.com resolver1.opendns.com
dig +short myip.opendns.com @resolver1.opendns.com.
dig +short txt ch whoami.cloudflare @1.0.0.1
nslookup myip.opendns.com. resolver1.opendns.com
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content
@flatlinebb
flatlinebb / psftp automate sftp file transfers
Last active March 17, 2022 16:50 — forked from countnazgul/psftp_automate_sftp_server.bat
Using psftp to automate tasks from batch file to sftp server
psftp username@sftp.server.com -pw password -noagent -4 -batch -be -b commands.txt > log_file_%date:~10,4%-%date:~7,2%-%date:~4,2%-%time:~0,2%%time:~3,2%%time:~6,2%.txt 2>&1
# log_file_%date:~10,4%-%date:~7,2%-%date:~4,2%-%time:~0,2%%time:~3,2%%time:~6,2%.txt = log file with a timestamp
# -pw = password
# -4 = use IPv4
# -batch = disable all interactive prompts
# -be = don't stop batchfile processing if errors
# -b filename = use specified batchfile
# -noagent = disable use of Pageant
# -bc = output batchfile commands
@flatlinebb
flatlinebb / mpv_links.txt
Last active December 6, 2021 22:59
YouTube Playlist Links for MPV Player
@flatlinebb
flatlinebb / send_clipboard_as_keystrokes.ahk
Created November 22, 2019 23:35
Autohotkey script: Send Clipbpoard As Keystokes
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetWinDelay 100
SetKeyDelay 7
;; Alt+Control+k
^!k::
SendEvent,{Raw}%Clipboard%
@flatlinebb
flatlinebb / Set User Password to Never Expire
Created November 27, 2019 03:01
Set user password to never expire in command line
Password never expire for a specific user using command-line
Open command-prompt with administrative privileges and run the following command sequence:
Get the name of users currently active on the system using this command: net accounts
Run the following command:
wmic useraccount where �Name=�itechticsuser'� set PasswordExpires=false
Replace �itechticsuser� with the name of user you want to configure.
@flatlinebb
flatlinebb / wget-recursive.txt
Created March 13, 2019 16:09
There is no better utility than wget to recursively download interesting files from the depths of the internet. I will show you why that is the case. From: https://blog.sleeplessbeastie.eu/2017/02/06/how-to-download-files-recursively/
Simply download files recursively. Note, that default maximum depth is set to 5.
$ wget --recursive https://example.org/open-directory/
Download files recursively using defined maximum recursion depth level. It is important to remember that level 0 is equivalent to inf infinite recursion.
$ wget --recursive --level 1 https://example.org/files/presentation/
Download files recursively and specify directory prefix. If not specified then by default files are stored in the current directory.