Archive

Archive for the ‘Software’ Category

How to kill a vbscript running the sendkeys command

March 25, 2012 Leave a comment

It is nearly impossible to stop a wild VBScript running amuck with the sendkeys command on windows. To be sure you can always attempt to open windows taskbar and try to kill the process, if you know its name and if the script gives you enough time to open the taskbar and kill it. But in my experience its impossible to do that without creating a whole mess with sendkeys and sometimes, the only way out is to quickly open or switch to a text editor and wait patiently until it ends.

Scripts that I run frequently, I usually put them in my Quick launch bar so I can kick them off without having to switch windows. The AppActivate() command activates the right window for the script to work on. AppActivate unfortunately doesn’t restore windows if they are minimized. You might have realised this the hard way, as did I, when minimizing all windows and trying to trigger the script from the desktop.

Since VBScript doesn’t provide it’s own way to kill runaway sendkeys commands, it’s up to us to stop it. Every script that I write looks for a file called ‘stopscript.txt’ on the desktop, once every few times the sendkeys is called. If the file exists, it stops and no more sendkeying after that. To create that file, I’ve written another script whose only job is to create an empty file called ‘stopscript.txt’ on the desktop if it doesn’t exist. This script is also placed in my quick launch so it can be started quite easily. So whenever a sendkeys script starts behaving weird, I just start this script and the other one terminates instantly. I’ve found this technique to be a lifesaver in many situations. However, it does require that you be careful and call the file checking function at the right places when developing your script.

Also, always have an empty notepad window open when working with sendkeys. If it goes amuck, you can capture most of the bad commands by bringing the notepad window into focus. This is just another precaution :) . Also, you can have your main script delete the stopscript.txt file at the very beginning so that you don’t have to manually switch to the desktop and delete it yourself. To stop it again, click on the stopping script.

VBScript is by no means a great solution for sendkeys automation. There are several professional tools available which can achieve the same. But VBScript comes for free on a windows machine. And when working with clients, sometimes you’re not allowed to install anything on the system and that’s when VBScript comes in handy as the poor man’s automation tool!

Links:

Checking if a file exists and creating it in VBScript

Problem: Virtualbox on Acer 4530 freezes constantly

December 1, 2010 Leave a comment

AMD has a hardware virtualization component called AMD-V which apparently improves the virtualbox experience. However, with the latest virtualbox on Acer 4530, it hangs up the entire laptop. Here’s a lengthy discussion with a solution at the end:

http://www.virtualbox.org/ticket/4179

Kudos to the people who worked on this ticket for persisting until the solution was found.

Categories: Linux, Software, Technology Tags: , , ,

Problem: Windows 7 doesn’t remember view settings for individual folders

November 5, 2010 Leave a comment

If you’re using Windows 7, you must have noticed that very often your folder view preferences get messed up. The thumbnail view for your gallery changes to List and the detail listing for your documents changes to thumbnails. This is extremely frustrating and after searching around a bit, I finally came across this thread that seems to explain the problem. A user by name of ‘Graham Laws’ has finally answered the problem:

=====================

Hi Guys.

There is two scenarios with remembering views (Windows 7):
1. Libraries – Don’t Remember
2. Folders / Favourites – DO Remember (Easy Fix : Add My Docs to Favourites – see below)
Library Behaviour
Lets say you click Documents, then choose ‘medium icons’, wherever you navigate within Documents from then on stays in ‘med icon’ view.
NB Choosing Organize>Fold & Search Options>View>’Apply to Folders’ and ‘Reset Folders’ are not available in Libraries.
Folders / Favourites
Folders do remember views by default. So if you navigate to C:\users\xxx\Documents etc each individual folder in the tree will remember whatever you set it to.
Likewise if you add ‘My Documents’ to Favourites and navigate from there. To add ‘My Docs’ to Favourites you need to navigate to your User Folder e.g:
i)Start Menu> User Folder> My Docs
ii) Rt-click ‘Favourites’ > ‘Add current location to favourites’
DO NOT add ‘My Docs’ to Favourites from within Libraries. As it is ’Libraries’ that ignore last view setting.
NB Choosing Organize>Fold & Search Options>View>’Apply to Folders’ and ‘Reset Folders’ are available in Folders. So you can make all folders copy your current view (Apply to folders).


Hope this helps.
Gray
  • Proposed As Answer byGraham Laws Wednesday, December 16, 2009 12:20 PM

================================

Problem: Blender always renders only frame 1

October 11, 2010 Leave a comment

Had this problem today with Blender rendering only Frame 1 in spite of repeatedly baking the animation and setting the view to another frame. I had a cloth piece which was to fall freely under gravity by around frame 100 after which I wanted to render the image. But after setting it up, when I rendered it, I kept getting only the first frame.

After searching for quite some time on the net, I came across this post which suggested that the subsurf modifier should be below the cloth modifier. And it worked! Now it renders the exact frame that I select in blender.

Here’s a screenie:

Formatting SD Card on Ubuntu

February 18, 2010 2 comments

This is a post just to remind me about the steps needed to format an SD Card on Ubuntu 9.10. I just got a class 4 8GB Kingston SD Card to replace the 1GB Stock SD Card on my G1. Since I’m using a rooted ROM (this one to be precise), I need an ext+fat+swap partition setup on my SD Card. I needed to format the new card identical to the old one and copy the old data onto the new card.

First of all, Ubuntu has a very weird delayed write mechanism that writes data to plugged in devices only when you eject or unmount them. So, if you write something to the card and pull it out, there’s a very good chance that it doesn’t show up. I haven’t seen this anywhere before, especially when using gentoo earlier.

