Friday, June 25, 2021

Powering your Router with your Power Bank

With the work from home setup we all have to rely on our routers for a reliable connection throughout the day. If you live in a region like me where power failures are common, you need to plug the router to a UPS to maintain uninterrupted internet (specially useful for long meetings). UPS ensures the router is powered by external power when power is available and switch over to UPS battery when no power.

In addition to a UPS, you can also use your Power Bank which you may have already purchased for your phone to power the router. 

You can consider this approach if:

- You don't want to purchase a bulky UPS just for the router.

- You are fed up with unreliable/broken UPS switch-over delays and battery quality.

- You already have an unutilized power bank with you.

What you need:

- A router

- A power bank

- Step-up voltage convertor cable (Can be purchased at a very low cost compared to a UPS)

Verify your router power consumption:

Take a look at the bottom and it should mention something like this:

V means Voltage and A means Amperes. In my example it's 9V and 0.6A. Some routers might mention the current in milli-amperes (eg. 600mA). This allows us to estimate the power consumption of the router.

9V X 0.6A X 1hour = 5.4Wh

That means if we keep our router running for 1 hour it will consume 5.4Wh of energy from your electricity supply. (Wh means Watt Hours)

Another example: Router says 12V / 1000mA
1000mA = 1A. That means:
12V X 1A X 1hour = 12Wh

Verify Power Bank energy output:

