Computers, Linux, Open-source, Software, Thoughts, Web, Windows

NetworkManager and PPTP in Intepid Ibex

Of all the things that I love about our campus, trying to connect to our Microsoft VPN with a vanilla installation of Ubuntu seems to top the list. Inevitably, I forget all of the specifics of what comprises a “Microsoft VPN” connection, and am overwhelmed by the myriad of shit thrown at my by the NetworkManager VPN interface. To add to it, I seem to suffer from “VPN failed to connect” ad nauseum trying find the right combination of settings that will work.

Well, here it is – documented for all time.

Setup:

From a vanilla installation of Intrepid Ibex, you will first need to install VPN support to be able to setup this connection. To do this, fire up Synaptic Package Manager (under System -> Administration), and search for “network-manager-pptp” (or from a terminal: “sudo network-manager-pptp”). Once this is installed, you will need to issue a command to restart NetworkManager with its new plugin: “sudo NetworkManager restart”.

For the maintainers of Ubuntu / NetworkManager / PPTP let me point out a few things:

  • Ubuntu should ship with network-manager-pptp by default.
  • NetworkManager should be accessible using a lower-cased entry inside of “/usr/sbin/” .
  • There should be a script for NetworkManager in “/etc/init.d/” like for everything else.

Moving along – now VPN should be available in NetworkManager. Click on “Add” and setup your information. Take special care to observe the following issues:

  • The gateway is just the DNS name – no “http://”, etc
  • The username should by your Microsoft domain name, followed by a backslash, then your username.
  • Leave the password blank here – it is buggy and doesn’t integrate into the Gnome Keyring as it should.
  • Leave the Domain field blank – this was taken care of by the username.

Click on “Advanced”, and check that the option for MPPE is checked. If your network requires Protected EAP (PEAP), then you will need to do one additional step (horribly not accessible from the GUI):

For PEAP, run “gconf-editor” from a terminal, and navigate to “system” -> “networking” -> “connections” -> “1”, or “2”, etc -> “vpn”. Locate the entry that corresponds to your VPN connection in question. Create a new key under this connection called, “refuse-eap”.  Make it of type “string”, and its value should be set to “yes”.

Now choose to connect to the VPN connection, and type in your password, and optionally select to remember the password in the Gnome Keyring. This is a work-around for it not saving in the keyring earlier.

Routing:

Is your VPN connection slow? Wouldn’t it be nice if you could just use the VPN for work resources, and leave the rest of the Internet accessible through your local connection? Welcome to the magic of routes. Despite the intimidating name, they are fairly easy to setup.

To see what routes are available, run the following from a terminal: “sudo route -n”. See the network connections (eth0, etc), and your “ppp0” connection if you have connected to a VPN? The connection with the destination of 0.0.0.0 is your “default” route – in other words, where all outbound traffic goes unless otherwise specified in this list.

Try toggling your VPN connection and looking at the output to make more sense of it.

The old NetworkManager had a place where you could specify an IP address range. For our campus network, it was “168.28.0.0/16”. See this post for more information.

In the lastest NetworkManager (0.7.0), this “easy” configuration has been swapped out for one that is more confusing IMO. Go back to the VPN configuration screen, then click on the “IPv4” tab. Click on the “Routes” button. Enter in the following values if you wanted to convert “168.28.0.0/16” into the new format:

  • Address: 168.28.0.0
  • Prefix: 16
  • Gateway: 0.0.0.0
  • Metric: 0

Disconnect, then reconnect from the VPN server to have the changes take effect. Running “sudo route -n” should now show the new “ppp0” not as default, but as the new route for “168.28.0.0” addresses.

More suggestions for the maintainers:

  • For the Ubuntu maintainer: How about shipping with pre-configured VPN profiles?
  • Can the new “Routes” interface optionally include either format?
  • For the NetworkManager / PPTP maintainers: Is it possible to have less verbose, but more relevant output? Is it possible to run a check against a VPN domain and find out what settings are supported / required?
Apple, Computers, Linux, Open-source, Personal, Ruby, Software, Thoughts, Windows

Netbeans 6.5 Rails Console

I was really excited about the release of Netbeans 6.5. It is the only solid Ruby  / Rails IDE that I know of, and it runs circles around Aptana (aka RadRails). Among the new release features is an integrated Rails console. This means that I can develop and test all in the same app without having to ALT+Tab myself to death.

Let me preface this rant by saying that I have the utmost respect for Netbeans (despite its owner) – it is rock solid, easy to use, and powerful. However, the Rails console leaves much to be desired. Here is my list of issues that I would love to see addressed (by someone with more Java finesse than myself):

  1. The Rails console doesn’t allow pre-typing. The environment may take 1 – 30 seconds to load. In this time, I should be able to start typing in my command and have it fill-in correctly once the prompt is available. It will fill in all the stuff I type before it is ready in a random order instead.
  2. The “Up” arrow on the keyboard moves the caret to the previous line, unlike in IRB / console / Bash where it should autocomplete the previously run command
  3. Ctl + L will clear the screen, just like in the development logs, and console on Linux / OS X, but it actually renders the console useless. It removes your prompt, and stops accepting keyboard input

