Skip to content

Instantly share code, notes, and snippets.

View pharsi's full-sized avatar

Faris Khan pharsi

View GitHub Profile
version: "3"
services:
backend:
image: frappe/erpnext:v14
platform: linux/amd64
deploy:
restart_policy:
condition: on-failure
volumes:
import sys
import json
import boto3
from botocore.config import Config
# ec2 = boto3.client('ec2')
my_config = Config(
region_name='us-east-1',
@pharsi
pharsi / gist:57d34b1c2a325be36d269231f74b30fb
Created November 3, 2023 06:02
Rewrite git history and change Authors or Co-authored by
git filter-branch --env-filter '
export GIT_COMMITTER_NAME="New committer name"
export GIT_COMMITTER_EMAIL="New committer email"
export GIT_AUTHOR_NAME="New committer name"
export GIT_AUTHOR_EMAIL="New committer email"
' -- --all
# Change 'New committer name' and 'New committer email' then run the command above to fix commit messages
@pharsi
pharsi / gist:2169842e3d16f2b37b37397afae587b5
Created July 8, 2023 15:55
List and sort directories by size on disk
du -sk * | sort -rg | awk '{ numBytes = $1 * 1024; numUnits = split("B K M G T P", unit); num = numBytes; iUnit = 0; while(num >= 1024 && iUnit + 1 < numUnits) { num = num / 1024; iUnit++; } $1 = sprintf( ((num == 0) ? "%6d%s " : "%6.1f%s "), num, unit[iUnit + 1]); print $0; }'
# Thanks to answer here at https://unix.stackexchange.com/questions/4681/how-do-you-sort-du-output-by-size