Skip to content

Instantly share code, notes, and snippets.

View genuinelucifer's full-sized avatar

Abhinav Tripathi genuinelucifer

  • Indore, Madhya Pradesh
View GitHub Profile
@genuinelucifer
genuinelucifer / .bash_aliases
Created September 18, 2019 08:36
Commonly used alias functions. Save it in home directory.
alias ownhome='sudo chown -R ${USER}: ~'
alias glon='git log --oneline -n'
# Checkout branch from origin also track it in new branch for easier push/pull later
alias gct='git fetch origin && git checkout --track'
alias ftext='grep -rnwl --exclude-dir=node_modules'
alias dir_size='du -h --max-depth=1 ./ | sort -h'
alias untargz='tar -xvzf'
alias targz='tar -zcvf'
alias gdob='git branch | egrep -v "(^\*|master|develop)" | xargs git branch -D'
# Replace <acc_num> and <email> in command. Pass mfa token as parameter
@genuinelucifer
genuinelucifer / aws_json_gz_downloader.hpp
Created September 18, 2019 08:47
Downloads a .json.gz file from S3, uncompresses it and converts it to json using nlohmann::json
#pragma once
#include <aws/core/Aws.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/auth/AWSCredentialsProviderChain.h>
#include <aws/core/utils/logging/LogLevel.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/GetObjectRequest.h>
#include <iostream>
#include <fstream>