While someone is at this, here are some of my dream features:

  1. The same code-completion that is provided by the IDE itself. If I type in a model name, and hit “.”, it should show me a list of instance methods on that model.
  2. Syntax highlight the output just like in the IDE

Please Netbeans community, Christmas is coming – consider it a gift to the world!

Computers, Events, Linux, Open-source, Personal, Ruby, Software, Thoughts, Web, Windows

SWAN Manager v2.0

It has been a trying last few weeks, but I have finally rolled out the new SWAN Manager. It ended up being almost a total rewrite, and I walked away with a lesson learned:

  • Even on a total rewrite, I should have consistently been checking in my code at “checkpoints”. Instead, I waited until everything was working, then did one single massive checkin. Inevitably I missed stuff, forgot to cleanup stuff, and had to resolve a couple of SVN conflicts where it just didn’t understand what the hell happened.

I have highlighted a few of the more significant changes in screenshots below:

I based the new login screen off of Google Docs login. It shows at a glance what services are offered inside the Manager, and is a little more friendly than just a login box. Also, you can see the new tabbed interface at the top.
The User model underwent the most significant of changes. First, I decided that it was running way to slow, so I reimplemented the way it looks up the data from an indirect (and unreliable) method, to querying the sources directly. Also, the data is cached using memcached for even more speed enhancements.

An area I am particularly proud of is the display of the icons the user should see. I take each role name, and do a Net::HTTP fetch on them, checking for a 200 result, and displaying it. This is all handled in a helper.

The channel model underwent significant changes as well. It has always directly queried for the data on each request, instead of caching the results. In addition to caching and other performance tweaking – I now know a lot more about the channels themselves. The entire model operates as an “acts_as_tree” with parent, and children nodes to show the sections, and sub-sections of a channel. If you can edit a section, it shows up as a link.
The announcements controller has been completely reworked as well. Before the user didn’t have the ability to do things like send to a role, or choose delivery / expiration times, or a destination. Now the user gets to pick all of this (Population Selection with a parameter is shown). A message can be sent with just a few clicks. The announcement model uses “acts_as_state_machine“, a seemingly dead but very useful plugin. The announcement goes through several states with validation checking and routing automatically handled. I have to thank Matt for turning me onto the idea.

Here I have an image of the announcement wizard further down on the same page as the image above. The date selected is handled by a Rails plugin called “unobtrusive_date_picker“. It allows some cool tricks like keyboard arrow navigation, and the ability to define starting / ending date ranges, and minute increments in the select box.

Additionally, once the announcement is sent, rather than going to get a cup of coffee while it runs the process (sometimes 10+ minutes), it now backgrounds it in a separate rake task.

All in all, I think that this is a word of difference from the previous SWAN Manager. This is stable, fast , and easy enough now that I feel it is something the campus as a whole can use without concern.  And it will need to live up to it expectations as well, as we have a few departments already lined up to start using its functionality as soon as we give the green light.

After I pat myself on the back, I suppose its time to get back to working on all those pesky channels…

Apple, Computers, Linux, Open-source, Software, Thoughts, Web, Windows

The Rich-Internet-Application Bubble

It doesn’t seem to be a question of if, but when we will see the Rich-Internet Application (RIA) bubble burst. Adobe’s Flex platform, and Microsoft’s Silverlight platform promise the world, but their implementation seems to be flawed. The entire discussion seems to always remind me of the story of Java. Consider the following advantages and disadvantages of an RIA system over traditional HTML / Javascript / CSS:

Advantages:

  • RIA platforms promise “rapid application development” (so cliche in the development world). A developer can create a visually rich and interactive application inside the comfort and power of an IDE.
  • RIA platforms can consume data at a level that is not currently possible with current existing web technologies. SOAP, XML and other services can be consumed in a stateless web application.
  • Web applications are treated like traditional applications, offering added benefits like running offline

Disadvantages:

  • RIA platforms are specific to an IDE – in short controlled. Adobe’s Flex promises to be open source, but only on the client end. The “black box” will probably remain just that.
  • If open-source specifications are achieved (unlikely with Microsoft Silverlight) It will take years for alternate IDEs, and editors to support its functionality on a level comparible to what is currently offered
  • RIA platforms add another layer of complexity to an increasingly growing software stack with the need for web services to interact with database sources as the RIAs ironically are not able to.
  • HTML, Javascript and CSS are all free, standardized, open-source, cross platform, and ubiquitous. Microsoft’s Silverlight and Adobe’s Flex are both controlled and shaped by a single company.
  • RIA platforms require a browser plugin, since the technologies generate data that is not directly consumed by any current browser.

