How to SSH to a VirtualBox from macOS

By: Kevin | January 17, 2017

On macOS (host):

Shutdown your VM and do:

  1. VirtualBox > Settings > Network > Add (you will get vboxnet0)
  2. Network:
  3. Mask:
  4. On a terminal ifconfig will show you new interface vboxnet0
  5. VM’s Settings > System > check “Enable I/O APIC.” VM’s Settings > Network > Adapter 2 > host-only vboxnet0

On Ubuntu 16.04.1 (guest):

Install OpenSSH Server, sudo apt-get install ssh

Run ip link, You should see a list like lo, enp0s3 and enp0s8 or something to that effect. Use that interface name for the below.

Edit /etc/network/interfaces file to append the following lines:

# The loopback network interface
auto loiface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
# The static ip to ssh to
auto enp0s8
iface enp0s8 inet static

Run sudo ifup enp0s8 or sudo shutdown -r now from the Ubuntu command line. SSH server should be up and running.

Switch to your host terminal and enter ssh user@

How to Generate SSH/SSL Public and Private Keys

By: Kevin | December 6, 2016


  1. ssh-keygen -t rsa -b 2048 -f keyName
    Tap enter twice to skip the passphrase, or enter one if you like.
    This will output keyName and

SSL with self-signed Certificate Authority (CA)

  1. Create CA key without passphrase openssl genrsa -out rootCA.key 2048 add -des3 if you want a passphrase
  2. Self sign the CA, openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem. Now you have a self signed SSL named rootCA.pem


Use the CA just created to sign other SSL certificates.
  1. Create a private key, openssl genrsa -out device.key 2048
  2. Create a certificate signing request (CSR), openssl req -new -key device.key -out device.csr. Its important to note when answering the prompts, Common Name (eg, YOUR name) []: must match the host name of the web server you are using.
  3. Sign the CSR with your CA.openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500 -sha256

Handy Linux commands

By: Kevin | August 22, 2016

Handy Commands to remember:


Recursively Change permissions

sudo find /var/log/test -type f -exec chmod 777 {} \;

sudo find /var/log/test -type d -exec chmod 777 {} \;


Search multiple files:

find . -name "*.log" | xargs grep -i <something>

grep -B x -A x file.log


Snapshot Date

date -u +%Y/%m/%d-%H:%M


Linux Permissions Cheat Sheet




4 read (r)

2 write (w)

1 execute (x)

7 = 4+2+1 (read/write/execute)

6 = 4+2 (read/write)

5 = 4+1 (read/execute)

4 = 4 (read)

3 = 2+1 (write/execute)

2 = 2 (write)

1 = 1 (execute)

Notes to self about WinRM

By: Kevin | August 22, 2016

Notes to self about WinRM.

On WinRs (client side) box, need to add ‘TrustHost’ to use CLI
winrm set winrm/config/client '@{TrustedHosts="machineA,machineB"}'

Trust all
winrm set winrm/config/client '@{TrustedHosts=“*”}’

List WinRm Listener IP and Port
Winrm enumerate winrm/config/listener
winrm e winrm/config/listener




Check running services

net start


Stopping and removing all Docker containers at once

By: Kevin | July 27, 2016

I found myself getting tired of copy and pasting UUID’s to remove containers one by one. I found this little snippet to help speed things up.

Stop all containers:
docker stop $(docker ps -a -q)

Remove all containers:
docker rm $(docker ps -a -q)


By: Kevin | July 2, 2016

Using brew on OS X,

To install:
brew install mysql

To start the server:
mysql.server start

To stop the server:
mysql.server stop

Monthly Update – 6/27/16

By: Kevin | June 27, 2016

I’ve essentially let the tank go the past 3 months and have only added top off water as needed. Surprisingly thing are going great.

  1. 5 gallon water change.
  2. Plant has been growing nicely.
  3. 4 Cardinal Tetras are all healthy
  4. Phosphates are through the roof however everything else is normal.

"IMG_4084 IMG_4083

How to add or edit cronjobs

By: Kevin | June 27, 2016

Note to self:

Perhaps use sudo.

To list jobs:

crontab -l


To edit jobs:

crontab -e

Monthly Update – 3/10/16

By: Kevin | March 10, 2016

Depressing changes since last update:

  1. Tank die off, 17 Cardinals down to 4. Pelco died.
  2. pH has been creeping >7.5 so I’ve added some chemicals to bring it down. I also added a piece of drift wood. The day after adding the wood my pelco was dead so I took it back out.
  3. 15% water change, used tap water conditioner and Proper pH 6.5
  4. New filter
  5. New carbon
  6. Got a new Pelco.

Everything is near zero except Phosphates, which are through the roof! Which explains why the tank has had an algae bloom.


Got new lighting! 🙂

Weekly Update – 2/5/2016

By: Kevin | February 5, 2016

Since last post:

  1. 15% water change
  2. Vacuumed gravel
  3. New carbon
  4. New filter
  5. 17 more Cardinal Tetras, yes 17

Everything is around 0.


Next Page »