Archive for November, 2009

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

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

How to fix mt.exe : general error c101008d ?

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?

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)

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?

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