Skip to content

Instantly share code, notes, and snippets.


Calvin Bui calvinbui

View GitHub Profile
View gist:f6f59d2a8fd7e79cd1647da65d7ee497
View PS5.ps1
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$obsFolder = "C:\Program Files\obs-studio"
$windowedBorderlessFolder = "D:\Windowed Borderless"
#!/usr/bin/env python3
import argparse
import redis
def connect(conn_dict, tls):
return redis.Redis(
calvinbui /
Created Aug 5, 2019
Ungoogled Chromium Extension Updater
#!/usr/bin/env bash
# Downloads Chrome extensions
# dependencies:
# npm install -g chrome-web-store-item-property-cli
# brew install jq
# brew install curl
set -e
while getopts ":f" arg; do
calvinbui /
Created Apr 13, 2019 — forked from freyta/
Patching the 7Eleven 1.7.1 APK for mock location, root and "foreign APK" installation

Required files: jadx -> APK Easy Tool to easily decompile/recompile the APK -> 7 Eleven Fuel App APK ripped off your phone or download from here -> A Google Maps API key ->

I'll be explaining how to remove the mock location check and allow root access for version 1.7.1 in this little guide.

Step 1 - Install the downloaded APK onto your phone and open it up. What happens? It closes straight away. Bugger! Lets take a look at our code and see what could be causing that.

#!/usr/bin/env python
"""Removes old backups keeping only the newest specified amount"""
import argparse
import glob
import os
import shutil
PARSER = argparse.ArgumentParser(description="Delete old backups")
PARSER.add_argument("-p", "--path", required=True, type=str, help="path where backups are stored")
PARSER.add_argument("-r", "--regex", required=True, type=str, help="pattern of backup folders to match")
calvinbui /
Last active Nov 8, 2021
FreeNAS Replication Details
FreeNAS Replication status
import os
import time
import sys
from datetime import datetime, timedelta
def bytes_to_gb(filesize):
return filesize / 1024 / 1024 / 1024
calvinbui / mp4-to-webm.ps1
Created Jul 11, 2018
High quality MP4 to WebM
View mp4-to-webm.ps1
$Dir = get-childitem . | where {$_.extension -eq ".mp4"}
Foreach ($file in $Dir){
$output = $file | % {$_.BaseName}
$input = $file
.\ffmpeg.exe -i "$input" -an -c:v libvpx -pix_fmt yuv420p -threads 4 -slices 8 -lag-in-frames 16 -auto-alt-ref 1 -ac 2 -c:a libvorbis -qmin 17 -crf 17 -qmax 17 -qcomp 1 -b:v 0 -qscale:a 10 -pass 1 -passlogfile "C:\Users\Calvin\AppData\Local\Temp\75b67ed3-075e-4eb7-b783-41b40406e7c4" -f webm -y "NUL"
.\ffmpeg.exe -i "$input" -c:v libvpx -pix_fmt yuv420p -threads 4 -slices 8 -lag-in-frames 16 -auto-alt-ref 1 -ac 2 -c:a libvorbis -qmin 17 -crf 17 -qmax 17 -qcomp 1 -b:v 0 -qscale:a 10 -pass 2 -passlogfile "C:\Users\Calvin\AppData\Local\Temp\75b67ed3-075e-4eb7-b783-41b40406e7c4" -f webm -y "$output.webm"