You could also try tk Social Bookmarking Search or tk Video Search!

Saturday, March 25, 2006

Auto authenticate program for OpenVPN gui


Yesterday I was scouring the web for a way to automatically save my username and password for OpenVPN. OpenVPN, as the name suggests is an open source VPN client. While I don't really care for the TLS security that is supposed to be better than other clients, the higher powers have given strict orders to use it in order to secure my connection. Generally I hate to listen to them, but wireless security as you all may know, is not something you should bet your life on. There's no other way to connect either, so I was stuck with OpenVPN (not that this is a bad thing) or no connection at all (which is not a good thing).

So I've been using OpenVPN for a while now and everything works great. I'm using the windows gui version so the OpenVPN console won't irritate me constantly in my taskbar. And I start to notice this incredibly annoying thing that happens constantly. For some reason, my OpenVPN connection drops frequently. I do mean frequently, like 5 minutes or so. So I'll be typing stuff and this nice little dialog box will pop up asking for my username and password. Ok, it doesn't do this all the time, sometimes it'll reconnect with my authentication details and all is well. But when it wants to annoy me (and I don't know why sometimes it asks for my details and sometimes it doesn't), it'll ask me for those details everytime a connection is dropped.

And so I thought, hey, this is a gui, so there must be a way to save those details. Except there isn't any way to do that. The only way is to download around 5 packages and recompile the whole damn thing! Ok, so I stay cool headed and figure that they must offer a download with the save password option enabled. Off to their website I go, sniffing around for the hidden treasure. Nope, nothing there and I head into their forums and what do I see? A forum post stating that they do not offer that download and you'll have to go down the recompile route! The reason? They don't want users to undermine the admin's intentions by saving passwords in cleartext on their computer (I understand why). In another post, I see an OpenVPN user saying he saves his password in cleartext on his computer because he chooses cryptic passwords.

At this time, my head was about to explode. I turned to Google for help and found basically the same answer - recompile. Was I about to spend hours of my life wasted on trying to recompile something just to save my passwords? Nope. Instead Google came to my rescue once again as I found something called AutoHotkey which allows you to automate certain tasks. With this handy software, I created a simple script to fill in my username and password automatically when OpenVPN asks for it. The best part is that it allows you to build a program from that script and you can use it however you like.

Here's the script I wrote:

SetTimer, EnterAuth, 250

Process, wait, openvpn-gui.exe, 2
If %ErrorLevel% = 0
Run, %A_Programs%\OpenVPN\YourShortcuthere.lnk
Sleep, 2000
IfWinExist OpenVPN - User Authentication
ControlSetText, Edit1, YourUsernamehere, OpenVPN - User Authentication ahk_class #32770
ControlSetText, Edit2, YourPasswordhere, OpenVPN - User Authentication ahk_class #32770
ControlSend, Edit1, {Enter}, OpenVPN - User Authentication ahk_class #32770

What you need: AutoHotkey and the above script saved as a .ahk file.

What you need to change: YourShortcuthere.lnk, YourUsernamehere and YourPasswordhere.

What you need to do:

Option 1 - If you know what an .ovpn file is and where it's located (Confident users)

1. Create a shortcut in your OpenVPN start menu folder with these parameters: "--connect something.ovpn". This shortcut will run OpenVPN gui using settings in the specified .ovpn file. The .ovpn file is a config file for OpenVPN and is normally located in the folder where you installed OpenVPN.

2. Change YourShortcuthere.lnk to whatever you called that shortcut.

3. Then change YourUsernamehere and YourPasswordhere to your own username and password and run the autohotkey compiler to create an exe file.

4. Run the created executable and enjoy!

Option 2 - If you don't have an .ovpn file, or can't find it or just want things to work (Conservative users)

1. Download this AutoHotKey script for OpenVPN gui. This assumes you have only have one type of OpenVPN connection (true for most people). Please note that I'm also assuming you've installed OpenVPN gui in the default installation directory. Otherwise leave a comment and I'll fix you up with the proper code.

2. Open the file in notepad (or your favorite text editor) and change YourUsernamehere and YourPasswordhere to your own username and password and run the autohotkey compiler to create an exe file. Don't worry about the compiling, it's very easy to use. If you need help on this step, leave a comment.

3. Run the created executable and enjoy!

ps: If you change your password often, you could change the program to ask for your username and password and save these details into a text file. As long as there is a password file, the program will use those details. Delete that file and the program will request for them again.



Friday, March 24, 2006

Search 2.0?


Just the other day, a random thought came to my mind. All that web 2.0 stuff has been really interesting, but not much are really very useful. I remember seeing an Ajax search engine with the "show search terms-as-you-type" feature which I thought was pretty neat (this can be replicated on Google, Yahoo, Msn and some other search engines using an extension in Firefox). Next, commenting popped in my head, with people telling you about their experience on a certain subject matter. Somewhere in between, features from digg interrupted my thoughts, but in a useful way (think of digging). Finally, tagging came along with technorati and springing up as successful examples of using tags.

Something in my brain clicked and suddenly I had them all linked together. A useful Web 2.0 app was born. By now, you should be able to guess what it is. Search 2.0! I envisioned a search engine that allowed users to tag search results, enter good words on the most relevant search results and curse the evil search engine spammers. Of course it would come standard with Ajax "show search terms-as-you-type" built-in, but before you hit the enter button, it could show you how many people used that search term(s) or how popular that search term(s) was or show you a Google lucky link. Essentially it would try to guess the content you were interested in and show you how many people used those particular search terms and got relevant results or just show you a Google luck link (I hope you know what that means).

After you load your search result page, you could see results sorted in ways other than the search engine algorithm. Logged in users could "digg" results to get them up the search ranking. And like digg, users could "digg" comments as well. For non-relevant/spam results, they could also be reported by users and put in their proper place or taken off the results page. You could then sort results by the default algorithm, "diggs", number of "digged" comments, etc. A result could also be tagged and you could search within certain tags only.

I don't know about you, but all of these sounds very exciting to me and could be a way to entice users from the big G. It would definitely be quite useful to me, and I'm not sure if actally fits that category, since it relies on user submitted urls. This idea of mine actually changes current search engines into a much more robust tool. Hopefully someone reads this and gets enough interest in creating Search 2.0.

ps. I didn't look around much, but has such a search engine appeared on the web?

Update: Google and Microsoft launch betas that are one step closer to Search 2.0, although they really are still very far away from it.

Update: A useful Greasemonkey script that redesigns Google: Google Redux


You could also try tk Social Bookmarking Search or tk Video Search!