Skip to content

Instantly share code, notes, and snippets.

View calvinbui's full-sized avatar
🍀
flover

Calvin Bui calvinbui

🍀
flover
View GitHub Profile
@calvinbui
calvinbui / fromis9.gif
Last active November 11, 2022 04:08
fromis9.gif
fromis9.gif
AdGuard
https://adguard.com/en/blog/adguard-dns-announcement.html
94.140.14.140
94.140.14.141
DNSlify
https://www.dnslify.com/services/resolver/
185.235.81.1
185.235.81.2
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
$obsFolder = "C:\Program Files\obs-studio"
$windowedBorderlessFolder = "D:\Windowed Borderless"
@calvinbui
calvinbui / twice-knock-knock.gif
Last active November 11, 2022 04:08
twice-knock-knock.gif
twice-knock-knock.gif
@calvinbui
calvinbui / migrate-redis.py
Created April 23, 2020 02:26
redis migrate
#!/usr/bin/env python3
import argparse
import redis
def connect(conn_dict, tls):
return redis.Redis(
host=conn_dict['host'],
password=conn_dict['password'],
port=conn_dict['port'],
@calvinbui
calvinbui / ungoogled_chromium_extension_updater.sh
Created August 5, 2019 02:41
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
calvinbui / tutorial.md
Created April 13, 2019 03:13 — forked from freyta/tutorial.md
Patching the 7Eleven 1.7.1 APK for mock location, root and "foreign APK" installation

Required files: jadx -> https://github.com/skylot/jadx/releases APK Easy Tool to easily decompile/recompile the APK -> https://forum.xda-developers.com/android/software-hacking/tool-apk-easy-tool-v1-02-windows-gui-t3333960 7 Eleven Fuel App APK ripped off your phone or download from here -> https://apkpure.com/7-eleven-fuel/au.com.fuel7eleven A Google Maps API key -> https://developers.google.com/maps/documentation/android-sdk/signup

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
calvinbui / rpl.py
Last active October 20, 2022 14:04
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
calvinbui / mp4-to-webm.ps1
Created July 11, 2018 13:56
High quality MP4 to WebM
$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"
}