Archive for February, 2009
Running OpenVPN-gui 2.X in Windows Vista
by Mats Hellman on Feb.13, 2009, under Linux, Networking, Windows
This is a short short note how to get OpenVPN-GUI 2.X working under Windows Vista.
First of all you have to set it to always run as administrator. Go to the folder where it is installed and in the Bin folder you’ll find the OpenVPN-GUI executable. On the Compatibility tab you find Privilege Level, set it to Run this program as an Administrator
In your the parent folder find the config folder and open the config file. Add the following lines to the file.
route-method exe
route-delay 2
Make Internet Explorer usable with a few add-ons
by Mats Hellman on Feb.13, 2009, under Windows
Even if I am, and have been for many years now, a Firefox user I do occasionally look back and feel I want to use Internet Explorer again. The simple reason for this is the small amount of resources this browser uses. I know it’s evil, unsecure, doesn’t follow the standards, is preloaded and always runs in the background and that is the reason why it seems fast. And since IE 7 we even have tabs.
Search provider
First of all I always change the search provider. IE has a search field since IE 7 so I use it. Just click the arrow in the search field and select Find more providers. Choose one you want to use, for me and so many others it’s Google. This was one of the reasons I made the switch from IE to Firefox in the beginning.
StumbleUpon
This is my favorite waste of time, I stumble. I admit, I could not live without stumble anymore. I don’t even know how I got by before I found this application. I’ve found so many sites via stumble I can’t even begin to count them. Some are work related and some are more personal. But it has probably saved me hundreds of hours searching time, because I bookmarked something I later needed at work. And it is available for Internet Explorer.
IE Pro
Last but definitely not least is the IEPro add on. This one makes so many other add ons useless. You get inline search, advertisement blocker, download manager, spell checker and so much more.
With these few enhancements you can use Internet Explorer and it will be almost as good as Firefox. It might not be as secure. But many companies do not push out Firefox or even have a policy on this forbidding the use of Firefox. If you can get your administrators to push out IEPro you will feel more at home in IE.
That’s all folks
I could start looking for a way to make this list long, like all those 50 Best plugins for Firefox, but I won’t. I refuse to make a post just to get a lot of content, and to be honest I wouldn’t want 50 plugins on anything anyway. If it can’t do it whit less something is wrong. The few changes I mention above make IE usable, and that’s all I need. I’ll still switch to FF when I miss it.
My home office
by Mats Hellman on Feb.12, 2009, under Life
We moved into our new house in May 2008 and it took me some time to get settled and plan the way I wanted my brand new home office to look like. A few months later I was settled on a design I did in IKEA Planner. As all furniture I bought to my office was from IKEA using their planner was the smart way to go.
I decided early on that I didn’t want any open cabinets, they all had to have doors I could shut. If you are wondering why, take a look at how ugly 30-50 programming books in different colors can be, add to them paper folders and you have a colorful office.
Anyway planning a office for myself I had a few goals. I had to have enough space to keep papers, books, magazines, notes and various office supplies on the tables without them getting in the way. I settled on two tables placed like an L. The other thing I felt important was that I had to have a view out the window and see the television in the living room. I feel more constructive when I can see something else than a wall.
All this in mind I ordered the furniture delivered to our door and the bill was a little over 800 €. Quite cheap considering I got everything except the chair which I already had and felt didn’t need to be upgraded. I wouldn’t buy a chair from IKEA anyway.
The home office
The point of this post was to show some pictures of my home office. It’s still a work in progress. I still need a few shelves and some paintings or photographs on the wall. But somehow buying stuff for my computers always seems more important
. So here are two pictures from the office. I dare not show you the other wall since it’s a mess.
As you can seethe desktop is quite clean. Nothing special there.
New Keyboard
My trustworthy old Logitech MX keyboard started pipe out.
The left shift button was working and not working as it saw fit so I had to replace it. And as from the heavens Jeff Atwood posted his keyboard was worn out. His “holy grail” of keyboards was the Microsoft Natural Ergonomic Keyboard 4000. I remember myself looking at these ergonomic keyboards years back. So I figured it was time I’d at least try one out. I got the wired version since I see no point in using a wireless keyboard at the desk. A wireless mouse is different. So I placed my order to my shop of choice Verkkokauppa.com and picked it up a few days later. I’ve now been using it for a few days and I have to say I really love it. Once you get past the fact that the keys are separated for the left and the right hand you’ll love it. I just feels right and I can’t remember a better keyboard. This is definitely the one I’m going to get to work next time I need something new.![]()
Next time I’ll post pictures when the office is done. Until then this is what you’ll have to settle for. Feel free to comment and any ideas or ways to make a home office “better” will be greatly appreciated. If you have pictures of your office I’d be happy to see some and snag a few ideas.
ASP.NET Basics Part two – special folders
by Mats Hellman on Feb.11, 2009, under ASP.NET, Programing
I’m really sorry this post is a little late. My keyboard’s left shift button died and I had to get myself a new one. More on that in another post.
I assume you have read the article from last week. This week we are going to take a look at a few of the special folders that ASP.NET 2.0 uses, in specific we will use the folders APP_CODE and APP_LOCALRESOURCES. There are also a few others but I’ll get into them when I start using them myself
.
Special folders are new to ASP.NET 2.0 and the idea of using them is plain brilliant. Any class, wsdl file or typed datasheet you put in APP_CODE will automatically be available for all pages in your web application. And with APP_LOCALRESOURCES you can set the language of the page by using a few files. This really is brilliant and it make development faster, so you can spend more time in the all important testing phase .
The Demo2 website
After you start up your development IDE, be it Visual Webdeveloper or Visual Studio, create a new website and call it demo2. When you have your new solution open you can delete the APP_DATA since we won’t be using it today.
After that right-click on the URL to your solution and select Add ASP.NET Folder then create one APP_CODE folder and one APP_LOCALRESOURCES folder.
Next let’s get on with some examples on what we can do with our folders.
APP_CODE folder
As I said earlier this folder can hold classes, .wsdl (Web Service Description Language) files and typed datasheets and any of them placed in the folder automatically becomes available for the rest of the pages in your solution. You can even place class code from different languages, like VB.NET and CSharp. The only thing to remember if you decide to use more than one language is that they should be separated in subfolders. Using VB and CS would be the logical choice. If you want to use both languages you have to do a few changes. First of all you have to ad a web.config file to your solution and in it place the following simple code
<compilation> <codesubdirectories> <add directoryname="VB"></add> <add directoryname="CS"></add> </codesubdirectories> </compilation>
This is just to tell ASP.NET compiler where to find the code. You can’t throw both .vb and .cs files in the same directory. And this way it is really clear where to find them.
To demonstrate the use of the folder we will make a simple calculator class. So ad a Class file in the APP_CODE folder and call it Calculator.cs.
public class Calculator { public int Add(int a, int b) { return (a + b); } public int Sub(int a, int b) { return (a - b); } }
After opening the calculator class we add some logic. This will be a really simple application so it wont do much but we could still have two functions, Add and Sub. I will only use Add in this demo but this gives you a view into the logic here.
What you should notice is that as soon as you have the code in place and save it Intellisense picks it up and you can start using it in the Default.aspx file. Or as I did in Default.aspx.cs. This is a really simple page and all it does is add two values which are hardcoded in the page. I chose 100 and 100 and add them together. And voila it works.
APP_LOCALRESOURCES
The localresources folder is used to construct resources that can be used by a single .aspx file, the globalresources does almost the same but it is application-wide. So to test this feature lets create a page called, imaginatively, Test.aspx. Leave it empty for now. Add two resource files in localresources, I chose to add the default Test.aspx.resx and a file for my native language Swedish, Test.aspx.sv.resx. In them ad the following
Test.aspx.resx
| Name | Value | Comment |
| PageTitle | Welcome to Yoursite :: Demo2 | |
| Question | What’s your name? | |
| Answer | Hi there, |
Test.aspx.sv.resx
| Name | Value | Comment |
| PageTitle | Välkommen till Dinsida :: Demo2 | |
| Question | Vad heter du? | |
| Answer | Hej på dej, |
You can use your own languages, just change sv to anything you want. You can also have many many more files in here if you want. I only speak and write Finnish,Swedish and English so my site would be quite small. But if you write 20 languages feel free to put them all in there
.
Now let’s go back to the Test.aspx file. We need to do some work on it to get the local resources in use. First of all, drop in a label (yes I like them) and a textbox and a submit button and another label.
Call the above lblQuestion, tbName and lblAnswer. Remember to keep ID’s as clear and descriptive as possible. It’s not a problem in a solution like this one but if you are working on something with say 1000 pages it will be. Now open the codebehind file and paste or write the following.
public partial class Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Page.Title = (String)GetLocalResourceObject("PageTitle"); lblQuestion.Text = (String)GetLocalResourceObject("Question"); } protected void Button1_Click(object sender, EventArgs e) { lblAnswer.Text = (String)GetLocalResourceObject("Answer") + " " + tbName.Text; } }
And here is a screenshot of the application in action. My browser is set to Swedish locales so my page displays in Swedish.
![]()
Se how easy it was to get the values out of our resource files. As I told you there is nothing to it. It’s fast, simple and well for someone who likes code simply beautiful. As always the code for this application can be downloaded as a .zip file.
Linux ready for the masses/desktops?
by Mats Hellman on Feb.06, 2009, under Linux, Windows
Being a fairly active StumbleUpon user I see these posts about Linux being ready for the desktops all the time. Actually I’ve been reading about it since I started using Linux back in 2002. Still Linux has not made a big leap into the home user market or the enterprise market. Why is this? Linux is a stable operating system that just keeps on working and you might think the TCO’s should help Linux on it’s way to world domination also. Still we see Microsoft and their products are dominating the market. The article/post that got me to write this one can be found at the breakingitdownblog.com.
After commenting I got a nice reply from the author, and I do understand his worries about dealing with the Linux community, but I give the Linux community a lot of credit and hope any comments here are sensible and wont start a war. That was never my intention.
If you start reading this, please read all of it. Don’t comment after reading only half because you won’t get the point.
Jungle of choice
As I see it there are a few things that makes Linux something administrators don’t want on their desktops. First of all, and this is something the open source community will hate, the number of choices. There are so many alternatives out there. Should you use RedHat, Novell, Ubuntu, Debian, Gentoo etc etc etc. Choice and competition is a good thing, but this is borderline ridiculous. If I don’t like your distribution or the way you manage your open source project I’ll just start my own. This is good right? No. This makes the jungle of open source products even worse. Let’s take a simple example, my parents. Go tell them to install Linux. First of all, how would they find a distribution? Would they read why a certain distribution is good for them? No. Never. They buy a computer and are happy to pay the Microsoft toll because they are able to use it.
And when it comes down to it, that’s exactly what most people want to do with their computers. Use them, not find bugs, submit bug reports or join mailing lists.
Office
I work in an organization with around 1500 users. We like so many others use Microsoft Office in our day to day work. Why? Well I guess because so many others are. That might seem like a stupid reason but try to tell a user that he/she can’t open the document just received by email because we only use OpenOffice.org, the possibility of it going the other way around is very small. This was visible already when the new Office 2007 suite was launched, because it saves documents in docx by default and Office 2003 does not open them.
Thank god there is a document converter for Office 2003 so we dodged that bullet, by installing it for anyone needing it and now it’s going out by group policies. Next you’ll try to tell me well this might, and only might be true for the corporate users but how about home users. Well I’ll tell you the same thing here. If I receive documents to my personal mail it’s almost certainly written in Microsoft’s Office, not necessarily 2007 but a version of it anyway. Well if it is written in a previous version I might get lucky and the document, spreadsheet or whatever might work as it should, but for most cases it won’t, Microsoft macros work in mysterious ways. If it is in the 2007 .docx format, well then I have some work to do. To be clear, I’m not saying this is OOo’s fault. On the contrary, I guess Microsoft doesn’t go easy on projects like this. And looking at their market situation why would they.
Let’s get on with it. If I’m running Microsoft Windows I can get the compatibility pack, or use an online converter, t to a .doc and then open it it OOo. And that’s just it, you can’t expect the average user to do this, or even be interested in doing it. They might google it and find the office converter install it and expect it to work. And it does.
Being a geek, word processors are not something that make me jump up and down of excitement, but I have tried OOo more than a few times. And it just doesn’t feel right, I can’t get it to do the things I want it to, not in the timeframe of learning I’m willing to use. I count my time in hard cash, and 3 hours of trying to make something work adds up to a Microsoft Office student license which you as a home user can buy and use, if your not making money with it.
You could argue that it took time to learn to use Office also, well it did. And that’s another reason for keeping it, why throw all those hours of training out the window if another program cant offer anything else than a smaller bill getting the software. It would be just plain madness.
Management
This is a big argument for me. I work with networks and servers and I like to keep the users as restricted as possible without making their daily work suffer. Also I want to be able to centrally manage users, passwords, desktop security settings, local firewalls and the installed software. Some of these are in fact possible to do in Linux. But it’s not as easy to manage as Microsoft’s Active Directory with systems center configuration manager.
Group policies are another thing making Active directory more attractive. We can handle system settings like services, WLAN, well just about anything via this sleek and fast interface, and most of the time it just works.
I do admit Microsoft’s products do have faults, but the good old pro/con list just doesn’t tip over to the advantage of Linux, at least not yet.
File Servers
As I said above I’ve been using Linux since 2002 and I still can’t always get file/folder permission set like I want them to. If you use shared folders, and I’d say every company today does you need a sane way of managing the shares. I like Microsoft’s approach to the security settings. Share and local settings are separated and in my little mind I can manage the settings just fine.
Nested groups helps a lot to. Since providing a group access to another groups files or folders helps to keep the rights simple. And if you manage a large file share it has to be easy and logical.
Distributed File System is another really nice feature of the Microsoft Server family. I wont go in-depth here but if you’re not familiar with it take a look at Microsoft DFS pages.
To clear this up, I’m not saying these things are impossible to accomplish in other systems, I’m just saying it takes more work. And work hours cost money.
Places I promote Linux
Well after my short and maybe even evil rant about why Linux has issues I’m going to turn the table a little, because there are places I’d rather use Linux than any Microsoft product. To mention a few:
- Databases with information that could save/take lives. Like patient journals.
- Backup systems, we use EMC Networker as our backup solution and it runs stable as a castle. I wouldn’t even dream of using Microsoft products as a foundation for this when it’s available for Linux.
- Some web applications. Because Apache is a great software and it runs so smooth on a Linux server.
Use the best tool for the job
To everyone out there who now wants to dig me a grave and make me suffer I have a few finishing words. The point of this article was to point out that you, at least in general, cannot say Linux or Windows or even OS X is better than one of it’s competitors. It all depends on who you are and what you are doing.
Let’s stop these flame wars now and agree that everyone should use the best tool available for their task at hand.