Skip to content

Instantly share code, notes, and snippets.

View shivanshs9's full-sized avatar
🔥
Unlimited Code Works! ⚔️

Shivansh Saini shivanshs9

🔥
Unlimited Code Works! ⚔️
View GitHub Profile
{
"description": "TheFaker NFT minted for DCX training",
"external_url": "https://shivanshs9.me",
"image": "https://avatars.githubusercontent.com/u/8217199?v=4",
"name": "TheFaker",
"attributes": []
}
@shivanshs9
shivanshs9 / gh_migrate_init.sh
Created September 1, 2023 10:31
Bitbucket to Github migration
#!/bin/bash
# How to use?
## bash gh_migrate_init.sh competition-service
GITHUB_ORG="coindcx-app"
JIRA="IDOPS-153"
SOURCE_FOLDER="coindcx-api-help"
prepare_repo() {
#!/bin/sh
# Assume sudo by default
[ $(id -u) -eq 0 ] || exec sudo $0 $@
for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$PATH:$bin:$bin/aux
done
set -x
@shivanshs9
shivanshs9 / System Design.md
Created February 2, 2021 22:59 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@shivanshs9
shivanshs9 / gist:b321f21bf78cedd660ee94f1d4352eb1
Created September 5, 2020 22:17
Script to simultaneously reassign owner of all tables in a given DB (source: https://stackoverflow.com/a/2686185/2674983)
### Use:
# reassign_owner dbName newOwner oldOwner/root dbHost
reassign_owner() {
db="$1"
newUser="$2"
owner="${3:-$newUser}"
dbHost="$4"
local pw
echo -n "Password: " > /dev/tty
@shivanshs9
shivanshs9 / git-backcommit
Last active July 22, 2020 08:12
Wraps 'git commit' command to override AuthorDate and CommitDate (if date is provided)
#!/usr/bin/env bash
## Copyright 2020 Shivansh Saini<[email protected]>
# Licensed under MIT
usage() {
cat << EOD
Usage: `basename $0` [options] [date] -- [commit args]
name: Keep the versions up-to-date
on:
release:
types: [published, edited]
jobs:
actions-tagger:
runs-on: ubuntu-latest
steps:
- uses: Actions-R-Us/actions-tagger@v2
env:
# Combined workflow to build and create release
## It's an hack until https://git.521000.bestmunity/t/triggering-a-new-workflow-from-another-workflow/16250/24 is solved by Github
---
name: Build and Release
on:
push:
branches:
- master
jobs:
build:
@shivanshs9
shivanshs9 / a2dp.py
Last active June 22, 2020 21:29 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@shivanshs9
shivanshs9 / adb_backup.zsh
Created May 22, 2020 16:07
Backup folders locally via adb
input=()
for path in /sdcard/{"Pictures","Download","DCIM"}; do
input+=$(adb shell "ls -d '$path'")
done
for path in $input; do
adb pull $path &
done