Bootstrapping Synology DiskStation – Unleash The Power

Synology disk station comes locked and does not allow any modifications as it comes out of the factory, however there is a healthy community supporting the boot strapped operations. Bootstrapping is required to install additional packages on the server, other than the default packaged ones, which I should say are not any less.

Let’s start!

1. Bootstrapping program is dependent on the type of CPU on your disk station. See here to find your CPU Type.

2. Make sure the disk station has the login over SSH enabled.


3. Login to your disk station over SSH (I use putty) as root. Enter your admin password when prompted.

4. Change to the @tmp directory.

5. Download the bootstrap file for your CPU to the @tmp directory using wget. The example below is for the CPU type ‘Marvel Kirkwood mv6281 ARM processor’. Please find out the bootstrap file for each CPU type from the page Overview on modifying Synology server.

7. Change the bootstrap file permissions, so that it’s executable.

8. Execute the bootstrap file

9. Now, comment out the PATH and EXPORT in the .profile file and save.

10. Reboot the disk station.

11. Login to the disk station using SSH as root.

12. Update ipkg list. ipkg is the default package manager.

13. Install coreutils

14. Check what other packages are available to install

15. Check what packages are already installed through ipkg

At this point, you have all the software installed to add other packages and make any changes to configure the disk station as required.

Have Fun!

Install SCP

DSM 4.0 disk stations do not have SCP installed by default. I find SCP to be the easiest for copying files to the disk station. Moreover, if you are setting up public/private key authentication for password free authentication, the arrangement works very well with SCP, allowing, say a backup program, access the disk station without having to know it’s password.

1. On the disk station, change to @tmp directory

2. Get the OpenSSH package

3. Un-package

4. Inflate the tar file

5. Copy the binary to the bin

SCP is now installed, give it a spin!

Windows Phone 7 & Windows 8 Metro Apps

Given the differences between the Silverlight on Windows Phone 7 and XAML for WinRT on Windows 8, I thought it will be interesting to see what the differences are between these two platforms.

A few days back I wrote a quick and dirty application for checking weather forecasts for a given location in Windows Phone 7. It is a very simple application, however I was curious if I can use the same code base for WinRT metro apps on Windows 8.

Namespace and Base Page

The Windows Phone 7 controls reside in the namespace ‘Microsoft.Phone.Controls’ and the controls for Windows 8 XAML metro apps reside in ‘Windows.UI.Xaml.Controls’.

The pages for Windows Phone 7 pages derive from PhoneApplicationPage, whereas the metro apps derive from Windows.UI.Xaml.Controls.Page.


The user interface controls for both Windows Phone 7 and Windows 8 metro apps are implemented in different namespaces, however they are very similar and are mostly reusable.

The same XAML may conform for both platforms, however Windows 8 are slated to be used on screens that are bigger like a tablet or a PC (and sometimes much bigger like a TV screen). So the applications may be better off if the user interface design for metro apps can utilize that larger real estate.

My sample application for Windows Phone 7 was using the ‘WebBrowser’ control, but I couldn’t find this control in the metro apps. However, a very similar control called ‘WebView’ is present in Windows.UI.Xaml.Controls namespace.

There are some minor differences in the implementation, but I was able to replace the WebBrowser control with the WebView control without much effort.


Windows 8 Target Screen Sizes


Visual Studio 11 for Windows 8 also allows  designing applications for different target sizes, as the target can differ from a wide variety of screen sizes.

1366×768 is the minimum resolution required for all metro apps. The designer having this ability to set various screen sizes is a great boon for the developers in knowing before hand how the XAML markup will render in the supported screen sizes.


The designer also supports setting the user interface as portrait mode.win8_vs2011_weatherwatch_designer_portrait

WebClient API is not supported

The sample application in Windows Phone 7 used WebClient to pull weather data from yahoo, but WebClient is not supported in WinRT. However, HTTPWebRequest class is supported in WinRT. In fact, this is the only web request API supported in WinRT. HTTPWebRequest is also available in Windows Phone 7. See my previous post about WebClient vs HTTPWebRequest in Windows Phone 7 here.

The final application on WinRT


With the very limited functionality I was testing, most of the porting was smooth, except for the surprise that WebClient was not supported.

As for user interface, even though most of the XAML could be reused, I think it is to the benefit of the application that it be designed specifically for the screen sizes they are targeted for.

So, can applications have a common code base for both the platforms? If the applications are layered properly using the MVVM (Model-View-View Model) pattern, the ‘model’ and ‘view model’ can have a common code base, whereas the ‘view’ can benefit from being separate at least for some of the applications.