GParted doesn’t display my card which is /dev/sdb. (Update in comments below) So, I decide to use the command line for this. There are three command line utilities for formatting, i.e. fdisk, cfdisk, sfdisk.

cfdisk gives you a UI so that you can select everything using arrow keys. But for some reason, when creating the partitions, it kept creating them as /dev/sdb1p1, /dev/sdb1p2 and /dev/sdb1p3 instead of /dev/sdb1, /dev/sdb2, /dev/sdb3. This kept the disk from showing up when listing the partition table with sudo fdisk -l. Didn’t really investigate why it was doing that. Checked out sfdisk, but the commands are different and looked like I’d need to learn a bit more before I could use it.

So, finally came down to fdisk which is quite handy once you get used to it. Important commands are ‘m’ which displays all the commands and ‘p’ which prints the partition table. So, first created the partitions using ‘n’ and setting them up as 7.4GB win95 fat32 (code ‘b’), 500MB ext3 (code ’83′), remaining 30+MB swap (code ’82′). The file system type can be set using ‘t’ and the codes obtained using ‘L’. The partition table is written using ‘w’.

Now, we need to format the different partitions with the corresponding file systems. This is done as follows:

  • Fat32: sudo mkfs.vfat /dev/sdb1
  • Ext3: sudo mke2fs -j /dev/sdb2 (the -j is required for ext3. Omit it for ext2)
  • Swap: sudo mkswap /dev/sdb3

Once this is done, you should immediately be able to see the different partitions in Nautilus.

Personal Diary options for Ubuntu

December 12, 2009 4 comments

Looking for some software for a personal diary, I came across the following two utilities for Ubuntu:

ThotKeeper

It’s a pretty good diary option, but has a very major drawback – the diary entries are stored in plain xml on your hard disk and it doesn’t need a password to login. In fact, it doesn’t have a password option. If you want a diary just to take notes of your daily tasks or an alternative to an online blog (why?), you can go ahead with this.

MyDiary

This is exactly what I was looking for. It has password protection, keyboard shortcuts and easy to use interface. It even has a shortcut to insert the time in your diary post! It’s as if the developer was reading my mind. I would highly recommend this for anyone looking for a personal diary. Just remember that it needs gtkspell installed for python otherwise it won’t even start. If you’re using ubuntu, just search for it in synaptic and install the python libraries for gtkspell.

Update:

Alamanah (updated link)

Almanah looks good, but again the main negative for this one, just like thotkeeper,  is that it isn’t password protected. But apart from that it has a nice calendar and the ability to store the diary entries in encrypted format. One unique feature about Almanah is the ability to add a definition to some text. This definition can be used to link your text to a file, note or a URL. Pretty neat. Plus it’s available in synaptic, so you can give it a shot.

Update (23rd Sep, 2011):

Lifeograph

Another personal diary option brought to my notice by Amit in the comments below. Unfortunately, I couldn’t get it to run on my Debian setup (yes, I’ve moved to a virtualbox Debian installation from a full blown Ubuntu install) and many of the dependencies seem to be in the unstable repo. But the screenshots look good and the features look great. It has been sometime since it was last updated (~10 months), but hopefully it will make it to stable some day.

Acer 4530 and Karmic Koala (Ubuntu 9.10)

November 6, 2009 Leave a comment

Karmic has been out for a week now. Finally got over my insecurities and opted for the complete distro upgrade in the update manager and let it run overnight. By morning it was almost done, just cleaned up a few packages and fixed menu.lst and we were done.

But a reboot showed that it wasn’t to be a smooth transition. There were 2 kernels installed, 2.6.31-14 and 2.6.28-16. Trying out the first one caused my boot up screen to flicker and it didn’t even reach gdm. The flickr even prevented me from logging in. I think it was around the point when the console read “Starting consolefont and terminal yada yada” when it started doing it.

A search on the forums suggested that the problem might be because of the nvidia drivers. Which was exactly the problem. As per my earlier post, since I had installed Nvidia drivers manually, the updated didn’t install the drivers.

So, to fix it, I booted into the recovery kernel and dropped into a root terminal with networking. But for some reason the wifi wouldn’t work so I couldn’t connect to the net for synaptic to install the correct nvidia drivers (yes, they’re using 185.18.36 now, which is slightly later than the one I installed). But fortunately, I still had the drivers in my home directory. So kicked it off from the command line (no need to sudo since I was root).

But then the nvidia installer complains saying I need to be in init mode 3. So I quit the installer and ran telinit 3 (as mentioned in the installer itself!) and I was given a nice little login prompt.

Logged in and then ran the installer as sudo and waited for it to complete. Rebooted and everything works now.

My desktop works fine, and my MacOs ubuntu theme is intact.

PS: Initially, since I was having problems with kernel 2.6.31-14, I booted using 2.6.28-16 which actually worked and was able to log me in via gdm. But the touchpad wasn’t working. This seemed like a really strange issue. So I searched the forums for this and found this post. The touchpad started working after putting it in the options file and rebooting.

But with the new kernel, after fixing the flicker issue,  it was causing the mouse to be a bit sluggish and the scroll wasn’t working either. So I tried commenting it out and rebooting and the mouse is working fine now.

Categories: Linux, Software, Technology, Ubuntu

iPod Ripper

July 6, 2009 Leave a comment

iPod RipperI’m finally done with the iPod Ripper. Easy enough to be done in a week, it took me more than a month. Thank you very much procrastination! Any case, I’ve been able to finish it and uploaded it to www.mediafire.com. Follow the link at the end of the post for the iPod Ripper’s page. Bugs/comments/issues/questions/feedback – please leave a comment and I’ll try to answer them.

Click here to go to the iPod Ripper page

Follow

Get every new post delivered to your Inbox.