Skip to content

Instantly share code, notes, and snippets.

Avatar
🍀
flover

Calvin Bui calvinbui

🍀
flover
View GitHub Profile
View gist:f6f59d2a8fd7e79cd1647da65d7ee497
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
View PS5.ps1
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"
View migrate-redis.py
#!/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 Aug 5, 2019
Ungoogled Chromium Extension Updater
View ungoogled_chromium_extension_updater.sh
#!/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 Apr 13, 2019 — forked from freyta/tutorial.md
Patching the 7Eleven 1.7.1 APK for mock location, root and "foreign APK" installation
View tutorial.md

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.

View clean_backups.py
#!/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 Apr 19, 2021
FreeNAS Replication Details
View rpl.py
"""
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 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"
}
View MK3 Simplify3D PLA Start Script
M83 ; extruder relative mode
M104 S170 ; set extruder temp to 170
M140 S[bed1_temperature] ; this will take the layer 1 temperature for bed 0
M190 S[bed1_temperature] ; wait for bed temp
M109 S170 ; wait for extruder temp
G28 W ; home all without mesh bed level
M104 S[extruder0_temperature] T0 ; this will take the layer 1 temperature for extruder 0
G80 ; mesh bed leveling
M109 S[extruder0_temperature] ; Heat extruder to print temp and wait
G1 Y-3.0 F1000.0 ; go outside print area