How to burn an image file to USB in Ubuntu Linux?

November 25th, 2009 Sarath Comments

This is a quick tip. In Windows, we’ve lot of free and paid alternatives to write an image file to USB device(e.g ImgBurn, Win32DiskImager). Let me explain my requirement. If I get a bootable ISO image file of an operating system like Ubuntu or moblin how would you do that if you’re in a Linux environment? A byte-exact copy of the ISO image must be placed on the USB drive. It is not sufficient to simply copy the image file to the drive.

It’s quite simple to do that

unmount the USB device if it’s automatically mounted to the system.

Step 1

You can either use # umount <usb-drive> command or directly unplug using your nautilus file manager(windows shell equivalent)

Step 2

Image Writer is a small python executable script that detects your USB drive and writes the image to it. The advantage of using image writer is that it will not inadvertently overwrite your system hard drive. Download Image Writer. Navigate to the desired location where you kept the image writer and change its permission to execute.

# cd <directory with downloaded image-writer file>
# chmod a+x ./image-writer
# ./image-writer <image file>

Now you’re done!

There’s a alternative method using ‘dd’ which you can see in the following link. But it’s very risky. It may erase your whole system files if it’s not used carefully.

Source: moblin help

Categories: Linux, Tips, Tools Tags: , , , , ,

How to fix mt.exe : general error c101008d ?

November 24th, 2009 Sarath Comments

Those who developed a window based (native C/C++) application using Microsoft Visual Studio 2005 or above might have experienced an error similar as follows.

mt.exe:general error c101008d:Failed to write the updated manifest to the resource of file "some_sample.exe/dll". The process cannot access the file because it is being used by another process.

and if you build the exe again(or link again) it may get succeeded?,

What does this indicate? How to fix this issue?

The fix is very simple, disable your antivirus scan and try the build again (DO THIS AT YOUR OWN RISK. DON’T BLAME IF SOMETHING WRONG HAPPENS). Probably you wont face this issue anymore.

The reasons for this issues are.

Your anti-virus program is always vigilant on the executable files written in your system. So once your linker generates this exe, the file will undergo strict scanning by your anti-virus scanner if it’s active. During the scan time, the file will be exclusively locked by the anti-virus program.

The error you’re seeing about embedding manifest to the exe. Embedding manifest is not part of compilation or linking. You can embed manifest to any executable using the manifest tool (mt.exe). See How to embed a manifest in a C/C++ application.

mt.exe –manifest MyApp.exe.manifest -outputresource:MyApp.exe;1

or

mt.exe –manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2

the suffix “1” is for exe and “2” is for dll. This process is automated in Visual Studio (See, manifest generation in Visual Studio ).

Once the exe is written to the disk, visual studio will execute the next step using mt.exe to embed the application manifest in to it, but this time the file will be exclusively locked by antivirus which cause this error. if your antivirus lightning fast to scan the exes, you wont see this error.

This kind of error are quite easy to get in clear-case networks where the files in the views are access slightly less speed than a normal disk drive. In that case the antivirus program may take a bit more time completely scan the executable.

How to Install Google Chrome OS with VMWare?

November 23rd, 2009 Sarath Comments

Hope all of you heard of release of Google Chrome OS.

It’s light weight open source operating system which designed to work with web applications. If you want to know more about the project you can visit their official website( chromium.org) . So that I can keep this post as simple as possible. If you want to know about Google Chrome OS in 3 minutes, you must watch this video!

Before starting I must say that, YOU MUST HAVE AN INTERNET CONNECTION TO GET THINGS GET GOING! (I hope it’s already there as you’re reading this blog!)

To install google chrome there are two different ways.

  • Prepare a linux installed machine
  • Get the source tarball and build tools
  • Build the source (takes around 10gb of your HDD).
  • Create the chromium image and install it. Details can be found here

You can install the image natively in a machine or you can install in a virtual machine. VM’s are a bit more convenient as you PC is not all affected whatever do in that.

The second way is more simple. As someone already took all the pains to download and build the source and prepared the OS image.

