Home

The Career and Life of Martin Naughton.I would like to show the world that shapes me as a person. Through the projects and information about me you will be able to make a judgement of what kind of person I am. Please scan my site for any articles I wrote to help you with your progress on your quest.

Break down of ssl files

root_ca.key and root_ca.crt are produced at the same time from nothing. root_ca.crt can be given to the public but root_ca.key has to be kept hidden or else other people can sign certs against it and break in to a server. Every client and server signs off against the root_ca.key and root_ca.crt if they want a way to trust each other.
root_ca.crt is a way of identifying the certificate authority and that you trust this certificate authority. Usually imports in to cacert truststore in java.
Client.key is generate on its own with typically a RSA algorithm

Handshake with 2 way SSL

Client does a Hello to the server. It sends a list of ciphers to the server
The server responds with what cipher it picked
The server sends the client its certificate that has been sign by the root CA(certificate authority). The server.crt. The client checks who signed the certificate. The issuer section of the certificate says who signed the certificate. The client trusts the issuer by checking the root_ca.crt. That root ca.crt must have the same issuer for the client to trust the server.
The client then lets the server know it trusts it.

Having a keystore with 2 certificates

You are able to have more than 1 key and certificate chain in your keystore. A problem is only when you are using the default key manager to pick the cert to represent your client to the server. If the wrong cert is picked for representation then the server will no accept you a trust client.

Sqlite 2 databases can not be correctly read by sqlite3

If you try to open a sqlite file that is created with sqlite 2 with sqlite3 command then you can get an error like this when running commands on that database

Error: file is encrypted or is not a database

The database file must be created and read by the same version of sqlite. Sqlite3 will not be able to see the tables created in the sqlite2 database.

This can also cause a problem if you are using the sqlite 3 jdbc connector with a sqlite database file that was created with sqlite2. Queries on this file will say that the table you are trying to access does not exist.

Using openhab bluetooth binding on linux

OpenHab does not distribute the bluecove GPL library in the Bluetooth binding because it is GPL licensed. OpenHAB is EPL (Eclipse Platform License) which is friendly to business since they do not have to open source their own bindings.

You will get this error if you do not modify the Bluetooth binding:

To fix the problem follow these steps:
unjar the org.openhab.binding.bluetooth-1.4.0.jar bundle

change directory to lib

Download the blue cove GPL jar from here
http://sourceforge.net/projects/bluecove/files/BlueCove/2.1.0/

Add the Bluecove GPL library in lib directory of the bundle along with the blue cove jar

Add the new library to manifest:
Bundle-ClassPath: .,lib/bluecove-2.1.1-SNAPSHOT.jar,lib/bluecove-gpl-2.1.0.jar

SCCS cheat sheet

Source Code Control System is on old version control systems. It predates RCS which predates SVN. It can see how old it is now. Some companies still use in their legacy systems. To remind myself I have made a cheat sheet.

All commands start with a call to the sccs binary. For example "sccs edit".

edit
Check out a new version of a file in SCCS

unedit
Just like uncheckout

get
Will get the latest file from the SCCS directory to your current location

create
Add a file to SCCS

clean
This will remove all files in the current directory that you are able to retrieve again from SCCS. This is better then delete the file using a linux or unix command because you might delete files that are not under SCCS control.

Automated multiple terminal sessions

If you are a person that when they log on to their linux machine that you start alot of terminal sessions. Best way instead of setting up all these terminals maunally you set them up automatically.

  • This command will start a new terminal for you, list all directories and files and then stay logged in to the terminal. The bash command is there to start a bash prompt after the ls command is run.  If was not there then ther terminal would exit since the ls program has done its job.

xterm  -e 'ls;/bin/bash'

GIT Error "rejected non-fast-forward" when pushing changes

It means that your local master branch is out of sync with remote master/origin branch. All you have to do is issue a pull and your branch will be fast-forward. This happens even if you are pushing a new file that does not exist on the remote branch. Some one has made a change on the remote branch that you need to decide to pull down and merge with your branch. Once your branches are synchronized then it will allow you to push your changes.

 

 

Integration of M2Eclipse and Egit

A Maven project in a GIT repository can be imported in to Eclipse in 3 different ways.

What you will need installed already

  • M2Eclipse
  • Egit
  • m2eclipse-egit connector

Using the plugins separately.

Pages