Hopefully we remember the failed promises of Sun’s Java VM. The marketing term “write once, deploy everywhere” has become something of an inside joke in the technology industry, as this is hardly ever the case. It should be more appropriately named “write once, deploy anywhere that supports platform ‘x’. This is made worse by the fact that as closed-spec platforms, the RIA browser plugin development is left to the companies pushing the platform. How well do you think Microsoft will support a Silverlight client on Linux, or iPhone?

Performance in RIA platforms has also historically been a sore subject. Java code runs by creating a host-specific virtual machine that abstracts all of an operating system’s details. This works against performance, as the virtual machine will always be the limiting factor – there is simply too much overhead involved.

What each of these companies are pitching to developers is the idea that HTML, Javascript, and CSS are old, and cumbersome to work with. Further, browser inconsistencies make truly agnostic client-side scripting, or styling very limited in implementation. Solutions like Prototype.js, or the CSS browser reset are needed to write agnostic code.

I just don’t buy into it.

First, HTML, Javascript, and CSS are made cumbersome by the fact that no browser (except possibly Safari) adhere to the standards agreed upon by the W3C consortium. Microsoft in particular is selling a tool to abstract browser development, while their browser consistently remains one of the least compliant available.

Second, I think that the success (undeniable when looking at their ubiquity) of HTML, Javascript, and CSS are due to the fact they are free, accessible, open-source, and standardized. Anyone who wants to be a web developer can start right now without ever spending a penny. Developers wishing to use RIA platforms must purchase a developer license to use the IDEs to generate the code.

I hope that the developers of the Internet don’t fall prey to the seduction of RIA offerings. RIA is simply a product being pushed soley on the basis of profit – not with the promise to make the web a better place tomorrow. Instead, I encourage everyone to ride out this wave, and let the technology’s bubble burst.

Computers, Events, Hardware, Linux, Personal, Software, Windows

Back from Catastrophe

What a horrid last few days. Around lunch yesterday I restarted my Windows box at work, and I was greeted with unpleasantness. At the login screen, I got an error informing me that some instruction in memory has performed an illegal operation. After clicking on that, I got the infamous “NT Authority” says you have 60 more seconds with Windows error.

On rebooting the machine, I was notified that “C:WindowsSystem32hal.dll” is missing. I called shins, but sure enough, my entire Windows directory appeared to be empty. On closer inspection, Ubuntu informed me that it wasn’t empty, but instead, it was receiving an Input/Output error when trying to “ls” the contents. I ran a “chkdsk /r” wholly expecting that NTFS has fucked it all up again, and I seem to have been correct – at least in part.

After the chkdsk, I advanced two seconds further than my last attempt to boot Windows, only to be greeted with some cryptic error informing me that my registry looks about like that train over there. Repairing was not an option, so after much fingernail biting, and a few choice words, I decided that my only remaining option was a reinstallation.

Let me take a moment here to talk about the Windows reload process. My problem isn’t that I think its crappy and that I think someone should do something about it. I actually know that its crappy compared to any other Operating System’s standards. I can’t tell you how many damn “Next” buttons I had to click. And then how many preferences I had to change. This would have been much easier if I could have used something like Synaptic to check all the programs I wanted to install in one swoop. Additionally, on a *NIX platform, all of my application preferences would have been saved under my home folder. Windows is a tard in that department so it took me about five hours to get it back to usable.

After that got resolved I fired up my Virtual Machine containing my webserver (cheap hosting solution I know) and found that the MySQL database wouldn’t start. It ended up that the filesystem on my Linux box was corrupted as well. I ran “fsck” and fixed a dozen or so errors, rebooted, and realized that one of the files that was corrupted happened to be the MySQL user’s table. Long story short, I learned alot about troubleshooting MySQL, and got everything restored without losing any data.

Now I am finding other files all over the place that are 0 bytes in size. I have backups, but since the original file still exists when the backup is made, the backup is successfully overwritten with the new (0 kb) file.

John (and I partly) suspect VMWare may be the culprit. This is an incomplete theory however, and the entire process has left me visibly shaken. We run financial systems on these things. We run nuclear power plants with these things. My net worth is just a number sitting on some hard drive in a basement Wachovia owns somewhere. What happens when that dissappears?

Computers, Hardware, Linux, Open-source, Software, Web, Windows

Its Almost Here

Laptopmag.com has just reviewed a pre-production unit of the Dell Inspiron Mini 9. It seems pretty impressive, with the following specs:

  • $349 base pricetag
  • 1.6-GHz Intel Atom processor
  • Tailored version of Ubuntu (or Windows XP)
  • 9.1 x 6.8 x 1.3 inches
  • 2.3 lbs
  • 8.9 inch 1024 x 600-pixel resolution
  • 1.3-megapixel webcam
  • 3 USB 2.0 slots, , VGA out, Ethernet, headphone and a microphone jacks, 4-in-1 memory card reader
  • Bluetooth and wireless G (with Mobile broadband)
  • 4GB solid state drive (also available with a larger 8GB and 16GB SSD)
  • 3 1/2 hour battery

Looks pretty tasty…