Tag Archives: computers

Optimize your DNS

6 Dec

As an avid listener to the Security Now! podcast with hosts Steve Gibson and Leo Laporte, I found out about the tool DNS Benchmark. It is a free Microsoft Windows program that also runs (using the Wine Windows emulator) on Apple’s Mac OS X and on modern Linux desktops. DNS Benchmark finds the best Domain Name System (DNS) servers for you, both in speed and security. DNS is like the Internet phonebook, which translates names we humans can read (like http://www.example.com) into numbers (IP addresses) computers identify themselves by on the Internet. Since everything new in your browser window comes from the Internet, and is fetched using DNS, choosing the best DNS servers can boost your browser performance considerably (30 or 40 percent in my case).

Installing Wine on Mac OS X – Since it’s easy for Windows and Linux users (search in your repository for Wine) to get DNS Benchmark running, I will tell you how I got it running on Mac OS X. I went to the Wine wiki and found a link to an entry on how to install Wine on Mac OS X. Since I have an Intel Mac, running Mac OS X 10.6 Snow Leopard, I could use WineBottler. It’s in beta, and therefore still free, and for what I needed it (run DNS Benchmark), it works great. After you’ve installed WineBottler, you can open .exe files with it, and those Windows apps run on your Mac OS X desktop as an X11 application (provided they are supported by Wine, of course). You will need to install XQuartz as a replacement for Apple’s X11 (remember to install the latest version of XQuartz after every security update by Apple, because it will reset the X11 server to the one Apple maintains, and WineBottler might stop working).

Once you’ve installed DNS Benchmark (and any additional programs needed to run it on Linux or Mac OS X), you can launch it. It is pretty straightforward, as with all of the apps made by Steve Gibson. It does what it does.

DNS Benchmark home screen

Read the introduction carefully, close all apps that access the Internet (iTunes, mail, web browsers, etc.), and click the Nameservers tab, where you can run the DNS benchmark.

The program comes with a built-in set of nameservers, which it will use when run for the very first time. It will show you the results after a few minutes of testing, and in the Conclusions tab you will find some advice on what to do next. Then it will ask you to test for nameservers near your location. This test will take a lot more time (20 minutes in my case), and depending on your location, you will get whatever servers are best suited for your situation. This might even be your own ISP. Pick at least three of the top recommendations, so you have alternatives in case one of them goes off-line.

If you have a router (and for the sake of security you really should), you might have installed 2 entries of DNS servers there (or had the installation script of the router do that for you). However, according to Steve Gibson, this is not optimal. It gives the already overworked consumer-grade router more to do, and that router will probably crash more often, due to the extra workload.

Now here it gets tricky. After you’ve removed the list of domain nameservers from your router (different for every router, but it’s probably in the DNS section of the Internet WAN; I selected to let my ISP determine the DNS server), you need to put it on each computer (and WiFi-connected mobile device) on your network. In my case it was located in the advanced tab of the particular connection, in the DNS tab. On the iPhone, you will need to click the button with the larger than sign (>), at the right of the connection name (the hotspot the iPhone uses to connect to the Internet). I suppose it will be similar on Windows and a Linux desktop distro.

Anyway, I was really satisfied with the result. My Internet felt “snappier”, less sluggish. Nothing wrong with that.

I suggest you do this at least once a year, since the situation will change constantly. Your ISP might see the traffic to its DNS box drop, and upgrade it in response.

Advertisements

I have an iPad!

24 Jul

Apple iPad

Yes, I have given in to my desire to own a shiny new thing, originating from the folks in Cupertino (read: Apple Inc.). Although I’m usually not an early adopter, in this case I wanted to make an exception. This really seems to be an entirely new class of devices, much like the personal computer was in it’s time. And having played with it for a day, I can wholeheartedly agree with that statement.

While the PC made computing devices available to small business, the iPad and what undoubtedly will follow as much improved versions of this device will introduce computing power to our personal lives, to entertain and delight us. Yes, this is an entertainment device, primarily, not a device to assist us in getting work done.

On the other hand, devices like this will make it very clear to employers that keeping your workforce happy, instead of squeezing every effort out them by demanding a performance-by-the-clock, will engage the workers to do more, take more responsibility, simply by offering a great experience to work in. I can only hope the daily grind will soon be a thing of the past. Everything that requires thinking should be done in an environment that fosters thinking. Sitting behind a device that, in its core, is just an typewriter is neither inspiring, nor fun.

Both fun and inspiration are at the core of devices like the iPad, which help us to think past the here and now, and come up with original ideas and solutions that distinguishes your company from the competition. Nowadays there is still the tendency to copy the successful, instead of trying to find alternatives that might work just as well, or even better.

We can only hope.

A useful on-screen keyboard

19 Dec

If you don’t have a lot of space on your desktop (the one that holds your computer and peripherals) and you can’t have both your keyboard and Wacom tablet next to each other, using a virtual keyboard seems like a sensible solution.

I tried Apple’s built-in Keyboard Viewer, which has the big drawback that it doesn’t behave like a real keyboard. Things like Command-Q to quit a Mac OS X program don’t work. In fact, Keyboard Viewer is nothing more than an alternative to the Character Palette application. Because of it’s very limited use, I will not go into how to make it possible to launch Keyboard Viewer as a menu item (in the menu bar).

Searching for an alternative on VersionTracker, I found this neat application of an Italian software developer called VirtualKeyboard. It costs $19.95 for use on a single user account, and $49,95 if you want to use it up to 7 Macs. There is a 14 day trial period to test it out. It is meant for people with a disability, but you don’t  have to be disabled to use it.

To find out if VirtualKeyboard is actually useful, I tried it on this piece of text. It’s not as intuitive as typing ten fingers blind (touch typing), but, if you don’t have to type massive amounts of text, it works quite well. (Mind you, I’m editing this piece of text using a real keyboard.)

The application has a limited option for text expansion, good for casual use. For power users among you I suggest reading an excellent blog post by Crass Pip: Text Expansion: Wasting time trying to save time. Even if you don’t care for his review, he does mention the three text expansion applications available on Mac OS X. One of those will probably serve your needs better than what VirtualKeyboard has to offer.

That is all.

Beardus Maximus fan art, day 36

10 Nov

Yes, creating your own Hackintosh is a lot of fun, until Apple spoils it by disabling the Atom processor in its latest build of Snow Leopard, 10.6.2.

Beardus Maximus fan art, day 36

This drawing is made to support the sale of the collected trade comic book of PC Weenies, a webcomic by Krishna Sadasivam for Geeks and people who can tolerate them.

Krishna grows a beard in response to a challenge from his fellow comics creators, while he doesn’t like a beard. Read more about it, and how you can support the artist in this post on his blog. For each copy of the trade comic book “Rebootus Maximus” sold through the website Krishna won’t shave for a day. Let him look like a hobo and freak out his wife, who is on family visit for a few months in India.

That is all.

Passing an array to a function in C

17 Aug

Yes, I admit it. I too have fallen for the iPhone, iPhone programming to be more specific. At this moment, aside from improving my drawing skills, I’m also brushing up my C programming skills, using the (out of date) book “Beginning Mac OS X Programming”. If you’re not into programming, just skip this blog post.

Here’s the problem. In the C language, how do you pass an array to a function, manipulate it and return it as an array value? The problem seems to be that if you use sizeof to determine the length of the array, that length isn’t known at compile time. The content of the array may change while the program runs. So the best practice seems to be to determine the length of the array before you call the array function, and pass the length along as well.

Here is the code to demonstrate my point.

#include

// Prototypes
void printArray(int ar[], int n);
int* revArray(int ar[], int n);

int main (int argc, const char * argv[]) {
int ar[] = {1, 2, 3, 4, 5, 6, 7};
// sizeof gives size in bytes
int n = sizeof(ar) / sizeof(int);
printArray(ar, n);
printArray(revArray(ar, n), n);

return 0;
}

// Print all array elements.
void printArray(int ar[], int n) {
for (int i=0; i < n; ++i ) printf("%d ",ar[i]); printf("\n"); } // Reverse array elements. int* revArray(int ar[], int n) { int v, j; for (int i=0; i < n/2; ++i) { j = n - i - 1; v = ar[i]; ar[i] = ar[j]; ar[j] = v; } return ar; }[/sourcecode] I tried this code without passing along the length of array ar. I tried to determine the array length within the called function instead of in the part of the code where the array was defined (in this case, main). That didn’t seem to work. After Googling in vein, I looked it up on Stack Overflow (which is, by the way, the best resource for questions about programming on the Net). And there was the answer, as I just told you. Well, actually it was a question about C++, but who’s counting? Still the explanation in the answers were a bit puzzling, so I tried some reasoning.

Here’s what I think is happening.

In C you pass parameters to a function by value only. In case of an array, the value of a pointer to the array is passed. This value is used to initialize the pointer that was defined in the function parameter list. Apparently, C has no means of passing the length of that array as well.

In fact, you only pass the pointer to the first array element to the function. The function cannot know how many elements follow after the first element, so the function caller has to tell the function, by passing the value of the length of the array.

Of course, in main the array ar is in context, so sizeof(ar) will give you the number of bytes that is reserved for ar. If you divide that by the number of bytes that is reserved for an int value (which you write in C as sizeof(int)), you have the number of array elements in an integer array.

That is all.

Two little girls computing

20 Mar

If I were writing that this drawing was hard to make, then that would be an understatement. This was the hardest drawing I did so far. Still, I was able to create it in 65 minutes or so.

Two little girls computing

The expression in the face of the girl on the right was very hard, and it still is pretty off-model. The problem was that the girl on the left was reasonably easy and that tricked me in roughing the girl on the right too much. You really need to keep concentrated and enthused during the whole drawing.

I was so busy getting the girl on the right correct, that my coffee got cold and I forgot everything around me. I guess that is a good thing, because it means I was in some kind of flow.

The photo was from my local free newspaper, and can be found here. The article was about the safe use of the Internet on schools. I haven’t read the article, because I thought the photo was so stunning.

Needless to say, that though the expression in the face isn’t what I had expected and there are still a lot of things wrong, this happens to be my new favorite drawing, probably because of the expression of the girl on the left.

That is all.

Creating a fun photo with your msi webcam and Snap!

25 Jan

I thought it would be fun to create a composite photograph, using the built-in webcam of the msi wind and the snapshot program Snap! (which has some nice features).

I took this shapshot with the webcam of the msi wind, using Snap! Snap! lets you put clipart on top of your webcam picture. You just reposition yourself, and resize the clipart, so it becomes more or less “believable”.

Snapshot with me in it

To create a composite photo, I had to take a snapshot without myself in the picture. It will then simply be a matter of importing both snapshots into an image editor, put the one without me on top, and rub the part where my face is out on the top layer, so I magically appear from the layer below.

Snapshot without me in it

Here I put the snapshot without me on top of a snapshot with me in it, and rubbed out part of the top layer, so it showed the layer underneath. I did this in Art Rage 2 on Mac OS X, but it could just as well have been an image editor.

Composite photo

The last step in creating this fun photo is to crop and resize the image, so it shows only me in a monkey space suite. I did this on the Mac, using Pixelmator.

Final image Monkey Purplebox

That is all.