technology and zen of life

“A heisenbug (named after the Heisenberg Uncertainty Principle) is a computer bug that disappears or alters its characteristics when an attempt is made to study it.”

Installing Haiku directly to a disk partition

haiku Installing Haiku directly to a disk partitionIntroduction

Haiku is something like Windows or Linux: an Operating System (OS). Some geeks like to play with alternative operating systems; it you are one of such geeks, you might want to give Haiku a try. Haiku is very fast and easy to use, but currently there are not many applications you can use with Haiku.

Haiku is a new open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.

In this post, I will describe how to install Haiku on a spare harddisk partition directly without using a CD-ROM or USB memory key. I furthermore assume that you already installed Linux on another partition.

I would like to express my gratitude to luroh, a Haiku developer, for providing help on this topic.

Steps to be taken (summary)

  1. Download a Haiku Anyboot image.
  2. Convert Anyboot to a raw image.
  3. Write the raw image to a disk partition.
  4. Make the partition bootable.
  5. Add the partition to your boot loader.
  6. Set the partition type.

Download Haiku

You need to download an Anyboot image from the Haiku website.

Convert Anyboot to a raw image

Anyboot images are a combination of ISO and raw images. They can be written to CD-ROMs, USB memory keys and harddisks. If you need to write the image to a partition, then you must first convert the Anyboot image to a raw image. You can do so using:

dd if=haiku-anyboot.image of=haiku.raw bs=1M skip=$(expr $(od -j 454 -N4 -i -A n haiku-anyboot.image) / 2048)
dd if=/dev/zero of=haiku.raw bs=1 seek=506 count=4 conv=notrunc

Please modify the blue filenames as needed.

Write the raw image to a disk partition

For example, to write the raw disk image to the second partition of “sda2″:

dd if=haiku.raw of=/dev/sda2 bs=1M conv=notrunc

Again, modify as needed.

Make the partition bootable

After the image is written to the partition, it needs to be modified to make it bootable. You need the makebootable program from Haiku. You can also use makebootabletiny with Linux. (If the link to makebootabletiny would no longer work, here is a local copy: makebootabletiny.c download.)

Assuming that you downloaded makebootabletiny, you need to compile and run it:

gcc makebootabletiny.c -o makebootabletiny
./makebootabletiny /dev/sda2

Add the partition to your boot loader

This really depends on which boat loader you are using. For grub (legacy), you need to add these lines to /boot/grub/menu.lst:

title Haiku
rootnoverify (hd0,1)
chainloader +1

Check the documentation of your specific bootloader. Also you can check the Haiku Installation Guide.

Set the partition type

Optionally, you should set the partition type to “BeFS” using fdisk.

If you want to stay updated on alternative operating systems, keep an eye on www.osnews.com.

This howto is now included in the Haiku installation Guides.

Horizontal Scrolling for MySQL queries in Linux

Everyone who works with databases on a linux terminal faces this issue at some point in time — executing select * on a table with too many columns. And in linux since there is no horizontal scrolling, the output is wrapped and hence completely unusable.

You can use

--pager

property to get rid of that text wrap.
Read the rest of this entry »

Mounting VMware disks on the host system

VMware uses virtual disk files as a source to store data from their virtual machines. These files are have an extension of .vmdk and are stored on your local hard drive. There are multiple instances where one would want to access these files without having to boot up the virtual machine. It could be due to a crashed VMware to recover files or like in my case to save time and speed up data retrieval from the VMware.

Luckily VMware has developed a tool for exactly these reasons, the VMware disk mount utility. You can download this utility from the following link for Windows http://www.vmware.com/download/eula/diskmount_ws_v55.html for Linux it normally comes as a part of the VMware workstation.

Read the rest of this entry »

Using the presenter view in Microsoft PowerPoint.

I am sure that everyone has given presentations on a beamer / screen and will have to do so in the future. Most people I have seen presenting use the default slide show view in which the laptop/computer shows the same view as the projector / screen. This is quite unhandy when you want to refer to your slide notes or want to have an idea of the time you took till now or simply want to switch to a different slide by jumping a few in between without letting your audience being obvious of that fact.

ZA001058072 300x277 Using the presenter view in Microsoft PowerPoint.Here is where the presenter view functionality comes in use. It has to be one of the handiest tools while giving a presentation. The presenter view allows the user to take full advantage of the dual screens. While showing the full screen presentation on the screen the laptop/computer screen shows an organized collection of slide notes, navigation controls, drawing tools, timer, slide view shown on the projector and other powerful features.

 

 

 

 

 

