Skip to content

Instantly share code, notes, and snippets.

View v6's full-sized avatar
💭
// , ALWAYS serious at http://basanese.com

Nathan Basanese v6

💭
// , ALWAYS serious at http://basanese.com
View GitHub Profile
@v6
v6 / keybase.md
Created March 24, 2016 02:19
Nathan Basanese Keybase Proof

Keybase proof

I hereby claim:

  • I am v6 on github.
  • I am cx (https://keybase.io/cx) on keybase.
  • I have a public key whose fingerprint is CAF6 7506 C529 5624 CF6E 0C76 E183 23D2 1627 70CA

To claim this, I am signing this object:

@v6
v6 / super_neato_functions.sh
Created September 22, 2016 20:54
// , This has some super neato functions you can use as aliases elsewhere.
# Nathan's Backup function.
# It's best to create backup files by moving the original file aside to its new name with mv and the ncopying it back to its original name.
# cp -p preserves original file's set attributes.
# mv and cp -p preserve the original file's settings like the time it was created and modified.
# Also, be advised, processes might have an open reference to the original file. This process will not cause them errors. Be aware of this, if you are expecting errors from those files.
# This defines a backup bash function bakmvcp that timestamps a new file name and does the switch for you.
function bakmvcp () {
newname=$1.`date +%Y%m%d.%H%M.bak`;
mv $1 $newname;
echo "Backed up $1 to $newname.";
@v6
v6 / consul_demo_vagrant-cluster_vagrant_log_20170209.txt
Created February 10, 2017 02:13
// , This shows an issue with the vagrant up command used with Hashicorp Consul's demo.
vagrant-cluster $ vagrant up
Bringing machine 'n1' up with 'virtualbox' provider...
Bringing machine 'n2' up with 'virtualbox' provider...
==> n1: Importing base box 'debian/jessie64'...
==> n1: Matching MAC address for NAT networking...
==> n1: Checking if box 'debian/jessie64' is up to date...
==> n1: Setting the name of the VM: vagrant-cluster_n1_1486692101958_9874
==> n1: Clearing any previously set network interfaces...
==> n1: Preparing network interfaces based on configuration...
n1: Adapter 1: nat
@v6
v6 / install_fpm.sh
Created March 18, 2017 01:29 — forked from boardstretcher/install_fpm.sh
Install FPM on centos 6.5
# install ruby, rubygems and all requirements, then install FPM (effing package manager)
# fpm: https://github.com/jordansissel/fpm
# as root
# update system, install requirements
yum update -y
yum install ruby-devel gcc curl libyaml-devel
# get the ruby version manager and install
curl -L get.rvm.io | bash -s stable
@v6
v6 / bcoin.service
Created March 26, 2017 18:17
// , [/etc/systemd/system/bcoin.service] sudo service bcoin start
[Unit]
Description=BCoin server
After=network.target auditd.service
[Service]
User=root
ExecStart=/home/bcoin/bcoin/bin/bcoin --network "testnet" --nodes "seed.tbtc.petertodd.org,testnet-seed.bluematt.me,testnet-seed.bitcoin.schildbach.de" --host "\'::\'" --public-host 104.197.196.156
Type=simple
RestartSec=60
Restart=on-failure
@v6
v6 / bcoin.service
Created March 26, 2017 18:38
// , sudo service bcoin start
[Unit]
Description=BCoin server
After=network.target auditd.service
[Service]
User=root
ExecStart=/home/bcoin/bcoin/bin/bcoin --network "testnet" --nodes "seed.tbtc.petertodd.org,testnet-seed.bluematt.me,testnet-seed.bitcoin.schildbach.de" --host "\'::\'" --public-host 104.197.196.156
Type=simple
RestartSec=60
Restart=on-failure
@v6
v6 / mathinator.py
Created August 1, 2017 18:55
// , Want to sound like you know mathematics?
#!/bin/python3
import random
print("Hello?")
nouns = ["plane", "planar coefficients", "structure", "disphrenials", "altcurve", "discontinuity", "conjecture", "aliter", "transport of structure", "isomorphism", "algebraic system"]
adjectives = ["argand", "Euler", "Eilenberg", "arbitrarily prime", "coprime", "genefinite", "modulo out by", "well-defined", "sufficiently nice"]
@v6
v6 / vault_on_an_ubuntu_vagrant.md
Last active August 17, 2018 22:34
// , Short description of an installation of Vault 0.10.1 on an Ubuntu 18.04 Vagrant box

After I installed Vagrant from http://vagrantup.com/downloads.html, I used the following set of commands to make a Vagrant environment for testing Vault:

mkdir -p ~/proj/vaulttest/ ; cd ~/proj/vaulttest/ ; vagrant init ubuntu/bionic64 ; vagrant up && vagrant ssh

After this, I checked to make sure I was on vagrant by looking at my command prompt for vagrant, and installed vault in my Vagrant machine:

wget https://releases.hashicorp.com/vault/0.10.1/vault_0.10.1_linux_amd64.zip && ls && sudo apt-get install -y unzip && unzip vault_0.10.1_linux_amd64.zip && sudo mv vault /usr/local/bin/vault && vault -h

@v6
v6 / convert_hcl_vault_policy_to_json.sh
Created August 9, 2018 19:03
// , convert_hcl_vault_policy_to_json.sh converts a Vault Policy in HashiCorp Language format to the Single line JSON format.
#!/usr/bin/env bash
## tr -d '\n' |
##
## Behold.
##
## ______ _____ _ _ _____ _ ______
## | ___ \ ___| | | | _ | | | _ \
## | |_/ / |__ | |_| | | | | | | | | |
## | ___ \ __|| _ | | | | | | | | |
## | |_/ / |___| | | \ \_/ / |___| |/ /
@v6
v6 / vault_on_a_centos_vagrant_vm.md
Last active August 10, 2018 04:33
// , Set up a virtual environment and run Vault on it. Run these one by one, no idea how they behave as a script

After I installed Vagrant from http://vagrantup.com/downloads.html, I used the following set of commands to make a Vagrant environment for testing Vault:

mkdir -p ~/proj/vaulttest/ ;  cd ~/proj/vaulttest/ ;  vagrant init bento/centos-7.5 ;  vagrant up  &&  vagrant ssh

After this, I checked to make sure I was on vagrant by looking at my command prompt for vagrant, and installed vault in my Vagrant machine:

wget https://releases.hashicorp.com/vault/0.10.1/vault_0.10.4_linux_amd64.zip  &&  ls  &&  sudo yum install -y unzip  &&  unzip vault_0.10.4_linux_amd64.zip  &&  sudo mv vault /usr/local/bin/vault  &&  vault -h