My MongoDB scratchpad

Importing bulk json files using mongoimport: A bash script is needed for doing this. An example bash script: FILES=/Users/arefindk/datasets/gitnet/* for f in $FILES do echo "Importing file $f..." mongoimport --db github_watch --collection gt_watch --file $f echo "Done $f" done Bulk convert a string field…

My Mac Homebrew scratchpad

Homebrew is a command-line package manager for Mac that gives the users similar advantages of using "pacman" in Arch-Linux or "apt-get" in Ubuntu or "yum" in Redhat Linux. Installing homebrew in mac is easy: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Source: brew.sh Now…

My Unix Command ScratchPad

Copying public key from local machine to a remote host: Use the ssh-copy-id tool to do this. To install this tool in Mac use brew install ssh-copy-id. ssh-copy-id user@hostname It will prompt for the user's password. After giving the password it will automatically add your local machine's publicy-key to…