Skip to content

Instantly share code, notes, and snippets.

Avatar
🌎
Global Citizen

Varun Agrawal VarunAgw

🌎
Global Citizen
View GitHub Profile
@VarunAgw
VarunAgw / yify.md
Created Oct 11, 2020 — forked from kuntau/yify.md
YIFY's Quality Encoding
View yify.md

For those that want to keep the YTS going (No, IDGAF about people that don't care for YTS quality) get HandbrakeCLI https://handbrake.fr/downloads... and use the following settings:

user@user:~$HandBrakeCLI -i /file/input.mp4 -o /file/out.mp4 -E fdk_faac -B 96k -6 stereo -R 44.1 -e x264 -q 27 -x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all

Reason to use CLI over GTK has to do with lack of support for advanced settings for Handbrake GTK

** Don't Re-encode already shitty encodes...get good source!**

@VarunAgw
VarunAgw / code.ahk
Last active Apr 26, 2020
AHK Support for Stardock Groupy
View code.ahk
CoordMode, Mouse, Screen
CoordGetWin(xCoord, yCoord, ExludeWinID="") ; CoordMode must be relative to screen
{
WinGet, IDs, List,,, Program Manager
Loop, %ids%
{
_hWin := ids%A_Index%
WinGetTitle, title, ahk_id %_hWin%
WinGetPos,,, w, h, ahk_id %_hWin%
View win_run.ahk
SetLineEnding(text, line_ending:="`n") {
text := StrReplace(text, "`r`n", "`n")
text := StrReplace(text, "`r", "`n")
if ("`n" != line_ending) {
text := StrReplace(text, "`n", line_ending)
}
return %text%
}
StrCount( ByRef Haystack , Needle = "" ) {
@VarunAgw
VarunAgw / KeyCode.js
Last active Nov 24, 2018
TamperMonkey Scripts
View KeyCode.js
if (typeof KeyCode == "undefined") {
/**
* A fancier way to parse JS keydown events
* Author: Varun Agrawal <Varun@VarunAgw.com>
* Source: https://gist.github.com/VarunAgw/58ab41fd3d48ac51808c76617842dccf#file-keycode-js
* Version: 1.3
* Last Updated: 23-July-2016
*
* @param {object} event: Just forward the event
* @param {array|number} possibleKeyCodes: Use single keycode or an array of codes to match either of them
@VarunAgw
VarunAgw / iptables
Last active Feb 22, 2016
iptables cheatsheet
View iptables
Programs:
iptables
ip6iptables
Type:
INPUT OUTPUT FORWARD
ACCEPT DROP REJECT
-s = Source IP
-d = Destination IP
-sport = Source Port
@VarunAgw
VarunAgw / tldr.sh
Last active Feb 15, 2016
A simple script to cache TLDR Node.JS client output to improve performance
View tldr.sh
Generally each command takes ~500ms, but with this, they will take ~10ms to execute. Add this into shell profile page
function tldr () {
mkdir -p /tmp/tldr_cache
if [ "--flush-cache" == $1 ]; then
rm /tmp/tldr_cache/*
return
fi
@VarunAgw
VarunAgw / Instructions.txt
Last active Apr 13, 2017
How to Install GateOne on Ubuntu 14.04.3
View Instructions.txt
wget https://github.com/downloads/liftoff/GateOne/gateone_1.1-1_all.deb
wget https://github.com/downloads/liftoff/GateOne/python-tornado_2.4-1_all.deb
Note: Don't use "Python-tornado 3.x" with it. It causes some error.
apt-get install python-support
dpkg -i python-tornado_2.4-1_all.deb
dpkg -i gateone_1.1-1_all.deb
service gateone start
@VarunAgw
VarunAgw / Main
Created Jun 4, 2015
Process in background
View Main
Move running process in background
A) Ctrl + Z (It suspends (like pause) process)
B) bg (Its keeps running in background)
Move new process in background
A) sleep 10 & (Print output to terminal whenever it comes)
A) nohup sleep 10 & (Saves output to a file nohup.out)
A) sleep 10> /dev/null & (output is lost)
Move background process to foreground
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
You can’t perform that action at this time.