Skip to content

Instantly share code, notes, and snippets.

@84adam
84adam / gist:095beb48f51a41f6f0161b855b3150f2
Created April 14, 2016 03:05
NOTES FROM INTRODUCTION TO IONIC APP DEVELOPMENT - April 13, 2016
NOTES FROM INTRODUCTION TO IONIC APP DEVELOPMENT
April 13, 2016
# babel JS - modern javascript compiler (and tutorials)
https://twitter.com/babeljs
https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/README.md
# Ionic AppCamp
@84adam
84adam / openvpnpia.txt
Last active June 3, 2016 11:38
Install OpenVPN w/ Private Internet Access
Linux Command Line Setup of OpenVPN and Private Internet Access
# source: https://support.privateinternetaccess.com/Knowledgebase/Article/View/30
* Use the following instructions to install OpenVPN via the command line in Linux.
* This set-up has been known to work with several unsupported versions of Linux, as well as the supported Ubuntu.
* This worked on my machine running openSUSE LEAP 42.1.
* You will be prompted to enter your PIA username and password after step 6; have those ready.
1. sudo apt-get install openvpn _OR_ sudo yum ... _OR_ sudo zypper ...
@84adam
84adam / gist:cc959be81cce2100490afd1a8b29004a
Last active September 9, 2016 15:20
Install Vagrant on openSUSE/Debian/CentOS; Initialize an Ubuntu or CentOS Box
[see ghost blog post: http://kernelmastery.com/install-setup-vagrant/]
Vagrant, by HashiCorp (https://www.vagrantup.com), is a command-line interface to VirtualBox and numerous other virtual machine managers. There are plugins for talking to AWS, Azure, OpenStack, and many other services.
Vagrant is great for getting a predictable virtual machine set up with a few simple commands in a consistent and quick manner.
If you have VirtualBox installed, setup is easy. Just follow the steps below to try out an Ubuntu 16.04 or CentOS 7 virtual machine.
---

Keybase proof

I hereby claim:

  • I am 84adam on github.
  • I am 84adam (https://keybase.io/84adam) on keybase.
  • I have a public key whose fingerprint is 6ECC 36C6 5F6D E8CC F641 1C74 4D73 AC2D BC94 AAF4

To claim this, I am signing this object:

@84adam
84adam / $PS1 with BTC price from wink.sh
Last active March 29, 2017 16:42
Green $PS1 with $USD bitcoin price from wink.sh
from your home folder, type "vim .bashrc"
type "i" to edit; add the following section to your bashrc file under "# User specific aliases and functions":
you can use `SHIFT+INSERT` to paste text into the terminal
---
# (optional)
# Limit directory path shown in prompt to only display current and one parent directory
# Example: user@hostname ../firstparent/currentdir/ $
@84adam
84adam / gist:c08008900bb4f7f0d51ad6bfc663f75b
Created March 22, 2017 23:05
Calculate rounded percentage in bash using bc
CODE:
x=<FIRSTNUM>; y=<SECONDNUM>; printf $(echo "scale=4; $x/$y * 100" | bc | cut -d . -f 1)%%
EXAMPLE:
x=55; y=85; printf $(echo "scale=4; $x/$y * 100" | bc | cut -d . -f 1)%%
OUTPUT:
@84adam
84adam / composer-install.sh
Last active September 29, 2017 00:49
codeacademy CSS L8
#!/bin/sh
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
@84adam
84adam / noroot-ssh.txt
Created September 16, 2019 12:07
Create new sudo user; disable root login via SSH
# create a new non-root user
adduser <new-username>
# follow prompts
# give sudo permissions to the new user
usermod -aG sudo <new-username>
# check groups for new user
groups <new-username>
@84adam
84adam / btc-mc-EMA-plot.py
Last active October 12, 2022 17:22
Plot BTC Market Cap Weekly EMAs
import datetime as dt
import requests
import io
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
from matplotlib import ticker
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
%matplotlib inline
@84adam
84adam / .vimrc
Last active September 15, 2022 14:40
Vim configuration
set wrap
set number
set colorcolumn=80
syntax on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
let g:go_highlight_trailing_whitespace_error=0