Skip to content

Instantly share code, notes, and snippets.

View kulvind3r's full-sized avatar

Kulvinder Singh kulvind3r

View GitHub Profile
@kulvind3r
kulvind3r / what_next.sh
Created June 13, 2021 18:15
Script that randomly suggest something to do from your favourites. Useful for those slow days when you are bored to death and have no idea what to do with your life.
#!/bin/bash
set -e
SCRIPT=$0
ARG=$1
ACTIVITIES_FILE=~/what_next_activities.json
# Colors
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
@kulvind3r
kulvind3r / certify.md
Last active August 26, 2021 14:08
Quick reference guide for setting up well generated self-signed / trusted certificates for your internal https connection requirements

SSL Certs Cheatsheet

A quick guide to do all things certificate related.

1. Self signed certificate and private key

Ready to use self signed certificate with SAN extensions.

openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
-keyout app.domain.com.key -out app.domain.com.cer \

-subj /C=IN/ST=MH/L=PUN/O=TW/OU=IT/CN=app.domain.com \

@kulvind3r
kulvind3r / keepass.md
Last active April 8, 2019 08:12
Why use KeePass and How?

KeePass - Password Manager for Masses

Conventional wisdom recommends using a unique, randomized, long password for each set of credentials you setup for your use. It increases security and prevents loss of multiple accounts if any one account gets hacked thereby leaking your creds.

Conventional wisdom fails to say anything about remembering these unique long hieroglyphs. How very convinient for conventional wisdom.

The solution to this problem, like every other problem is to make it someone else's problem. In this scenario, a password manager's.

A password manager is a software that does the job of generating such unique randomized passwords for you, storing them and giving them to you when you need them, like an obedient lackey. In return all you have to do is to remember the one password for the Password Manager.

@kulvind3r
kulvind3r / git_version.sh
Created August 7, 2018 15:53
Instead of using <build_number>, version build artefacts using git tags. Maintain history and remove dependency on your CI server.
#!/bin/bash
set -e
SCRIPT=$0
ARG=$1
BASE_VERSION="0.1"
validation_error() {
echo "Not inside a git repo. Exiting."
@kulvind3r
kulvind3r / git_multi.sh
Last active July 13, 2020 13:49
Minimalist git multi script. Make alias 'gm' to script, use as "gm <git_command>" to run command across multiple checked out git repos.
#!/bin/bash
set -e
ARG="$1"
WORK_DIR=$(pwd)
run() {
for DIR in $(find $WORK_DIR/ -maxdepth 1 -type d)
do
cd "${DIR}"
@kulvind3r
kulvind3r / crypt.sh
Last active November 7, 2022 05:23
A bare bones en/decryption script based on aes-256-cbc algo. Handy to store file based secrets securely.
#!/bin/bash
set -e
SCRIPT_NAME=$0
OPT=$1
FILES_PATH=$2
PASSPHRASE=$3
usage() {
echo -n "${SCRIPT_NAME} [OPTIONS] [FILE_PATH] [PASSPHRASE]