Skip to content

Instantly share code, notes, and snippets.

View ayushgp's full-sized avatar
😁

Ayush Gupta ayushgp

😁
View GitHub Profile
$ jps
3923 Jps
3188 NodeManager
3061 ResourceManager
3531 NameNode
2894 SecondaryNameNode
2687 DataNode
# Format the namenode
bin/hadoop namenode -format
# Start hadoop related processes
sbin/start-dfs.sh
sbin/start-yarn.sh
# Create input directory and put relavent text file in it
echo "Creating input directory $1 and putting textfile.txt on it."
bin/hadoop fs -mkdir $2
"""
Reads a filegiven as CLI arg, puts a number as prefix on each line
and adds the seperator between the lines.
"""
import sys
file_name = sys.argv[1]
f = open(file_name, 'r', encoding="utf8")
contents = f.readlines()
@ayushgp
ayushgp / hasura-migrate.sh
Last active March 11, 2021 02:45
Take Hasura migrations from one server and apply them to another
# Take Hasura migrations from staging and apply them to prod
# Usage: ./migrate.sh "<staging-endpoint>" "<staging-secret>" "<prod-endpoint>" "<prod-secret>" "<migration-name>"
STAGING_ENDPOINT="$1"
STAGING_SECRET="$2"
PROD_ENDPOINT="$3"
PROD_SECRET="$4"
MIGRATION_NAME="$5"