Posts

Showing posts from 2017

Google Authenticator servlet

Image
So I am finally getting around to building a google authenticator deploy-able appliance however I almost fee like this has already been done, just have not found it.

I went back and followed my last post and build a new server, and added in tomcat.

Im able to deploy war files and a single servelet that will execute the the google authenticator and retrieve the information required, however the switching of the user is where im stuck.

While im actually running a command on the server to execute the code, its running as the tomcat service , i need to be able to change the user to run the command in the context of the user.

here is the current code for the servlet:
package com.srk.pkg;
import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import com.oreilly.servlet.ServletUtils;
// Helpful code https://docstore.mik.ua/orelly/java-ent/servlet/ch13_04.htm
// http://thegreyblog.blogspot.com/2011/12/google-authenticator-using-it-in-your.h…

Recovery of data off a Netgear Ready Nas NV+ SPARC edition

Ran into an issue where the NIC got fried on my Readynas , I had backups of most of the data through USB but some data (expendable) was not backed up.
However I still wanted to recover this data and found this post:

http://home.bott.ca/webserver/?p=306

This actually worked with a few changes:

First remove your drives from the ready nas 1 by 1, and mark on each one the number it is starting from left to right ( 1,2,3,4)
Now place them in a PC and this is probably important , put them on each sata port in order, in my case my ports are 0,1,2,3.

Download ubuntu 1604 LTS desktop IS for ease of use
Down load Rufus to convert the ISO to a bootable USB https://rufus.akeo.ie/

make sure you computer has internet access

boot the linux USB , choose try Ubuntu


once booted to the desktop open up a terminal
run the following:
sudo su
gedit /etc/apt/sources.list

This will open up the graphical txt editor, Add the following line to the end of the file


deb http://us.archive.ubuntu.com/ubuntu precise m…