Skip to content

Instantly share code, notes, and snippets.

@S-trace
S-trace / subs.sh
Last active April 4, 2024 11:35
A simple script to beautify and improve readability of .ass subtitles and converting subtitles .srt <=> .ass {\\bord3} - ASS subtitles outline width {\\blur14} - blur ratio (to create smooth transition between movie and subtitles)
#!/usr/bin/env sh
COMMAND=$1
case "$COMMAND" in
ass-outline)
# Add outline to all ASS subtitles in current directory
for file in *.ass; do
echo "$COMMAND: Processing $file"
perl -pe 's/(^Dialogue: ([^{]*?,){9})(?=[^{])/\1\{\\bord3}\{\\blur14}/g' <"$file" >temp
mv temp "$file"
@rbm01
rbm01 / suspend-PC.ps1
Last active July 8, 2021 08:45 — forked from wendelb/logoff.ps1
Suspend your workstation after Idle-Timeout with PowerShell
#
# This background job automatically suspends your Workstation after a specified amount of
# time. It will come in handy if Windows sleep feature seems to go AWOL.
#
# start with
# powershell.exe -windowstyle hidden -executionpolicy Unrestricted P:\ATH\TO\logoff.ps1
#
# `-windowstyle hidden` will make your PowerShell disappear/run in background
# `-executionpolicy Unrestricted` will enable this PowerShell process to allow non-signed scripts
#
@shitalm
shitalm / queryselector.js
Created August 20, 2020 08:27
querySelectorAll with regex support
/**
* querySelectorAll with regex support.
* TS version: https://gist.github.com/sagirk/3240407ebbc9369356759a806b66fe34.
*
* Note: In the `attributeToSearch` parameter's absence, all attributes on all
* DOM nodes will be searched. This can get quite expensive for large DOM trees.
*
* Usage example:
* `querySelectorAllRegex(/someregex/, 'target-specific-attribute-if-needed');`
*
@sagirk
sagirk / querySelectorAllRegex.ts
Last active March 10, 2022 00:01
`querySelectorAll` with regex support
/**
* querySelectorAll with regex support.
* Adapted from: https://stackoverflow.com/a/62144522.
*
* Note: In the `attributeToSearch` parameter's absence, all attributes on all
* DOM nodes will be searched. This can get quite expensive for large DOM trees.
*
* Usage example:
* `querySelectorAllRegex(/someregex/, 'target-specific-attribute-if-needed');`
*
@ximeg
ximeg / .bashrc-parallel-ffmpeg-video-tools.sh
Last active June 17, 2022 05:04
.bashrc parallel ffmpeg video tools
# Video encoding. Arguments to ffmpeg should be passed in quotes
# Example
# ls *.avi | ff_avi2webm "-filter:v 'crop=in_w-100:in_h/2'"
ff_any2webm(){
parallel ffmpeg -i {} $1 -c:v vp9 {.}.webm
}
ff_whatsapp(){
# Convert specified videos to mp4 that are compatible with whatsapp
@tuan
tuan / openvpn-azure-steps.md
Last active December 27, 2021 16:25
OpenVPN + Pihole on Azure

Create VM

  1. Azure > Marketplace > Ubuntu

Configure VM

  1. Autoshutdown Disabled
  2. Networking: Add inbound rule for port 1194 (TCP and UDP)

Install OpenVPN

wget https://git.io/vpn -O openvpn-install.sh
@rabssm
rabssm / ffmpegtips.txt
Last active June 30, 2023 12:43
ffmpeg tips
# Interpolate video frames for a higher frame rate
ffmpeg -i source.mp4 -filter:v minterpolate -r 25 result.mp4
ffmpeg -i source.mp4 -vf minterpolate=50,tblend=all_mode=average,framestep=2 result.mp4
# Crop a video to the bottom right quarter
ffmpeg -i in.mp4 -filter:v "crop=in_w/2:in_h/2:in_w/2:in_h/2" -c:a copy out.mp4
# Resize a video to half size
ffmpeg -i input.mkv -filter_complex "scale=in_w/2:in_h/2" output.mkv
@cornernote
cornernote / README.md
Last active January 15, 2022 17:18
Logitech G105 Keyboard - Ubuntu 18.04
@scotgabriel
scotgabriel / Windows command line gui access.md
Last active November 11, 2023 14:53
Common windows functions via rundll user32 and control panel

Rundll32 commands

OS: Windows 10/8/7

Add/Remove Programs

  • RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0

Content Advisor

  • RunDll32.exe msrating.dll,RatingSetupUI

Control Panel

@streslab
streslab / Headless_Ethereum_Ubuntu_16.04.md
Last active April 4, 2022 23:45
Headless NVIDIA overclock setup under Ubuntu Server 16.04 for ethereum mining

Headless Ethereum Miner Setup - NVIDIA

Reed Slaby, March 2018

Having grown tired of wasting a perfectly good monitor on my ethereum mining rig, I finally decided to replace the Ubuntu Desktop 16.04 installation with Ubuntu Server 16.04. Many of the gtutorials available at the time of this writing range from unecessarily complicated to flat-out wrong. This guide is intended to address many of those shortfalls.

Prerequisites

To complete this guide, you should already have:

  • Basic knowledge of Linux
  • An Ethereum wallet