Read the rest of this entry »

Instagram – Using the API

First a short introduction on Instagram, it is an iphone app for taking pictures, adding filters to make them look retro, and then for sharing them with sites like Twitter, Flickr, Tumblr, and Facebook, more importantly, it’s a simple social network of other people’s photos. You can “like” or comment on the photos, and see what’s new. It’s easy and doesn’t take much time or effort. This is one of the reasons it has become so popular so quickly.


What is also good to know is that Instagram has recently released an API which the user’s can use to fetch pictures that users upload to the website. In this article I want to discuss that API and how to use it to make the most out of it.

Read the rest of this entry »

WindowsXP: Using the Command prompt to see and kill processes

If you are a WindowsXP user then you must be already familiar with the life-saving graphical tool called “Task Manager” on Windows. Whenever the PC starts hanging and the processes start eating up a lot of memory (Sadly most of the time its Firefox for me), we press the alt+ctr+del key to bring up the the “Task Manager” and try to kill the memory eating processes and the ones which are “not responding”. Well, you should also know that this can be done efficiently from the command prompt as well by using the task manager command prompt alternative and kill processes from command prompt.

As my project work requires writing and running codes, I generally have at least one Windows command prompt open. If this is the case with you then it is much faster to manage your windows processes from command prompt than to open up the Task Manager, just like we do on Linux using “ps” and “kill” command. Get to know the following commands and you can easily use the command prompt to see and kill processes.

1. Tasklist : This command is similar to “ps” command on Linux and is used to see the details of the programs and processes that are running in Windows. Tasklist can be applied to see how much memory and CPU time running processes are using, what DLL files they rely on, and other information. Thus it can be a very useful troubleshooting tool.trans WindowsXP: Using the Command prompt to see and kill processes

  • Processes info: When you enter tasklist on the command prompt, you can see the following informations by default. Image Name, PID, Session Name, Session#, Mem Usage
  • Processes detailed info: Additional info like, Status, User Name, CPU Time, Window Title can be displayed using tasklist /v
  • Services and Processes info: Use tasklist /svc to get a table relating Image Name, PID, and Services, very useful to know the relationship between a process and the services that are running on a system.
  • dlls and Processes info: Tasks and Use tasklist /m to find which DLLs are used by each process.
  • Filtering processes: Processes can be filtered using ImageName, PID, MemUsage, Status, Username and WindowTitle. For Example,
    • Use the following command to to find processes that are not responding.
      • tasklist /fi "status eq not responding"
    • Use the folliwing to list the processes eating up more than 10MB.
      • tasklist /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use tasklist /? or refer to Microsoft’s documentation.

(NOTE: Although Tasklist is a part of Windows XP Professional, it does not come with the Home edition. Those with the Home version of XP can download this file and can put it in the system path.)

2. Tskill : This command is used to end a process, using its name of its PID.

  • Kill with name: Use tskill processname to kill a process with name processname. For example:
    • tskill winword (closes all the Microsoft documents that you have open)
  • Kill with PID : Similarly use tskill processid to kill a process with PID processid. Tasklist can be used to find the PID of a process.
  • More Info: To get more info on advanced syntax of the command use tskill /? or refer to Microsoft’s documentation.

(NOTE: Tskill is a part of both Windows XP Professional and the Home edition.)

3. Taskkill : Similar to Tskill, this command is also used to end a process but it provides us more options in doing so. Apart from specifying the PID or the image name of the process to kill, we can also use ceratin filters to kill the matching processes as explained below.

  • Kill with name: Use taskill /IM imagename to kill a process with the given Image name. For example:
    • taskkill /im notepad.exe /f (forces notepad to be killed.)
  • Kill with PID : Use taskill /PID processid to kill a process with the given processid.
  • Filtering Taskkill: Processes to be killed can be filtered using ImageName, PID, MemUsage, CPUTime, Session, Status, Username, WindowTitle, Services or Modules (dll). For Example,
    • Use the following command to forcefully shut down all the processes that are not responding.
      • taskkill /f /fi "status eq not responding"
    • Use the folliwing to close down all programs using more than 10 MB..
      • taskkill /f /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use taskkill /? or refer to Microsoft’s documentation.

(NOTE: Taskkill is only a part of Windows XP Professional.)

So Enjoy using the task manager command line version!