Experiments with Windows 8 Consumer Preview

win8_start_screen_1I finally got a chance to install Windows 8 and take it for a test ride. Having installed the Windows 8 Developer Preview which came out last year, the Windows 8 Consumer Preview is much more stable with very few visible bugs.

I followed the excellent instructions provided by lifehacker to boot Windows 8 side by side with Windows 7, which is already running on my laptop. If you are not familiar with partitioning your hard disks, be very careful while trying to dual boot as choosing the incorrect partition can erase your existing installation.

On the Start screen, all the applications are shown in what are called ‘Tiles’. If you are familiar with the Windows Phone interface, it looks much similar.

Desktop is provided as an ‘app’, which takes the user to the much familiar PC interface that most PC users are familiar with. Desktop looks much similar to a Windows 7 screen, but ouch, where is the start button? Pressing the Windows Key on the keyboard takes the user back to the start screen with ‘Tiles’.

At present there are not many apps to boast about in the marketplace, but I expect this situation to change as more and more developers start publishing their apps to the marketplace.

Some applications that have already got some traction in other platforms like ‘Kindle’ and ‘Cut The Rope’ are already in the marketplace.



Corner Quick Menus

From a touch interface, one can slide from side, the top, bottom etc. but doing that with the mouse is not going to be very easy. As per Microsoft, one can move the mouse effortlessly to each corner of the screen and this is where some of the Windows 8 menus pop out from.

Move the mouse to the bottom left corner, the start menu pops out. Click on the start menu brings the user right back to the start screen. Pressing the windows key on the keyboard also has the same effect.


Moving the mouse to the top left corner brings out the application bar with a preview of all the running applications. This is a very quick way to switch between currently running applications. Equivalent keyboard shortcut is Windows Key + Tab.



Windows Charms

Windows 8 has implemented something called ‘Windows Charms’, which is a quick menu that is available for all the applications. Move the mouse to the top right corner to access the Charm.


In the charm bar, there are buttons like Share and Search, which each application can utilize accordingly.

Keyboard friendly as it is touch friendly

It is primarily touted for touch interface devices, however almost all the ‘goodness’ of Windows 7 keyboard friendliness have been retained.

Windows 7 users will find many of their favorite shortcut keys working on Windows 8 including the Alt+Tab combination for switching between the applications.



Task Manager

Task Manager is greatly enhanced and now has a sporty user interface.


A great additional feature that has been added is that now it can track CPU, memory and bandwidth usage of applications over a period of time. On mobile devices where internet usage is metered, this can come in handy to find out what applications are eating up the most bandwidth.



Compatibility with existing hardware

The web installer runs a compatibility checker before installing Windows 8 to verify if the existing hardware and software is compatible. Interestingly enough, the only incompatible application that was found on my computer was the ‘Security Essentials’ anti-virus software from none other than Microsoft itself.

NVIDIA Drivers

I noticed one problem after installing the Windows 8, it was not detecting the NVIDIA graphics card. My laptop has a NVIDIA GeForce 210M. NVIDIA has released the drivers for Windows 8 32-bit and 64-bit, however some laptops like SONY VAIO require to get these drivers directly from SONY instead of NVIDIA. Installing the drivers from NVIDIA was stopping at a point where it suggests to contact the laptop manufacturer to provide the drivers. However, SONY has not released the NVIDIA drivers for their hardware yet. argh!

Considering that most of the underlying stuff in Windows 8 is carried forward from Windows 7, I wanted to try installing the NVIDIA Windows 7 drivers on Windows 8. How bad can it get? The worse case scenario would be for me to re-install Windows 8.

I took the gamble and installed the Windows 7 64-bit NVIDIA drivers provided by SONY and voila! it worked like a charm!

(Install at your own risk)



All in all, it is a bold new endeavor and is certainly fun to use. Even though it looks very promising, it remains to be seen how well the marketplace develops which is a crucial factor in the success of Windows 8 on touch interface devices.

WP7: Checking Weather Forecast Using YQL

I touched upon yahoo query language (YQL) interface in my last post. Today, I will show some quick practical uses of YQL and demonstrate how easy it is for the programmers to tap into this information.

For today’s example, we will examine the table named ‘weather.forecast’, which is available in the YQL interface.

Head over to the YQL Console to examine the parameters to be used for ‘weather.forecast’.


As shown in the screenshot, there is one parameter named ‘location’ that is required for querying data from this table.

The complete URL would look like below:*%20FROM%20weather.forecast%20WHERE%20location%3D%2263126%22%20%20&diagnostics=true