The output energy of the power bank effects how long can your router run from the power bank before you have to recharge your power bank. There are 2 factors to this:
- Power bank battery capacity. Usually power banks mention their capacity in milli-ampere-hours (eg. 40000mAh
- USB output voltage. Usually this is 5V.

Calculating energy output of a 40000mAh power bank with 5V output:
40000mAh = 40Ah
40Ah X 5V = 200Wh

Another example: 10000mAh power bank with 5V output:
10Ah X 5V = 50Wh

Estimating how long your router can run:

Run time = Power bank output energy / Router power consumption

According to my examples, to run my TP-LINK router with a 10000mAh/5V power bank:
Run time = 50Wh / 5.4Wh = 9.2 hours (theoretical maximum)

Keep in mind this is the maximum runtime if there's no energy loss during power transmission. Assume the efficiency is 70%, then the practical run time is 9.2 hours X 70% = 6.4 hours.

By that estimate, if I use a 40000mAh/5V power bank, I can run my TP-LINK router for nearly 24 hours continuously before I have to recharge the power bank.

"Passthrough" power banks

If your power bank supports "passthrough" feature, then it can charge while providing battery power to your router. Then you don't have to worry about router power consumption and having to unplug and recharge. Refer to your power bank manual to find this out.

Purchase a matching step-up converter cable

Last thing you need to do is find a step-up voltage converter cable to match the power bank output voltage and router input voltage. The convertor cable provides a USB jack to plug to power bank USB output. Also please verify when purchasing whether it provides the matching power jack for your router power socket.

Here are some step-up cable search results from and

Monday, December 8, 2014

Translating the language of PDF documents while preserving formatting

Recently I got the PDF version of the user manual of my car. Since it was a Japanese domestic vehicle, the manual was only available in Japanese. I wanted to translate this to English but couldn't find a proper set of instructions to do it online. First I tried Google translate, which works pretty well for translating stuff across many languages, but it only gives you a plain-text translated output without any PDF formatting/images/pages etc.

 I found a simple set of steps to translate PDF documents while preserving formatting, after trying various FREE options available online.

  1. If the PDF is password-protected, use to remove the password. If not, you can skip this step.
  2. Convert your PDF to Html using
  3. Download the generated Html and open it using Google Chrome.
  4. Right click in Google Chrome, and click "Translate to English". This will translate everything to English using Google Translate service while preserving formatting and images.
  5. Right click and "Save As" to save the translated Html to a folder (You can also save/print as PDF to get back in PDF format).
That's it. Furthermore, if you know CSS, you can use any CSS editor and change global CSS styles to adjust font size, colors, alignments etc. in order to fix any remaining formatting issues.

Sunday, January 6, 2013

The Path to OS Nirvana - Microkernels Vs Monolithic Kernels

The beginning of 1992 must have been a busier time period for pioneers of modern operating systems and other OS theorists around the world. The mail thread titled “Linux is obsolete” (1) spun off by the famous Prof. Andrew Tanenbaum attracted the attention of not only the main defendant, Linus Torvalds, but also of other renowned experts in the field at the time.

To give a little bit of background on the time period, it was a time when the now-ubiquitous CISC-based x86 CPU standard had a decent presence. RISC-based CPUs were taking off (at present, they are confined to mobile CPUs) and many people believed RISC is going to win over CISC-based systems because of obvious advantages (some theoretical, some practical). This bet, on which CPU-standard was going to become ubiquitous, seemed to have made pioneering OS designers pick sides; some on the x86 standard, some on the self-predicted transformation from CISC to RISC-based CPU architectures.

This created a divided landscape in the mindsets of OS designers at the time. Some needed to focus on catering existing software, run them on different and (possibly) free alternative platforms and on cheaper x86 machines. Others needed to forget the legacy systems and aim for a clean, sophisticated future in OS design by considering many theoretical aspects of OS design and the varying nature of CPU architectures.

Prof. Andrew S. Tanenbaum was a strong supporter of the latter group, where he created the Minix microkernel, mainly to demonstrate how an OS can be modularized so that each module of the OS is isolated, simple, and hence easy to maintain and secure. In the meantime, Linus Torvalds, came up with Linux, the free-and-open-source alternative to UNIX, (both, which are implemented as monolithic kernels) that could run the (still) wildly popular GNU software packages. Out of these two opponents, Linux started gaining popularity among the technical crowd. Tanenbaum, preferring the theoretical cleanliness for the future over practical use at present, pointed out that the monolithic design of Linux was the wrong way to go into the future and in fact, it was a step back into the dark ages of the past. This is the point where the famous debate between Microkernels and Monolithic kernels got started.

Who is right?

The answer to this age-old question might not be that simple, or there might not be an answer at all. Because operating systems are used for a wide range of purposes, designing the one best OS to suit all the use cases might not be possible. Therefore, rather than trying to provide a straight answer to this, it’s beneficial to understand the pros and cons of both OS design approaches so the best design decisions can be made depending on the situation.

Monolithic Kernels

In this approach, all the basic functions the OS designer thinks that should go into the core OS to help run application software are stuffed inside a single compiled module. To run the basic OS, only this module has to be run as a process. This means all the code that runs in the OS process lies in the same address space and any code within that process can touch any memory address belonging to the same process. This approach would be quite manageable if this was a simple application process. But since we are talking about a whole operating system, there’s tons of complex logic (Process scheduling, memory management, file system, device drivers etc…) residing on the same process, grouped only by functions. The operations of the functions do not have true isolation between them since they all execute on the same address space. Hence a bug in a kernel routine can affect the memory maintained by another routine and possibly crash the whole kernel.

In addition to this, one can argue (as Tanenbaum have done) that because of the large chunk of code it consists of, a monolithic kernel can be very hard to port to another CPU platform. But of course this can be resolved (as Linus mentions) by limiting CPU specific code only to core functions within the kernel, so the whole kernel doesn’t need to be modified when porting.

Another curse of a large interrelated code base is that there is no guarantee, that a modification to a certain kernel routine might not introduce a bug in someplace else. These are very hard to track because there is no isolation of access from one kernel function to another within the same address space.

On the plus side, writing logic inside a monolithic kernel is fairly easier because kernel module developers can work with shared resources and there aren’t many abstract layers to go through to achieve what you want to do. The truth is that when there aren’t too many abstraction layers, the easier it gets to think about the direct implementation details of the module you are working on. This also results in un-harmed performance because all the module switches and task delegations within the OS truly happen within the kernel itself without the need for any context switches at the CPU level.


Microkernels take software design principals very seriously and apply them in every part of the kernel implementation. Each individually identifiable logical unit is implemented as a separate binary/process. In this approach the actual kernel becomes very small (hence, the name Microkernel) and very simple without so much logic, because all the additional logic (the OS designer decides what logic is considered as ‘additional’ and what is considered ‘core’) is moved into their own processes. Only the core features are kept in the microkernel. When the OS is executed, only the microkernel runs in the kernel-mode. All the other supporting modules run in the user-mode providing increased isolation and security. The supporting modules may include a process manager, device drivers, file system and TCP/IP stack.

Although this design makes the kernel very secure and reliable, it is supposed to make the actual implementation and maintenance easier too. But the problem is that the separation of all the OS modules, calls for the need of communication mechanisms so that they can interact with each other and provide the full functionality of the OS to the application layer. Without such measures they absolutely cannot talk to each other or the microkernel because all of them lie in separate address spaces; hence no shared memory.

Every microkernel implementation (Minix included) has such IPC (inter-process communication) mechanisms in place. It is also true that any modern OS has IPC but they are mostly intended for passing messages between application layer processes. This is where one of the major gripes about microkernels arises. The fact is, the microkernel’s IPC module has to manage all the interactions between OS modules themselves and must do so in a way that would not affect the performance, security and the simplicity of the microkernel.

One can argue if IPC is good for application-layer processes, it should also be good for core OS components as well. The issue is that all the components of the OS are trying to work together as a single entity, to provide higher-level services to the application layer, there are lot of interactions between all the modules within the OS. The more the IPC is used for communication rather than shared memory, more visible the performance impact is.

Furthermore, since the kernel modules do not have direct access to any of the resources of the machine (or any other kernel functions), the implementation of the module becomes complex because of the need to think about IPC. Just as multi-threaded applications are harder to design and implement than single-threaded applications, designing your modules based on IPC is harder than using shared memory for communication. The problem is specifically apparent when an OS module needs to access a large portion of data which lies in the kernel memory (eg. An I/O read/write operation, which is a very frequent operation). Since the external OS module doesn’t have access to kernel memory, it has to inform the kernel (via IPC) to copy over the data to its address space so that it can modify the data. After it has completed the modification, it has to instruct the kernel again to copy over the modified data to the kernel-space and send the data via the required I/O channel. Of course optimizations can be made for such copy-operations but then comes data coherence issues. Radical OS design approaches such as Microsoft Singularity (2) overcomes this problem by transferring the ownership of data between processes but that is beyond the scope of this document. As Linus argues in his reply to (2), this defeats the goal of simplicity in microkernel designs. He quotes “All your algorithms basically end up being distributed algorithms”. In short, the restrictions imposed upon OS modules from the microkernel can be too much for the module to easily function as it needs, so it has to rely upon complex mechanisms to do its job.

Another area the microkernels try to excel is system repairability. Because all the OS modules are isolated, if one module crashes, it can be restored by a separate monitoring agent (in the case of Minix 3, by the reincarnation server (3)). This sounds good in theory but might be not so in practice. If an OS module is in the middle of something (eg. writing to an I/O channel) when it crashed, restoring the module might not make the whole system stable again. Theoretically, the crashed module is freshly running again and everything’s fine, but the I/O channel or some other module which was interacting with the crashed module might have been left at an unstable state. Hence, it might be practically impossible to maintain a fully stable OS environment, no matter how much you separate components.

Which is better?

As mentioned above, both OS design approaches have their own valid ideologies and pros and cons. Monolithic kernel designs takes a practical approach on accomplishing the OS functionality without introducing too much engineering complexity while sacrificing reliability and future maintainability. Microkernels approach the problem from a theoretical point of view where everything needs to be separated and isolated for sake of reliability while sacrificing engineering simplicity (although microkernels claim to be simple by design).

One can argue that either approach may seem to be too extreme and stuck inside their respective ideological aspects. Surely there should be a middle ground between these two worlds. Some commercial systems have taken this middle ground in an effort to leverage the best of both worlds by following a “hybrid” design.

Hybrid Kernels

Hybrid kernels try to balance-out pros and cons of monolithic and microkernel designs by flexibly organizing the OS components without sticking to one extreme design principal. In this approach all the crucial OS modules which would affect performance if they resided outside of the kernel, stay inside the kernel (rendering it a monolithic kernel). On the other hand, modules which provide application services are separated from the kernel and moved to user-space to increase reliability, giving the design, properties similar to the microkernel approach. This way OS is capable of giving priority to performance and reliability separately where they are needed most.


If the current operating system landscape was observed, one could see that there is no clear winner and it’s a matter of personal preference of the OS designer and the target market of the OS. Today, from the most popular operating systems in use, Unix and Linux follows a monolithic design (4) while Windows NT, Mac OSX and iOS follows a hybrid kernel approach (5). Each OS might have its own set of issues specifically because if its design, but these examples stand as successful and widely used demonstrations of both approaches. However, the lack of widespread success of a purely microkernel based OS might suggest that the world is not embracing the difficulties that are coupled with extreme reliability.

If you are an OS designer, which OS design to choose from depends on your priorities, and interests of the target audience. If you prefer a more stable, reliable OS with a beautiful design, microkernel is the way to go. But you must be prepared to cope with all the hassles that come with module isolation and IPC. If you prefer a balanced out approach to get the job done, don’t want to over-engineer things and deliver your product within a reasonable time period, monolithic or hybrid kernels might be a good choice. But you must be prepared to face the future maintenance problems and reliability issues that come with the lack of module separation.


1. Open Sources: Voices from the Open Source Revolution. [Online]

2. Can We Make Operating Systems Reliable and Secure? Tanenbaum, Andrew S., Herder, Jorrit N. and Bos, Herbert. 5, s.l. : IEEE Computer Society Press Los Alamitos, CA, USA, 2006, Computer, Vol. 39.

3. MINIX 3: a highly reliable, self-repairing operating system. Herder, Jorrit N., et al., et al. New York : s.n. ACM SIGOPS Operating Systems Review.

4. Monolithic kernel. Wikipedia. [Online]

5. Hybrid kernel. Wikipedia. [Online]

Special thanks goes to +Kasun Hewage for helping me revise some aspects of the article.

Sunday, December 25, 2011

iPhone 4S review from a Sri Lankan

Hi all. In case you wandered here to know all the details about the Apple's new iPhone 4S, this is not the place. This is not a complete product review, but a review on how the product fits into my needs. You can find lot of quality iPhone 4S reviews on the web. My intention is to articulate how the 4S performs in conditions specific to Sri Lanka and the drawbacks Sri Lankan users might face.

I got this phone from Singapore. iPhone 4S Factory Unlocked 16GB Black version running iOS 5.0.1. This was a huge upgrade for me as I was using a 2007 iPhone model for the past 3.5 years.

Support from Sri Lankan service providers
If you intend to bring an iPhone to Sri Lanka, you have to get a locked iPhone and unlock it, or get a "Factory Unlocked" phone to use with any local mobile service provider. Locked iPhones are cheaper compared to factory unlocked ones. But locked iPhones are very hard to unlock. So if you bring a locked iPhone here, you might have to wait weeks, or even months until a software unlock becomes available. So I recommend you buy a Factory Unlocked iPhone if you are planning to bring an iPhone 3GS/4/4S into Sri Lanka.

Micro SIM
iPhone 4/4S only support Micro SIMs which are smaller than ordinary SIMs. There's no technical difference between these two. Micro SIMs just don't have extra plastic padding around the golden plate. You can either cut it using a SIM cutter (or get help from a local phone shop to cut it) or buy one from your service provider. Mobitel offers Micro SIMs for Rs 200/= for existing users, Rs 400/= for new users.

If you cut your SIM yourself like me, remember to keep the extra plastic frame that remains after cutting. You'll need that to re-assemble your SIM in case you need to use it with some other phone.
My old SIM (on left) after cutting it, shown with an ordinary SIM (on right)
User experience
Combined with Apple's thoughtful UI design, optimized OS and the speedy processor, iPhone 4S provides a crystal clear UI navigation with no hiccups at all. It's absolutely flawless and blazingly fast. You don't feel like you are using a UI of a computing device because when you do stuff on the screen, everything happens so fast and smooth without any response delays. It's flying in the breeze!

Even though it's still in beta, Siri is the most advertised feature of the iPhone 4S. For users in US and other western countries, Siri seems to work well. Personally, I don't have many of use-cases for Siri that are being advertised, but some Sri Lankan buyers might be tempted to buy an IPhone 4S just because of Siri. If you fall into the later category you might be disappointed.

Siri didn't recognize most of the things I said. I'm a Sinhalese with the typical English accent of a Sri Lankan. Siri was completely confused and answered incorrectly or told that she didn't understand me for most of my questions. Some things worked, for example Siri understood my question "What is the population of Sri Lanka?". Occasionally, she also succeeded in setting up some alarms and meetings for me. Voice dictation for typing text got most of the words wrong, making it impractical to use Siri to type SMS and Notes.

Calling a contact via Siri also failed in numerous ways. Most of the time, she tried to call the incorrect person and every time she tried to make a call (correctly or incorrectly), she ended the call apologizing "Sorry, I cannot call person X".

Overall, Siri's voice recognition for me, was inconsistent and practically unusable. Technically, Siri's response time was acceptable over both my ADSL connection (WiFi) and Mobitel 3G. (For those who don't know, Siri needs an internet connection to function. Siri sends your voice to a server and it's the server which handles voice recognition.)
Voice Control
Fortunately, Siri can be turned OFF (Settings -> General -> Siri), at which point the old Voice Control feature that debuted with iPhone 3GS, will get activated. Voice control doesn't need internet but it's very limited in its feature set. For me, the features provided by Voice Control was mostly enough so I used that instead of Siri. If I could call a person and play songs while driving, that's fine for me. But I'll miss the SMS read/reply feature which only Siri is capable of.

I found out that Voice Control is far superior in recognizing my commands than Siri. 90 - 95% of the time, Voice Control called the correct person I told it to and played the songs I wanted. All without internet. This is somewhat understandable since Voice Control has a narrowed down search criteria (My Contacts and Song library) to match my Voice input with. So for the moment I'll stick with Voice Control, although I cannot read/reply to SMS while driving without Siri.

Both Siri and Voice Control can be brought up by a long press of the middle button in the hands free kit so it's easily accessible even when you are driving. Here's a comparison between Siri and Voice Control from my experience

Sinhala/Tamil Typing and Fonts
iOS 5 includes Fonts required to display Sinhala and Tamil content on the web. (Tamil was available way earlier than iOS 5 as I remember). But there is no way to type in Sinhala or Tamil. You can copy Sinhala text from a web page and paste it in text boxes (As shown in the image) but you cannot type things on your own.

As a workaround, you can use Google Transliterate to type your Sinhala/Tamil content and copy it to the place you need. You can also use Sanhinda free app (Sinhala only) from AppStore which I think would be better than the web based Google Transliterate. I didn't use the Sanhinda app yet but I found that the UI in Google Transliterate is fighting with iPhone keyboard, and it is not optimized for a mobile browser. So, being a native app, Sanhinda should do better.
The ideal solution would be a Sinhala keyboard which is accessible from anywhere in the system. But this is one of those drawbacks iOS has over Android because Apple doesn't allow third-party custom keyboards on iOS.

Phone Number Formatting
As with every iPhone OS version from 1.0, iOS 5 suffers from the inability to properly recognize Sri Lankan phone numbers. It can recognize incoming calls and match it up with your contacts but it can’t do the same with SMS. Since incoming SMS phone numbers are like +94714123456 (with +94 in front), it won’t match with the corresponding contact if you have stored the number as 0714123456 (with 0 in front). To recognise SMS numbers, you have to add an extra entry with +94 format for the same person. This problem occurs the other way round too. If you have stored a number in +94 format, the phone won’t recognize incoming calls from that number.

Unfortunately there’s no fix for this until a Jailbreak comes up. Still there’s no jailbreak for iPhone 4S with iOS 5.

iPhone 4S camera is insanely great for photo taking and video recording. Apple has done much more than upgrading the Camera sensor to 8 Megapixels. You can take photos in a blink, there's no delay in taking the photo and saving it like you see on other high-end phones. Tap the button and boom! the photo is saved.

I won't go into detail explaining the picture/video quality and camera features (you can get that info elsewhere). I'll just say it's simply awesome!

The only thing to keep in mind is that if you have a 16GB iPhone 4S, you'd better watch your free space when you are recording video heavily. For a one-minute video, iPhone 4S will consume more than 170MB of disk space. This is because iPhone 4S records video in 1080p resolution, which has a very large video frame size. With iPhone 4, it was 720p and the files size was around 80MB per one-minute video. So with iPhone 4S, the file size is more than doubled. In the built-in Camera app, there are no settings to reduce the video quality (third-party camera apps might allow that). So if you are a looking for an iPhone 4S mostly to do video recording, I recommend you get a 32GB or 64GB model.

Another notable fact is that you also need a somewhat-powerful computer to play videos recorded by iPhone 4S. A computer which is few years old might not be able to play the recorded videos smoothly. In addition to that, if you are a Windows user, you need to use Quick Time to play the recorded videos or have the correct software codecs to play them in Windows Media Player or any other player. Keep in mind that the video frame size of a 1080p video (1920 X 1080) is actually bigger than the full resolution of most common 17-inch monitors we use. So your computer really needs decent graphics processing power to play 1080p videos.

The phone’s signal reception (Mobitel) was pretty good. I used it in Kottawa and Meepe. In Meepe we usually get 1 or 2 Mobitel signals, but the phone still managed to provide fast 3G internet for me.
Here are the SpeedTest results for different connections I used.

Battery Life
This is one of the most important concerns of any phone user. So how does the iPhone 4S perform in this regard? In a nutshell, I can say the iPhone 4S battery is pretty strong and it lives up to consumer's expectations.

I didn’t carry out a technically-timed benchmark of the battery. But here are my general experience concerning the battery.

My friend in Singapore who bought my iPhone 4S had it with him for almost a month in its original packaging. He got it on 30th November. When I opened the box on 23rd December morning, the phone had around 75% of battery left. Yes, the phone was completely OFF while sitting in the package, but I think having 75% of battery, more than a month after leaving the factory, is impressive.

Straight away after opening the box, I proceeded to put to my SIM in and activated the phone via 3G, without charging the phone. We played with it for a while and made a few phone calls (all from that initial 75%) and the remaining battery was only slightly reduced.

On the same day, I charged the phone to 100% by mid day. And after lot of playing and experimenting, it had 77% battery left when I was going to sleep that night. In the next morning, it had 68% battery left (9% drop overnight). Starting with that 68%, after the first full day of very heavy use with occasional charging (when syncing via iTunes), the battery died around 7PM. The last 1% of the battery, I used for 30 minutes of constant gaming and playing videos (without headphones) with the intention of draining the battery. I also observed that the wall charger charges the phone from 0 – 100% in around 2 hours.

Here are the list of things I did throughout the day. Remember, this is my first new iPhone after 3.5 years, so I had a lot to do with it on its first day.
  • Lot of camera activity (Experimenting with auto focus, Macro photography, lots of photos and videos)
  • Lot of experiments with Siri and Voice Control
  • Lot of internet activity (WiFi and 3G) throughout the day (Reading articles, YouTube, Facebook, Twitter)
  • Playing Games
  • Reading books (Lord of the Rings. I recommend you read it starting with ‘The Hobbit’ if you haven’t already.)
  • Playing songs and videos (without headphones)
  • Occasionally making calls and SMS
  • Occasionally plugging into iTunes for syncing apps and videos (This charges the phone battery)

Maybe the reason I had a very decent battery life out of iPhone 4S even while in heavy use, might be because I was a conservative resource user. Here are the list of phone features which were turned on/off.
  • 3G was turned OFF when WiFi was available.
  • 3G/WiFi was turned OFF when I’m not using the internet (eg. when playing games, Camera activity)
  • Location Services (GPS) was ON the whole time.
  • iCloud syncing was ON.
  • Push Notifications completely OFF.

I recommend you turn off 3G (Settings -> General -> Network -> Cellular Data) when not using internet in order to save your phone bill. I don’t care about push notifications so I kept it off and that would have made an impact on the battery life if I hadn't done so.

So overall, it seems the iPhone 4S can get an ordinary smartphone user easily through the day without being recharged. It might be the case that the battery is still new and the battery life might change over time. Other users might also experience different battery life depending on the usage. But I’m definitely impressed with the battery life I got.

Damage Resistance
iPhone 4 and 4S are like delicate flowers because of their glass front and back. They make the phone a beauty but they can easily be cracked if you drop the phone on a hard floor. So I recommend you use iPhone 4/4S with a proper casing. The phone’s structure is very strong (you can feel it when you hold it). Nothing will happen to the phone internals if you drop it (I didn’t test it though), but the glass panels will crack making the phone unusable until you replace them. My friend from Singapore said Apple doesn’t give warranty for iPhones with cracked glasses.

Overall, I’m very impressed with the iPhone 4S, specially since I have been using an old 2007 iPhone for a long time. But for iPhone 4 owners it’s not a worthy upgrade. As with all Apple products, the delight of the iPhone is not in the specification sheets, but in actually using it in your day-to-day life. The issues that exist, are there because of the region we live in, which is still not fully supported by Apple. (Built-in support for Sinhala fonts is a step in the right direction)

So I hope this article aided prospective iPhone buyers in Sri Lanka. Please leave a comment if you have a personal observation or a tip that might help other users.

Monday, January 18, 2010

Fix for Windows Vista/7 blank "Windows Features" dialog box

Recently when I accessed Windows 7 "Turn Windows Features on or off" (Control Panel -> Programs) option it just gave me a dialog box with a blank list. Normally you would get something like this:

But what I got was the same dialog box with a blank list. It displays "Please wait..." initially but the list doesn't appear afterwards. This is a problem known by Microsoft, but the solutions they have provided DON'T WORK!

I found this nice article mentioning the same problem and I fixed the problem according to the instructions given there. Visit FIX Blank or Empty List in Vista Turn Windows Features On or Off (OptionalFeatures.exe)

You have to download and run a tool from Microsoft and act according to the log it produces. Procedure is the same for Vista and Windows 7. Just make sure to download the correct version of that tool for your OS.

Tuesday, December 29, 2009

Things I hate about Mac user interface

Apple MacOSX is known for it's aesthetic interface. During the time that I've used MacOSX I've realized that it is true indeed. Nevertheless Apple's minimalistic approach haven't included some of the most basic UI features into the operating system. I may be missing them probably because I've used them so much in Windows and a long time Mac user may have a different idea. Anyway these facts will be useful for any Windows or Linux user joining the Mac bandwagon.

No "Print Screen" key

In Windows you can press PrintScreen key in the keyboard to capture the whole screen ot Alt+PrintScreen to capture the current window. In Mac keyboard there's not such key and you have to do it using a built-in screenshot utility.

Cut-and-Paste missing in Finder

Windows Explorer equivalent in Mac is Finder. It does not have cut-and-paste functionality for file manipulation. Only thing you can do is copy-and-paste. So Cut is missing from right-click context menu and keyboard shortcuts. (Cut-and-paste IS available for clipboard operations)

"Paste" menu item will appear after you have copied a file.

No separate keys for Delete and Backspace

Mac keyboard has only one key for both delete and backspace functionality. You'll initially be confused by it's behaviour. The key is labeled "delete" and placed where the backspace key is on Windows keyboard. Although the key is labeled "delete", by default it has the backspace functionality. To get the the "Delete" functionality you have to use Fn+Delete.

Finder does not support the delete key for deleting files either. You have to right click and say "Move to Trash" or drag the file into Trash. No Shift+Delete is present either :-(

No option to show Hidden files

Finder doesn't provide any option to show/hide hidden system files. If you want to view hidden files you have to manually edit a configuration file using a command line utility and restart Finder process.

defaults write AppleShowAllFiles TRUE
killall Finder

To stop showing hidden files again, use the same commands with the value FALSE instead of TRUE.

"Maximize" button behaviour

Maximize button in applications have different behaviour depending on the application. This is pretty confusing. The expected behaviour is fill the screen with the current window. But some applications doesn't follow this rule. Most of them just resize the window a little bit more instead of fully resizing. Safari, MS Word and Finder does this.

iTunes will go into the compact mode when you press the Maximize button, contradicting with the '+' sign representing the icon!

Window edges cannot be used to resize windows.

In Windows, you can use any of the four edges of a window to resize it. But in Mac, you always have to use the lower right corner of a window to resize it.

I think that should be enough for now. There maybe some more things to complain about, but I don't remember them now. Regardless of these shortcomings there are so many things to love about MacOSX! and what's my favourite operating system?? Windows 7! without a doubt!

Tuesday, December 15, 2009

Connecting a Mac to an Active Directory domain

These are the steps you should follow in order to connect MacOSX to an existing active directory domain. I tried this using MacOSX Snow Leopard 10.6.2. The domain server is Windows Server 2003.
  1. In the Mac, go to System Preferences -> Accounts
  2. Click the lock icon to unlock it and enter the admin password to gain access to administrative settings.
  3. Click "Login Options"
  4. Under "Network Account Server", click "Join"
  5. In the popup, click "Open Directory Utility" and make sure all the tick marks are checked.
  6. In the "Server" field, enter the server name (without "\\" or anything) which is hosting the active directory service.
  7. If it finds the server, it will ask you for the information shown below:
  8. Make sure to use the client computer ID that your administrator has given.
  9. Enter the correct details for the settings and click OK.

To login as a domain user, enter the user name in the usual domain\username format in the MacOSX login window.