Coding

OpenAFS @RPI Client

Recently I was told “I can’t remember anyone getting OpenAFS to work on their own”, by a staffer at my school. I took it on myself then to figure out how to get this working for students. And in the end I wrote an app that will automatically download and install the AFS client, then configure drives for you. This was an experiment in threading and using WPF instead of Windows Forms.

First the app goes and downloads the OpenAFS client, if it is a 64 bit machine it grabs the 32 bit tools first then the client. While downloading and installing these things it connects via SSH to a school server to get the location of the user’s home folder as well as verify the credentials given.

Once installation is complete the program runs ‘klog’, this goes to the AFS server and requests tokens in the cluster using the credentials given earlier. Once we are past the installing point all these actions need to be run on the campus network. When the program starts it tries to ping a couple internal servers, if it can hit more than half of them in under 75 milliseconds then it considers itself on campus; if it thinks it’s off campus, then it notifies the user. One small problem with the first release is sometimes this system gets confused by vpn taking slightly longer.

Now that we have working token the system recommends drive letters that are not in use as well as AFS spaces to mount including the users folder and ‘dept’ to start. The configure button will activate these drives, they are not set to persistent at this time.

Below is the github link, as well as the direct exe link:

Github: https://github.com/daberkow/RPI_OpenAFS

EXE: https://github.com/daberkow/RPI_OpenAFS/blob/master/OpenAFS%20Installer%20WPF/bin/Release/OpenAFS%20Installer%20WPF.exe

C#/.Net SSH Framework

I needed a SSH framework for a program I am writing for my school. There are quite a few out there for .Net but I ended up going with the one from http://sshnet.codeplex.com. It requires .Net 3.5 or 4.0, but its ease of use makes this not a problem. Below is a example of code using the pre-built binary for .Net 3.5, this code connects to a SSH server, then runs a command and stores the result in a string called ‘temp_holding’.

Renci.SshNet.SshClient MysshClient = new Renci.SshNet.SshClient(server, username, password); //these are varibles of strings
try{
MysshClient.Connect();
}catch{
//Something in here failed
return;
}
Renci.SshNet.SshCommand MyRanCommand = MysshClient.RunCommand(“pwd”);
lock (locker){
string temp_holding = MyRanCommand.Result;
}

PHP/JS and C# Encryption

Here is some code from a project I have been working on and then shelved. A C# (mono) project creates a RSA public/private key pair, then gives the public side to a MySQL database. The private side is saved to the hard drive for later. Then PHP dynamically adds the currently active key public portion into javascript, which encrypts the users input, and saves it to MySQL. Then the C# application can get the keys it has saved in a good place, and decrypt the data in the database. Benefits of this include the web data is secured from the client to the server, and even if somehow someone steals your database off your webserver, they dont have the encryption keys to take it away. This system also has a way to deactivate a old key and move to a new one, if more code was put into it someone could revoke a old key and migrate all the data using it to a new key, but that wasn’t implemented. I thought this would be a cool project and I learned a lot about RSA public private keys, a lot of languages handle the keys differently; some take it in hex, some do it differently, some call the parts one thing, some call them other names. The javascript portion is based mostly off this library (link). JQuery is used for ease.

Feel free to give feed back or use this, open source fun.

https://github.com/daberkow/PHP_PublicKeyDemo

Duplicate Download Gallery v.01

I was going through all my photos the other day when I realized there were a lot of duplicates, I wanted to find a easy program that could find these. After some searching, I found a bunch of programs that worked, yet cost a good amount, and I didn’t see any that had the feature set I was looking for; including a list of the files which I could save, a method to move the duplicates to another folder, and customization. Along with most importantly I wanted a FREE duplicate file finder, not expensive one that did a simple job. So I made my own. This is version v0.01, the main function works well, the main interface is meh, but it works. More updates and features to come, but for one days work its good. Also I am going to be opening up some software in the future, including this one when its closer to completion. If you have any features you think of leave a comment, I was thinking about adding a preview for photos, music and maybe video. Saving, loading logs, delete all but one copy of file, not bad interface…

Download:

https://github.com/daberkow/daberkow.github.io/tree/master/DDG

6to4 Adapter Cleaner, v1.60

This version brings a few fixes and new features, hence the version jump. Features Include:

  • Minimize to Tray when removal is working
  • Checks if already running on startup
  • Faster IPv6 detection for method 2
  • Slightly smaller

 

Download:

https://github.com/daberkow/daberkow.github.io/tree/master/6to4CardCleaner

CUFU v1.00

Here is my latest little creation, CUFU, which stands for COM USB Finder Utility. The purpose is if you have to plug in and out a USB to COM port cable a lot and it changes which COM it is in windows, making you go to device manager, now you can run this, and hit the icon, and bam it will tell you. Right now it will tell you by default if “Prolific USB-to-Serial Comm Port” is plugged in, and which is the most recent. That can be changed, there is a updater. Its a standard one week project. Also I wanted art for the about page, “art” is stretching it for what I made.

 

Download (Requires .Net v2)

https://github.com/daberkow/daberkow.github.io/tree/master/CUFU

Update

I am currently working on my A+ certification. As for the way of software, I am working on a new printer manager, mostly because my schools way of printing is horrible. I also have an idea to make a tool to fix a iTunes library, as in find missing files without going to each file. Finding duplicates, fixing artists names where there is a ‘ making all the songs split between “two artists”. Maybe converting a zune library to itunes and vice versa. I will look at taking files off a iPod touch/iPhone, but no promises.

6to4 Card Cleaner v1.50, IPv6Activator v1.00

This new version of 6to4 Card Cleaner adds the full Microsoft process of fixing the problem; the program will disable IPv6, remove the cards, and then run KB980486. There still is a option to just remove the cards.  Added features also include an updater, a window that allows you to set IPv6 to any of the 6 settings, and a new backend.

These cards WILL NOT show up in device manager, unless you turn on hidden devices, and WILL NOT show up in ipconfig unless you do ipconfig /all.

I also took out the window that lets you change the IPv6 setting, and made it its own app, so if you need a user to just change IPv6 they can get this 70kb app.

As always any bugs please report them, I will patch and the automatic updater will alert users a new version is available. Source available on request.

Download

Main Program

https://github.com/daberkow/daberkow.github.io/tree/master/6to4CardCleaner

IPv6Activator

https://github.com/daberkow/daberkow.github.io/tree/master/IPv6Activator

WebViewer

So I’ve started on a new program at the behest of my friend David. It allows you to enter any website that has a bunch of items in a numerical storage system, or through RSS. Thats the idea anyway, some uses are reading webcomics, or looking at EVERY MICROSOFT KNOWLEDGE BASE ARTICLE IN ORDER! That’s the idea, right now it just goes to “Order of The Stick Comics”. But I installed my update class, so I will put updates out when they are ready and it will warn you, then allow you to download them. Links below, my second miror is limited, so please use the first if available.

Download:

https://github.com/daberkow/daberkow.github.io/tree/master/WebViewer