Skip to content

Instantly share code, notes, and snippets.

Emmanuel N Kyeyune emmanuelnk

View GitHub Profile
emmanuelnk / terraform_install_64bit_linux.bash
Created Apr 10, 2019
Install Terraform on 64 bit Linux
View terraform_install_64bit_linux.bash
# 0.XX.XX is the terraform version you need
wget -P ~/Downloads/terraform/
cd ~/Downloads/terraform && unzip && cd terraform
sudo mv terraform /usr/local/bin/
nano ~/.bashrc
export PATH="$PATH:/usr/local/bin/terraform"
source ~/.bashrc
# then from anywhere
emmanuelnk / cleanEmpty.js
Created May 13, 2020
Clean js object by recursive removal of undefined, null, NaN and empty strings
View cleanEmpty.js
// A SO answer to
// based off the recursive cleanEmpty function by @chickens.
// This one can also handle Date objects correctly
// and has a defaults list for values you want stripped.
const cleanEmpty = function(obj, defaults = [undefined, null, NaN, '']) {
if (defaults.includes(obj)) return
if (Array.isArray(obj))
return obj
emmanuelnk /
Last active Apr 20, 2020
How to install PyGrib with ECCodes (Python 3.6.5, Ubuntu 18, 16, RHEL)

How to install PyGrib with ECCodes (Python 3.6.5, Ubuntu 19, 18, 16, RHEL, Lambda, Linux AMI, Docker)

[ last_updated: 07-JAN-2020 ]

Recently I've had to work with Meterological data of the GRIB format. Needless to say, if you're reading this, you probably know how hard it is to get a library that can read them and even harder, setting up those libraries. Pygrib for python is by far the best library for reading grib files but the installation can leave you dizzy

In this tutorial I use Ubuntu 18 and python 3.6.5 virtualenv. Note: You don't have to use virtualenv Python. You can just as well use your system Python 3 however I personally find virtualenv a clean way to deal with these kind of complicated setups (prevents me mucking up my system's Python). This setup should also work with lower and higher Ubuntu versions (as someone below mentioned) and other Linux distros (like RHEL - AWS Linux AMI etc). The key to this installation is to build eccodes correctly (for your machine architecture) and succe

emmanuelnk /
Created Apr 17, 2020 — forked from boneskull/
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
emmanuelnk /
Created Apr 8, 2020 — forked from Geoff-Ford/
Eric Elliott's Master the JavaScript Interview Series
emmanuelnk /
Created Apr 8, 2020 — forked from Geoff-Ford/
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

emmanuelnk / script.bash
Created Apr 24, 2019
Installing vscode transparency/blur ubuntu 18.04
View script.bash
sudo apt install i3
# check architecture, get correct compton file
dpkg --print-architecture
# download matching compton .deb file from
# install compton
sudo apt-get install ~/Downloads/compton_0.1_beta2+20150922-1_amd64.deb
# get visual studio code source code repo
emmanuelnk /
Created Feb 14, 2020 — forked from ankurk91/
Useful npm commands and tricks

npm v3.10 -

If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm

⚠️ This gist is outdated, but most of the commands are still relevant.

Update npm itself

npm install -g npm
# Downgrade to a specific version
emmanuelnk / .bashrc
Last active Jan 17, 2020
Installing virtual node environments with nodeenv.
View .bashrc
# start nodeenv virtual env if it exists
# for whenever you open integrated terminal in vscode
if [ -d ".nenv" ]; then
. ".nenv/bin/activate"
emmanuelnk / start_dynamodb_local_docker.bash
Last active Jan 15, 2020
Start Dyanmodb Local docker with sharedDb param to enable dyanmodb-admin and localhost:8000/shell to view tables
View start_dynamodb_local_docker.bash
docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb
You can’t perform that action at this time.