Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am maxfi on github.
* I am maxfi (https://keybase.io/maxfi) on keybase.
* I have a public key whose fingerprint is 8398 19E7 FB17 C772 16BC E44A A51A 088C 8FCF DA1F
To claim this, I am signing this object:
@maxfi
maxfi / resin_create_env_add.sh
Created February 1, 2016 13:07
Migrate environment variables from one resin.io project to another project
#!/bin/bash
# Creates script output
# $1 = app to get ENVs from
# $2 = app to set ENVs to
resin envs --application $1 | tail -n +2 | sed 's/^[0-9]* //gm' | sed "s/ \+/ '/gm" | sed "s/$/'/m" | sed 's/^/resin env add /m' | sed "s/$/ --application $2/m"
#!/bin/bash
# Install and configure docker.
# Based on https://docs.docker.com/engine/installation/linux/ubuntulinux/.
# ------------------------------------------------------------------------
# ------------------
# Script setup
# ------------------
@maxfi
maxfi / gnome-terminal-fullscreen.desktop
Created February 13, 2016 09:41
Start gnome terminal in fullscreen
[Desktop Entry]
Name=iTerm
Comment=Use the command line
TryExec=gnome-terminal
Exec=gnome-terminal --full-screen
Icon=utilities-terminal
Type=Application
X-GNOME-DocPath=gnome-terminal/index.html
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-terminal
@maxfi
maxfi / install-tools.sh
Last active February 21, 2019 10:46
Setup new c9 workspace
#!/bin/bash
# SNIPPET REFERENCE
# -----------------
# https://cloud9-sdk.readme.io/docs/snippets
# https://community.c9.io/t/snippets-not-working-in-c9/19215
# https://github.com/ajaxorg/ace/blob/master/lib/ace/snippets/javascript.snippets
# Update NVM
wget https://gist.githubusercontent.com/maxfi/f04d8101d73d9f1e2d19f3ca66f05b73/raw/3b093865c0aa36d7198e77ae6748ac648e9965ca/install-latest-nvm.sh
@maxfi
maxfi / install-latest-mongo-tools-and-shell.sh
Last active June 10, 2018 19:15
Install latest MongoDB tools and shell
#!/bin/bash
### DEPRECATED!!!! Refer to https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
### ALSO REMOVE NPM PACKAGE `mongo-hacker` AS IT BREAKS STUFF!!!
exit
# ------------------
# Script setup
# ------------------
@maxfi
maxfi / install-git-crypt.sh
Last active May 16, 2016 11:26
Install git-crypt and references
#!/bin/bash
# REFERENCES:
# - https://github.com/AGWA/git-crypt
# - http://manpages.ubuntu.com/manpages/wily/man1/git-crypt.1.html
# - https://flatlinesecurity.com/posts/git-crypted/
# - http://ebarnouflant.com/posts/3-using-git-crypt-to-transparently-encrypt-sensitive-data-in-a-git-repository
# - http://www.seanh.cc/posts/git-crypt
# - http://blog.it-agenten.com/2015/10/tool-of-the-week-git-crypt/
# - https://www.coveros.com/git-crypt/
@maxfi
maxfi / shippable-docker-image-how-to.md
Last active August 26, 2016 22:11
Build docker image only on Shippable

From: Shippable/support#2624

build:
  ci:
    - pwd 
  post_ci:
    - docker commit web eu.gcr.io/........
    - docker push eu.gcr.io/........
@maxfi
maxfi / install-latest-nvm.sh
Last active November 20, 2017 06:17
[Install latest version of NVM]
echo "===> Current node version: $(node --version)"
echo "===> Current npm version: $(npm --version)"
echo "===> Installing/updating to latest version of NVM"
LATEST_NVM_VERSION=$(curl -s https://api.github.com/repos/creationix/nvm/releases/latest | grep '"tag_name":' | cut -d '"' -f 4)
curl -o- https://raw.githubusercontent.com/creationix/nvm/$LATEST_NVM_VERSION/install.sh | bash
# Enable NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm