Skip to content

Instantly share code, notes, and snippets.

View samuelbezerrab's full-sized avatar

Samuel Bezerra samuelbezerrab

View GitHub Profile
@samuelbezerrab
samuelbezerrab / git-checkout-all-branches.sh
Created March 22, 2024 12:58
Checkout all git remote branches
#!/bin/bash
for branch in `git branch -r | grep -v HEAD`;do
git checkout -b $branch $branch
done
@samuelbezerrab
samuelbezerrab / git-repo-redact.sh
Created March 15, 2024 16:48
Remove commit and repo metadata
#!/bin/bash
COMMIT_AUHTOR_NAME='Your name'
COMMIT_AUTHOR_EMAIL='Your e-mail'
COMMIT_DATE_TODAY=$(date '+%Y-%m-%d')" 00:00:00"
# Change commits author and date
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='$COMMIT_AUHTOR_NAME'
GIT_AUTHOR_EMAIL='$COMMIT_AUTHOR_EMAIL'
GIT_COMMITTER_NAME='$COMMIT_AUHTOR_NAME'
version: '3'
services:
speedtest:
container_name: speedtest-tracker
image: henrywhitaker3/speedtest-tracker:latest
restart: unless-stopped
ports:
- 8765:80
volumes:
- ./config:/config
@samuelbezerrab
samuelbezerrab / gist:48b8e8d79a19c5eb5c8c974be2b6cb7b
Created November 10, 2023 15:03
Resize iPhone screenshots to 5.5 inches
for f in *;
do
ffmpeg -i ${f} -vf "scale=1242:-1, crop=1242:2208:0:0" "iphone5,5-resized-${f}";
done;
@samuelbezerrab
samuelbezerrab / run.sh
Last active June 13, 2023 14:04
Install docker on proxmox ct
#!/bin/bash
apt update && apt upgrade -y
apt install ca-certificates gnupg -y
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
@samuelbezerrab
samuelbezerrab / run.sh
Created October 4, 2022 14:07
Enable remote screenshare on macOS
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers
# Later restart the computer
@samuelbezerrab
samuelbezerrab / Apple_mobile_device_types.txt
Created September 21, 2022 15:42 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@samuelbezerrab
samuelbezerrab / aab_to_apk.sh
Created July 1, 2022 17:46
Get APKs from AAB file
# install bundletool, read more at https://developer.android.com/studio/command-line/bundletool
brew install bundletool
# extract apks file from aab. If bundle is signed, specify the keystore attributes as well. If the bundle is not signed, you can add universal model, change the output to .zip, & use universal.apk
bundletool build-apks --bundle=bundle.aab --output=output.apks --ks=key.jks --ks-pass=pass:password --ks-key-alias=password --key-pass=pass:password
# install the apks file to your device
bundletool install-apks —apks=output.apks
# extract the path of your package name
@samuelbezerrab
samuelbezerrab / pull_apk.md
Created August 6, 2021 21:07 — forked from oozzal/pull_apk.md
Pull Apk from device
  1. Determine the package name of the app, e.g. "com.example.someapp". Skip this step if you already know the package name.

adb shell pm list packages

Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

  1. Get the full path name of the APK file for the desired package.
@samuelbezerrab
samuelbezerrab / WatermelonProvider.tsx
Created April 23, 2021 19:42 — forked from sidferreira/WatermelonProvider.js
WatermelonDB preloaded db
import React, { ReactChild } from 'react';
import { Database } from '@nozbe/watermelondb';
import { getWatermelon } from 'app/utils/DBWatermelonOld/DBWatermelonOld';
import DatabaseProvider from '@nozbe/watermelondb/DatabaseProvider';
const WatermelonProvider: React.ComponentType<{
children?: ReactChild;
}> = (props) => {
const watermelonRef = React.useRef<Promise<Database>>();
const [database, setDatabase] = React.useState<Database>();