I am approaching the second method which is more simple and convenient.

  1. Visit http://gdgt.com/google/chrome-os/download/
  2. Download the OS image (You may need to create a login for downloading (you can also use your facebook to authenticate it.
  3. Get VMWare Player from VMWare website.
  4. Install VMWare Player
  5. Unzip the vmware virtual disk image (vmdk) you’ve downloaded from gdgt.com

There you go. You’ve all ingredients for your installation. Now let’s start the installation. note that I have tried this in Windows 7 and VMWare Player 3.0

1. Create New Virtual Machine

image

2. Choose for “I will install operating system later”

image

3. Choose Other as your operating system

image

4. Name your virtual hdd (we can change this later and use the downloaded vmdk image). The VMPlayer new interface is not that friendly.

image

5. Press Next and leave your Options default

image

6. Finish your setup

image

7. Now you can see your Virutal Machine in the VMWare Player window. Now you need little bit more customization and we need to map the vmdisk we’ve. Choose Edit Virtual machine settings

image

8. Configure RAM and VMDK

a. Given more room to run the Virtual machine. Given 1024 MB of my RAM to run the Virtual Machine

b. Remove the default HDD

image

9. Click on Add and Choose for Hard Disk

image

10.  Choose for existing virtual disk

image

11. Browse to vmdk file you downloaded (unzipped)

image

12. VMWare player may ask to convert it to new format. Do this according to your preference. but I lft the image untouched and kept in old format

image

13. This is an option step. Only required if VMWare Prompts about vmdisk usage issues if vmdk image is kept in different hard drive than the default HDD. Click on the “Advanced Button of virtual machine settings window.

image

14.  In my system VMWare asked me to choose IDE0:0 as default for the image. This might be different for you. Do as VMWare explains in error message (if occured) when starting up virtual machine

image

15.  Finish the setup and now go back to your Virtual Machine Choose to “Play Virtual Machine”. You can see its booting up

image

16. You can use your Google ID (or Gmail ID ) and password to login

image

16. You can see the default Google Home Page when you login

GoogleHome

17. Click on the Chrome Button on right top corner to see your default web applications.

ChromeHOme

18. You can access your own stuffs as you’re seeing.

The internet access was too slow in the virtual machines. I will share more screenshots later. Anyway you’re there in your Chrome OS right? So share your experience and stories. Put them as comments or put in your blog twitter anywhere you find comfortable. Signing Off Chrome OS. Bye till I sign in again.

How to turn your Safari into mobile safari? (for iPod/iPhone Testing)

November 16th, 2009 Sarath Comments

Do you want to experience the real mobile safari in your desktop? May be you wanna try sites optimized for iPod or iPhone and if you’ve no apple device to test it, what you will do?

Ok here’s a real scenario. I’ve moved my wordpress blog to self-hosting mode. Most of the default features available in wordpress.com need to be installed as plugin in the self hosted mode.

I’ve installed WPTouch in my blog to support my blog (codereflect.com) load lightning fast on touch mobile devices, show my content beautifully, all while not interfering with my regular theme. I’ve an iPod Touch to check my website in mobile mode to see if it works.

But do you know safari can be turned in to mobile safari to see the website same as your iPhone/iPod Touch?

Follow these steps

1. Take Preferences and go “Adavanced” tab

 

image

 

2. Now load your page

 

image

 

3.  Click on page button (image)and navigate to “Develop” menu .

Select your Mobile Safari user agent for iPod Touch/iPhone from the “User Agent” menu. (You can also check for Firefox, IE and Opera versions)

image

This is a per page settings. None of the other tabs are affected!

 

4. Done! now see your page!

 

image

How to revoke access to facebook/twitter authenticated apps or website?

November 15th, 2009 Sarath Comments

This is a small tip for the newbies of facebook/twitter.

imageIn the age of social networks you might at least owning your identity at facebook/twitter which are the popular social networking websites.

In the earlier time what we do if we need to register in a website? we will register a simple form and give our email address and password to create the account. It was merely tiresome if you need refill everything once again and register with the website. OpenID was one of the solutions for this problem as the single openID can be used across different websites which supports OpenID authertication. Your OpenID profile information will be used by the website for further processing. The advantage of this mechanism is that you don’t have to create any new accounts, no need to share/keep passwords with third party websites.

When the social networks boomed, the social network profiles became our social ID. Realizing the user needs and business advantages, Facebook introduced facebook connectand twitter introduced OAuth authentication to use their account to connect with different web services.

Spams are everywhere and people are fighting against it. If you’ve not used your ID carefully with websites, finally you will end up seeing lot of spam msgs in your inbox. You can connect with any website which supports facebook connect or Twitter OAuth. Once you allow access to your facebook stream or tweet on your behalf with twitter, the web applications can write anything on your behalf. Your friends or followers will be seeing it as the update from yours. For example, one of my twitter friend frequently tweets about “100 followers in a minute… follow this link… *blah* *blah*”. I wondered and asked him why you’re tweeting like this? I think we must have some genuine followers other than bots. He said, I  never knew it. I’ve not posted anything to my twitter. I guess someone posting on my behalf.

The thing is he has connected to some websites using twitter authentication and he allowed them access to writer on his twitter stream. Rest you can think of.

But don’t worry, once you realize that you’re dealing with a wrong website which is not good for you and your networks, you can revoke the access at any time. I’ve explained the steps below.

Revoking Access to facebook apps/connected websites

  1. Go application settings.

image

2. Find the application to block form your list and Select the application from the list.

3. You can do following things.

  • Edit application settings to restrict access to your wall and other facebook settings. You can do this by clicking on “Edit settings” link provided next to each application. The features used by the application will be listed in the popup window. e.g is given below. You can check/unchek according to your convenience. Note that by doing this, the app is still active with your facebook account.

image

  • Remove applicationimage

Revoking Twitter Authenticated (OAuth) websites/app

  • Login to your twitter.com
  • Go navigate to “Settings Page”
  • Go for “Connections” tab

image

  • Click on Revoke Access link. You can also undo this if you’re wrongly revoked access!
  • If you’re friends says you’re sending SPAM DMs or tweets?

    Immediately change your password. That’s the best thing you can do. You might have wrongly given your username passwords to some bad/phishing websites. Just change your password that’s it and prefer OAuth/facebook connect authentication to sign in websites as you can easily revoke them if you find it unnecessary.

    Hope this helps!

    Technorati Tags: Social Networking,Twitter,facebook,oauth,authentication. tips

    Be the Ocean! – Inspiring Incident quoted from Chetan Bhagat’s blog

    November 3rd, 2009 Sarath Comments

    In a recent blog post, Chetan Bhagath shared his updates on his new book “2 States”, new movie “3 Idiots” based on his First and popular novel “Five Point Someone” and few more.

    There was nothing quite surprising things as I am following him on twitter (@chetan_bhagat)and getting his frequent updates.  But the end of the post, it was just amazing. Here it is…

    I want to end by sharing a small incident. The night before the release of 2 States, I was super tense. I went to the ISKCON temple in Chowpatty and met His Holiness Radhanath Swami, an American gentleman who moved to India several decades ago and devoted his life to serve God. I told him I couldn’t sleep because of the anxiety over the fact that there will be a million judgments on my work, both positive and negative, in the coming days. He told me this:

    “Imagine there is a puddle. When it rains, the puddle is filled with water. When it doesn’t, the puddle dries up. Now compare that to the ocean. The ocean is so deep, it doesn’t matter if it rains above or it is dry weather. Your inner depth should be as much as the ocean, so you are not fazed by the external praise or criticism. For that, you must truly do work that is meaningful to you, have love in your heart for others and help people. And when you achieve inner depth, the external world’s rewards won’t matter to you as much.”

    I don’t think I am as deep as the ocean yet. But I am trying. Meanwhile, I just felt I will share this with you, so you may apply it in some aspects of your life. Whatever happens outside, it doesn’t matter as much if there is a calm stillness in you.

    Excellent! Hi books are always cool and I love to read it and moreover he inspires through this quick blog posts/writing like this! Great man. I respect you!

    Visual Studio 2010 – Conditional breakpoints using String Comparison Functions (C/C++)

    November 3rd, 2009 Sarath Comments

    All we’re fond of conditional break points if we need to execute the program until some specific condition exists. We usually give numerical expressions to give conditional break points. If you don’t know about conditional break points, just have a look at MSDN documentation. or this one.

    Now the C/C++ programmers are blessed with break with string conditions.

    Just put a breakpoint in your source code and right click on that choose “Condition” to see the following window appear. You can give string comparison routines to set the break point.

    image

    Once you start debugging, you can see the break point hit on the condition you’ve given

    image

    Visual Studio Beta 2 currently supports the following functions (Taken from Habib Heydarian’s blog)

    strlen, wcslen, _tcslen, strnlen, wcsnlen, _tcsnlen, strcmp, wcscmp, _tcscmp, stricmp, wcsicmp, _tcsicmp, strncmp, wcsncmp, _tcsncmp,strnicmp, wcsnicmp,_tcsnicmp,_stricmp, _wcsicmp, _strnicmp, _wcsnicmp

    This may be changed or updated in the final release. Anyway enjoy your breakpoints!

    Visual Studio 2010 – Code Metrics calculation

    November 2nd, 2009 Sarath Comments

    Visual Studio 2010 provides a new feature to calculate various the code metrics. Sadly this options are only available for Managed projects. Sorry native developers!

    It allows to calculate the follow matrices of your project

    • Maintainability index
    • Cyclomatic Complexity
    • Depth of Inheritance
    • Class Coupling
    • Lines of code

    Most of us mainly interested lines of code (LOC) as various other calculations in the project life cycle calculated based on this.

    To calculate Code matrix, Right click on the Solution and choose “Calculate Code Metrics”

    image

    As you’re seeing above, you can see the information for the entire project and also for the individual items.

    It’s possible to filter the results based on given criteria as you’re seeing below.

    image

    The coolest things is that, you can export these result to an excel sheet without any pain. Just right click on the item and “Open Selection in Microsoft Excel” as you’re seeing below

    image

    You can get it opened in the excel. See, the filters are automatically applied for header items!

    image

    To know more check MSDN website.

    Firefox 3.6 exploiting the features of Windows 7

    October 31st, 2009 Sarath Comments

    Firefox has released the Firefox 3.6 beta 1 for developer preview. It Visually doesn’t feature any changes from version 3.5. But it features integration with Windows 7 Taskbar and also Windows 7 Style switching of tabs using Ctrl + Tab. Yes it’s able to display the tabs preview.

    Download it here.

    (Click on this, if you need a Direct link to Firefox 3.6 Beta 1 English for Windows)

    Windows 7 Like Tab Preview

     

    Firefox 3.6 ca now display tab previews like Windows 7(the very same way of Alt+Tab in Windows 7).

    This feature is disabled by default in the beta version.

    type about:config in your address bar and on the appearing page, search for browser.ctrlTabPreviews. Set this as true.

    image

    OK now you’re done. Start Exploring

    You can select the required tabs using mouse as well by holiding down the Ctrl+Tab key.

    image

    What if you’ve too may tabs? Ctrl + Shift + Tab will show up all tabs in the firefox window. Alternatively you can do this by holding down Ctrl + Tab and Click on “Show All Tabs” displayed in the very same windows

    image

    This preview window display features a search box where you can quickly search for the required tab if too many tabs are open. As this Shift key assigned with Ctrl+Tab to show up whole tabs, I’m sadly missing shortcut I previously used to traverse back in order.

    image

    You can also close the tabs if necessary in this view.

     

    Windows 7 Taskbar Integration

     

    On hovering the taskbar icon of firefox, you can see the preview of tabs in the aero peek window. To enjoy this feature you will have to enable aero theme in you Windows 7.

    image

    On hovering the mouse over the windows displayed in the peek view, surely you can peek to see the window. It’s the real Windows 7 peek feature. You can also close the tabs if necessary in this view.

    image

    If you’ve too many tabs open, then it will be displayed as stacked list as your seeing above.

    Cool eh! This is a quick post on my first look, if you find something really cool, please do share with me in twitter, facebook, or as a comment in this blog.

    Facebook Feature Suggestion – Temporarily Remove seen entries

    October 27th, 2009 Sarath Comments

    It will be very nice if we can temporarily removing the update from the friends. So that I can check each and every updates in ease, on removing seen entries, the next entry should come up. Tweetdeck has a feature like clear seen tweets. This something similar to that. Without deleting the facebook entry, temporarily removing the entries. Something like below, it’d be nice if we put a close button like this per entry to hide the facebook updates. I believe something like this would make the facebook less noisy! What do you think?

     

    image