Windows Phone Application

Create a new ‘Windows Phone Application’ project in Visual Studio.


Preparing the User Interface

The user will provide the location for which the weather forecast is to be displayed as input.

For this, I added a horizontal StackPanel with a TextBox and a Button into the MainPage.xaml.

For displaying the results, I used a WebBrowser control, as some of the data for ‘weather.forecast’ is returned as HTML.

The XAML listing for the UI is here:

Getting data from YQL

The user enters the zip code for which weather forecast has to be displayed and press on ‘GO’ button.

The program takes this location, construct the correct URL and make a web request to retrieve the data from the internet.


Windows Phone SDK provides two options to make a web request and get data from the internet, WebClient and HTTPWebRequest. See here for more information.

For this example, I used the WebClient API for it’s inherent simplicity as this is a post more to demonstrate the YQL than about performance.

Since the program did not specify a output format, JQL returns XML by default. The output format can be specified as JSON by adding  parameter to the original URL.*%20FROM%20weather.forecast%20WHERE%20location%3D%2263126%22%20%20&format=json&diagnostics=true

Parsing the XML is made simpler by the XDocument class provided in the System.Xml.Linq namespace.

Displaying the results

WebClient returns data on the same thread, so it can directly access the UI elements. On the other hand, HTTPWebRequest returns data on a different thread and the result has to be marshaled back to the UI thread. Since data is returned on a different thread, HTTPWebRequest has the advantage of not locking up the UI thread when it is processing.


The complete MainPage.xaml.cs code behind:


YQL or Yahoo Query Language allows developers to query, join and filter data from multiple data sources on the web who have made their data available through the YQL interface. Since YQL is an expressive SQL like language, developers familiar with the SQL interface should feel comfortable with the interface.

YQL provides the developers a consistent way to access online services which are otherwise dispersed across a range of formats. It hides the implementation of the various data sources on the web and make it easier to query the data.

YQL is both a service and a language. The service is through which external web services can make their data available for developers to consume through the yahoo query ‘language’.

Understanding the language of YQL

If you are familiar with the SQL, you will feel at home with YQL. This language allows developers to use SQL syntax to extract data from the service. It can return the results in either XML format or in JSON format.

Yahoo has provided a YQL Console for developers to test their queries.

For example, if the application wants to search from YouTube and display a list of results, the developer can use a simple query like below and get the information from the web service.

The output of the above query in XML format is below. Adding ‘limit 1’ will limit the output to the top 1 result.

Similar to SQL, YQL also let the developer query for individual columns. The developer can limit what is returned from the service by specifying the data that should be returned as in the below example.

Which returns just those 4 columns that are requested.

Using the YQL Service

Let’s look at the usage of these services. Let us say, for example, an application wants to list out the current popular music charts.

Head over to the YQL Console and put your query as below:


Click on TEST button. The console will show the output in the format that you selected, either XML or in JSON format.


Once you are satisfied with the results, head to the bottom area of the console to grab the complete URL.


The resulting query:*%20FROM%20music.artist.popular%20limit%205&diagnostics=true

The application can post this query to get the response and the response being in XML or JSON consistently across the web services makes this interface very luring to use.

Other Useful Links

Complete YQL Documentation

YQL Screencast from the Yahoo! Developer Network

WP7: WebClient and HTTPWebRequest

Windows Phone 7 SDK has provided two classes for consuming resources from the web. WebClient and HTTPWebRequest.


HTTPWebRequest is a low level API for web requests. Unlike WebClient, it allows to tinker some of the HTTP aspects like cookies and user agent.

One major advantage of HTTPWebRequest is that it returns on another thread, which comes in handy for large web requests. It will not lock up the UI thread allowing the UI to remain responsive during the request. Since the response is returned on another thread the program should marshal the response back to the UI thread.

HTTPWebRequest is created by the static method HTTPWebRequest.Create().

Call the EndGetResponse() to get the WebResponse, which will contain the stream to read the response.


WebClient is a higher level abstraction of the web request. It wraps the HTTPWebRequest to provide a more easier API to make web requests.

WebClient has a built in mechanism to report progress of the request in percentage. WebClient runs on the same thread, so programs don’t have to use the dispatcher to pass data back to the UI thread.

However, since the WebClient runs on the UI thread, it can make the UI unresponsive if the program makes a long running web request.


I think there is a place for using both the classes. Being aware of these differences helps to choose the best one for a given situation.

Source Code Highlighting in Windows Live Writer

