Skip to content

Instantly share code, notes, and snippets.

Avatar
🍭
ONCE

Calvin Bui calvinbui

🍭
ONCE
View GitHub Profile
@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 Aug 26, 2020
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
@calvinbui
calvinbui / MK3 Slic3r PLA Start GCode
Last active Mar 3, 2018
To prevent filament oozing around the printbed
View MK3 Slic3r PLA Start GCode
M115 U3.1.1-RC4 ; tell printer latest fw version
M83 ; extruder relative mode
M140 S[first_layer_bed_temperature] ; set bed temp
M104 S170 ; set extruder temp to 170
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S170 ; wait for extruder temp
G28 W ; home all without mesh bed level
M104 S[first_layer_temperature] ; set extruder to print temp
G80 ; mesh bed leveling ie 9 points
M109 S[first_layer_temperature] ; Heat extruder to print temp and wait
View mpv.conf
###########
# General #
###########
save-position-on-quit
keep-open
#######
# OSD #
#######
title='${path}'
@calvinbui
calvinbui / windows-bindings.json
Created Nov 13, 2017
Karabiner Elements Home and End Key except for iTerm2, VIM and Microsoft
View windows-bindings.json
{
"title": "Windows keys",
"rules": [{
"description": "home/end except for iterm2/vim/outlook",
"manipulators": [{
"type": "basic",
"from": {
"key_code": "end"
},
"to": [{
@calvinbui
calvinbui / Remove All User Folders From This PC 64-bit.reg
Created Nov 2, 2017
Remove All User Folders From This PC 64-bit
View Remove All User Folders From This PC 64-bit.reg
Windows Registry Editor Version 5.00
; Remove Desktop From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
; Remove Documents From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}]
You can’t perform that action at this time.