How to Generate SSH/SSL Public and Private Keys

By: Kevin | December 6, 2016

SSH

  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 keyName.pub

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

Owner

Group

World

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

Enable-PSRemoting
https://technet.microsoft.com/en-us/library/hh849694.aspx

Disable-PSRemoting
https://technet.microsoft.com/en-us/library/hh849690.aspx

 

Check running services

net start

  1. http://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure
  2. https://blogs.technet.microsoft.com/askperf/2010/09/24/an-introduction-to-winrm-basics/
  3. https://msdn.microsoft.com/en-us/library/windows/desktop/aa384470(v=vs.85).aspx

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)

MySQL on OSX

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.

IMG_3626

 
Got new lighting! 🙂
IMG_3625

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.

IMG_3317
IMG_3323

Weekly Update – 1/24/2016

By: Kevin | January 24, 2016

Since last update:

  1. Water top offs to account for evaporation.

Measurements have really stabilized. ph ~7.6, Ammonia ~0, Nitrite ~0, Nitrate ~0, and new for this post Phosphates which appear to be off the charts.

IMG_3274

The water looks crystal clear. But if you look closely algae is on the rocks and all over my fake plant and the back wall.

IMG_3275

Next Page »