When I first started posting code to the site, it took me a while to format it correctly, until I realized there are many plugins available for automatically doing this. When I was using a self hosted WordPress site, I could install plugins or insert a custom css to format the code block like I want, but I soon found out that was not the case for sites as there is no control to install new plugins or change the CSS.

However supports a short code for highlighting sourcecode.

A quick search for Windows Live Writer plugins that support this short code turned up many. I tried a few of the code highlighters and finally settled on the one posted by Rich Hewlett called WLW Code Plugin.

A C# code would look like below:

UPDATE: I have now stopped using this plugin as I prefer the plugins that use the ‘<pre>’ tag which is more standard and backward compatible.


Windows Phone 7: Navigation

Web developers will find themselves in familiar territory with the navigation in Windows Phone 7.

NavigationService Class

Navigate to another page:

Navigate to another page (with parameters):

NavigationContext Class

If a parameter was passed to the destination page using query string, NavigationContext class allows to read the query string as follows

Navigation History

Navigation history is exposed as a read-only enumeration through the property called NavigationServices.BackStack,

There are additional methods exposed for going back and forward one step at a time. It is a good practice to check for the CanGoBack and CanGoForward property before calling the navigation methods to make sure there is more in the history to go back or forward.

A Free and Effective Anti-Virus Software

‘Microsoft Security Essentials’ has been around for quite some time in different names (Microsoft Defender being its previous incarnation). Now it is available for free from the Microsoft site.

Microsoft is not probably the best when it comes to protecting the computer from viruses, at least traditionally. Norton and McAfee dominates this space.

When we migrated our operating system to Windows 7 last year, I decided to give Microsoft Essentials a try for a few months.

I downloaded it from here or click on the below image to go directly to the download page.


The installation is quite smooth. It is better not to have other anti-virus / anti-spyware programs active when you install this. If you have other anti-virus programs installed, disable it before you install this.

I like its clean look. There are not too many options to mess around with, which makes it easy to use in my opinion. There really is nothing much to do from the user once it is installed.



The virus definitions are updated online automatically. The virus definitions appear to be updated very frequently, I see it getting updated every day or so, which I think makes it effective.



See the settings page in the screenshot above. I like the fact that the CPU usage can be limited during a scheduled scan. This really helps when a scheduled scan is kicked off when you are in the midst of doing something else and the scan eats up most of the CPU-cycles which in-turn slows you down. By limiting the CPU usage to 50% or even less, your activities on the computer will not be hindered when a scheduled scan kicks off.

I have used it for more than an year now and am very satisfied with it. Again, you really cannot rate an anti-virus unless it gets hit by a virus and see how effectively it handles that virus. But the fact that I have not been hit by a virus so far makes this anti-virus effective for me at least until now.

Internet Explorer 9: A better browser than earlier

ie9It was not long before IE6 ruled the landscape and had complete market domination. IE6 did not follow the web standards and developers were having a difficult time developing web applications that work seamlessly on IE6 and Firefox. But then came along Chrome, which tilted the balance towards web browsers that followed the web standards like Firefox.

Microsoft quickly went to damage control mode and released IE7 where they fixed some bugs. IE8 was released by Microsoft in quick succession which fixed more compliance violations, but not all. Then came IE9 where they follow most of the standards and added support for newer standards like HTML 5.0 specification.


Even though I use Firefox exclusively, I recently installed IE9 on my Windows 7.0 computer to see how it fared.

The installation was very easy. It was a one click install.


As with most Microsoft installations it required a restart at the end.


Being a web developer myself, I have to deal with different web browsers and different versions all the time. IE9 amazed me, it fared almost on par with Firefox on user experience, if not a tad better.

The user interface is very minimalistic like Chrome and now Firefox 4.0. See a screenshot below. It is much easier to use than any of its predecessors. A good job done by Microsoft.

Browser Wars

All the 3 major browsers, IE9, Firefox 4 and Chrome are has done very good and is improving with every version (I left out Safari explicitly, as I have never used it on a Windows machine.).

Here’s a benchmark study conducted by CNET recently with these 3 browsers:

Chrome 10 IE9 Firefox 4
SunSpider 0.9.1 (ms) 336.20 250.60 292.37
Kraken (ms) 8,806.30 15,606.77 7265.13
V8 v6 (higher is better) 5,173.67 2,235.33 3540.33
JSGamebench 0.3* (higher is better) 322.00 1,156.00 1,482.00
Boot time (s) 26.22 21.86 17.80
Memory (kb) 390,532 205,616 148,020

Credit: Chart by Seth Rosenblatt/CNET

See the full report here.