Go on, show the power of your commands to the processes. Happy killing them. icon wink WindowsXP: Using the Command prompt to see and kill processes

(Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands given here.)

Make a Live USB disk for any Linux distribution

How many of you feel frustrated having to burn a CD/DVD every time you want to try on a new OS? Well UNetbootin helps create bootable USB drives, which you can use either as a live CD or as an installation media.

UNetbootin is a very handy tool, which runs on both Linux and Windows and offers a wide variety of operating systems that you can choose to load to your USB disk. It can even download all the popular distributions off the internet for you. It can also be used to boot many system utilities from the USB disk. It uses syslinux to make the USB disk bootable and thus any distribution or utility that can be booted via the syslinux interface works with UNetbootin.

UNetbootin offers two variations for installation. One is to create a USB disk and the other is a “frugal” install. A frugal install means that the iso resides on your hard disk and only the boot loader is reconfigured to run load the compressed kernel image from the hard disk, which can then be used to install the OS, or just run as a live CD.

Using UNetbootin is quite easy. If you are on windows just run the utility and you will be provide with a screen like this:

screenshot Make a Live USB disk for any Linux distribution

Now you can either choose an operating system or specify your own ISO image for which you want to create the bootable USB disk.

The second option is to specify the USB disk or the hard disk (in case of frugal install) and you are all set. The target disk is not formatted so you will not lose any existing data on the disk.

What’s more it supports 9 different languages but if you want to change the language the only way you can do that is by providing command line argument <lang = xy> where xy is the language code. Here is the list of languages supported with their codes

  • English (en)
  • Español / Spanish (es)
  • Português / Portuguese (pt)
  • Français / French (fr)
  • Italiano / Italian (it)
  • ?? / Simplified Chinese (zh)
  • ??????? / Russian (ru)
  • Norsk bokmål / Norwegian (nb)
  • Magyar / Hungarian (hu)

Links:

UNetbootin Homepage

delicious Make a Live USB disk for any Linux distribution digg Make a Live USB disk for any Linux distributiongoogle3 Make a Live USB disk for any Linux distribution stumbleupon Make a Live USB disk for any Linux distribution

NTLM authentication proxies

continuing from the last post. If your network is all Windows based, then using the tricks mentioned in the previous post are of no use to you. That’s because Windows servers use NTLM authentication. It’s different from normal authentication, in the sense of a user, you won’t be able to use Linux happily on a network with that kind of authentication scheme. You need to keep an eye on how to use this tip to your benefits.

You need this to create your very own NTLM workaround proxy server. It’s called NTLM Authorization Proxy Server.

Setps for those-who-don’t-know-and-want-to-learn

  1. Download the NTLMAPS script.
  2. Download python.
  3. Unzip the NTLMAPS zip file and install python.
  4. Configure(edit and save) the server.cfg (read below).
  5. Double click on runserver.bat

voila, you see a console!

Configuring the server.cfg

You will need to modify these variables in the config file named “server.cfg” according to your network needs

LISTEN_PORT:5865

PARENT_PROXY:your_parentproxy

PARENT_PROXY_PORT:8080

NT_DOMAIN:your_domain

USER:username_to_use

PASSWORD:your_nt_password

And these variables if you need, normally they won’t require a change, but you might need to.

LM_PART:1

NT_PART:0

SCR_DEBUG:0

ALLOW_EXTERNAL_CLIENTS:0

FRIENDLY_IPS:

For me the configuration looks like

LISTEN_PORT:4000

PARENT_PROXY:10.100.56.45

PARENT_PROXY_PORT:3128

NT_DOMAIN:your_domain

USER:200301001

PASSWORD:

LM_PART:1

NT_PART:0

SCR_DEBUG:0

ALLOW_EXTERNAL_CLIENTS:0

FRIENDLY_IPS:10.100.90.90 10.100.96.69

Note, if you don’t fill in the password, it will automatically ask when you run the “runserver.bat” file.

So now it’s all done, tell me if you use it successfully, or failed at it miserably!


DarK is a Sony Vaio user who cannot learn enough about networks. He hates his laptop and loves it at the same time. You can catch him on twitter at http://twitter.com/abhishekchhajer

Email Subscription

Disclaimer

The views expressed on this blog are personal. We do not claim to be a representative voice of the views of any organisation whatsoever. We are not responsible for the content present on the blogs to which we have linked.Views expressed are solely that of the author and does not reflect a collective opinion of contributors.