krish – 起死回生 [Wake up from death & return to life.]

December 11, 2013

Blackberry WebWorks 2.0 on Linux!

Okay!, so first some history.. was working with Webworks 1.x to get my game Baka – The World’s Hungriest Frog packaged for Blackberry 10.x platform.

Ran into quite some problems … not finding debug tokens to missing author.p12 files were just some of them.
To much dismay, suddenly all the docs links I was referring to on the developer url on blackberry site changed to Webworks 2.0 (Yay! RIM released BB Webworks 2.0 based on Apache cordova)

Wasn’t much “yay!” for me as I spent over a week figuring out why my debug token wasnt generating or why I couldn’t package a simple bar file… all in between making trips to hospital for I was under treatment for typhoid (still under medicine as we speak).

rants on twitter

rants on twitter

more rants

more rants

Anyway, I was super pissed… shot couple of mails and tweets and thankfully Erik (@WaterlooErik) mailed back quick…. and with quite a sensible reply. Very kind of him 🙂

3 lines from his email got me the root of the problem

When testing with the new WebWorks 2.0 SDK, you should actually only have to run the following command when your device is connected:
webworks run

This will automatically generate a debug token for you if need be, upload it to the device, and then deploy your project in debug mode to the device.

Have you registered your BBID code signing keys and generated a new author.p12 file already? (If you are using your old CSJ code signing keys, that may be where the issue is coming from.)

My Problems:
1. What he mentioned as “automatically generate a debug token for you” wasn’t happening.

2. So, I was trying everything manually to create those debug tokens… using csj files with the old webworks debugtokenrequest commands and csk with new debugtokenrequest… wait.. in short I had both stuff installed in a big mess.

3. I was using Webworks setup inside a Windows VM running on a Linux host.. so the device was connected via host to guest.. and somehow that pretty much doesnt work. “No Blackberry device found” 🙂

I definitely didn’t want to dual boot my laptop with windows for this (although I could have used my desktop .. I wanted to have this on the move)

Then I found this

Decided to do a clean install on my laptop/Ubuntu host … so here I take you through how it was done along with some pitfalls.



INSTALLING WebWorks 2.0 BETA on Ubuntu Linux:


\\ Install Git, ia32-libs, Java Runtime Environment
krish@shenron:~$ sudo apt-get install git ia32-libs openjdk-6-jre

\\ Update Repo and install python stuff and build tools
krish@shenron: ~$ sudo apt-get update
krish@shenron: ~$ sudo apt-get install python-software-properties python g++ make

\\ Get Nodejs from Chris’s ppa – there is a nice updated build for lucid lynx, so didn’t have to compile from source
krish@shenron: ~$ sudo add-apt-repository ppa:chris-lea/node.js
\\Accept the freaking ppa adding warning 🙂

\\Install Nodejs
krish@shenron: ~$ sudo apt-get update; sudo apt-get install nodejs

\\Install Cordova via npm
\\ Note: I didn’t have to install npm via my package manager. Infact it apt-cache policy npm shows its not installed. Probably comes packaged with nodejs
krish@shenron: ~$ sudo npm install -g cordova

– WebWorks 2.0 Beta

\\ Get from Mike’s (@badtoyz) repo
krish@shenron:/opt$   git clone
krish@shenron:/opt$   mv BB10-WebWorks-SDK-    BadToyz-BB10WebWorks


– Start UI and Try to create a Test Project


Open a tab on your browser to http://localhost:3123, this should give you WebWorks 2.0 UI
Try creating a project and Build it.

For me, it didnt 🙂 .. It got stuck at a dialog called “Creating…” or something and hung there.
So did a little debug via command line, found where the problem step was, reported it on an issue

I thought I might now have to wait another week for this, but Mike was kind enough to fix this fast (as you can see from the replies on that issue)



– Pull in latest from Repo + Couple of more changes I figured was necessary

\\ Stop the UI by Ctrl+C on that term you were running it on.

\\ Pulled in Mike’s fixes. You may not have to do this because you will get latest fix from HEAD
krish@shenron:/opt/BadToyz-BB10WebWorks$ git pull origin master

\\ Install npmlog, graceful-fs and clean .cordova
krish@shenron: ~$ sudo npm install npmlog
krish@shenron: ~$ sudo npm install graceful-fs
krish@shenron: ~$ rm -rf .cordova

\\ Extend PATH variable .bashrc to add /opt/BadToyz-BB10WebWorks
\\ and /opt/BadToyz-BB10WebWorks/cordova-blackberry/bin/dependencies/bb-tools/bin

Add to your PATH in .bashrc

Add to your PATH in .bashrc – Sorry for the small screenshot. Resized by mistake 😦

\\ Now startui again and try to create test project
krish@shenron: ~$ cd /opt/BadToyz-BB10WebWork
krish@shenron:/opt/BadToyz-BB10WebWorks$ ./start-ui

Go to that localhost:3123 again, and try… it worked this time 🙂
Was able to create the project.


– CONNECT Your Blackberry on LINUX

I was using z10 dev alpha B.. you might have a z30.

Well, this doesnt work so seamlessly as it does on Windows, aka.. it doesnt connect via usb as a recognizable device.. this is the reason I couldn’t forward the usbdevice into my VirtualMachine windows.

Anyway here’s the work around

1. Enable Dev Mode
– Go to Settings -> Security and Privacy -> Development Mode
– Give a password, remember it. This is your DEVICEPASSWORD
– Set an IP. Default is (I used

2. Connecting via USB on Linux
– Got to Settings -> Storage and Access
– Set USB Connections to “Connect to Windows” or “Connect to Mac” instead of the default “Auto detect”
Now you’ll see the device will be available as a network connection on your network-manager
Note: I renamed it to BBz10 to remember so.

BlackBerry z10 in dev mode on Linux as a usb network.

BlackBerry z10 in dev mode on Linux as a usb network.

3. Test the connection
– You should be able to ping your z10 via its dev mode IP ( or whatever you set it to)



– Try to BUILD test WebWorks Project

Tried to build and install the project via UI

Debug Token, Where are Thou? :(

Debug Token, Where are Thou? 😦

What the!!! Same old error. Now I dont want to use that blackberry-debugtokenrequest script again?
Oh wait, Remember Erik said, “When testing with the new WebWorks 2.0 SDK, you should actually only have to run the following command when your device is connected: webworks run”

Let’s try that


– Creating a DEBUG TOKEN 

\\ Go to a project directory
krish@shenron:/opt/BadToyz-BB10WebWorks$ cd ~/WebWorks Projects/test1
\\ Run webworks run.
\\ This will ask you for your DEVICEPASSWORD (which you entered when switching on debug mode)
\\ And your KEYSTOREPASSWORD (which you set while generating bbidtoken.csk)
\\ If you did not generate bbidtoken.csk, please do it via
krish@shenron:~/WebWorks Projects/test1$ webworks run
[ERROR] The Specified CSK password is not valid.

Whaaat!!! :/

Pretty sure that I had my csk password correct.
Let’s try verbose mode
\\ Trying Verbose on webworks run
krish@shenron:~/WebWorks Projects/test1$ webworks –verbose run –devicepass DEVICEPASSWORD –keystorepass KEYSTOREPASSWORD
Generating config.xml from defaults for platform “Blackberry10”
[INFO] Target Z10-MYDEVICEPIN selected
[INFO] Generating debug token
[ERROR] The specified CSK password is not valid.
An error has occured.

At this point I could see fumes out of my head. This was back to square one. :X
Atleast, it shows MYDEVICEPIN correctly, so unlike earlier, it is able to connect to my device this time 🙂

Did I mention I was making trips to hospital the whole last week? and then working late nights (probably half drowsy) on this with Webworks 1.x
So I thought, what the hell.. lets just try to ensure we have all files correct

– Files you need under ~/.rim or your /home/user/.rim

You’ll need the bbidtoken.csk and author.p12
I backed up my author.p12 from the windows VM from “%HOMEPATH%\AppData\Local\Research In Motion”
and put in under “~/.rim”

I’m pretty sure I had to generate that author.p12 on Windows. Just can’t remember at the moment.

As for bbidtoken.csk, I generated a new one by going to and requesting a new token for SDK 10.2 for WebWorks 2.0 Beta
AND remember the KEYSTOREPASSWORD you set here 🙂



– Try to CREATE Debug Token Again

W00t! ... it also deployed the app to my z10? :)

W00t! … it also deployed the app to my z10? 🙂

Yippie! Finally… webwork run also deploys if the app is connected.
Also it created debug keys and pushed it to the device. I could see that on the “Settings -> Security and Privacy -> Development Mode” screen.

But wait, I want to see this working via UI too.

\\ So fire up the ui again
krish@shenron: ~$ cd /opt/BadToyz-BB10WebWork
krish@shenron:/opt/BadToyz-BB10WebWorks$ ./start-ui

\\Try to Build and Install the project via the UI

Building BAR file success!

Building BAR file success!

Huaaaaaaa!!! 🙂
You’ll see your the app fire up on your phone screen and also an app icon installed 😀

Your test WebWorks 2.0 app

Your test WebWorks 2.0 app

Hope this helps someone 🙂

You can tweet a thanks to @WaterlooErik , @badtoyz and may be me if you want to let me know that this worked for you! 🙂
Or if it didn’t, feel free to either tweet to me @srikrishnadas and/or leave your error in comments 😀
Thanks to ダニエル for his nice write up on prereqs for the old Webworks. It did help 🙂 I wish I knew his twitter id to include in the above thank list 😀

An hour past midnight now.. time for BattleField 😉

Btw, You can LIKE our game page – to keep updated on the upcoming fun adventure non-endless jumper .. the story of The World’s Hungriest Frog – “Baka” 🙂

December 10, 2013

How to uninstall Intel XDK from Linux!

Filed under: Free / Open Source,GNU/Linux — krish @ 12:54 pm
Tags: , , , , , , , , , ,

This differs depending on the distro you use.

I was on Ubuntu 12.04 LTS, and had installed Intel XDK earlier for a game development; decided to do away with it.

So here it goes

STEP1: Launch javaws viewer and remove the xdk

Use javaws to remove the XDK

Use javaws to remove the XDK

STEP2: Find the cache location and Remove Cached xdk files

Find the cache location and delete cached xdk jnlp

Find the cache location and delete cached xdk jnlp

STEP3: Happily do away with the shorcut

Bye bye shortcut. Neaten up your desktop a bit :)

Bye bye shortcut.
Neaten up your desktop a bit 🙂

November 23, 2012

Keep the Internet ‘Free’ and ‘Open’

Internet and Science are two things which needs to be “Open”. Both are absolute essentials for progress of mankind.
Closing even one of them means you’re sending us back to dark ages.

We elect Government to run a country, not make choices of how much knowledge should be accessible to us.
And any Government that decides to hinder that doesn’t deserve to be in power.

Come join hands with me and other sensible people on this planet… and take an action with help from Google.

November 16, 2012

Started giving back to the GameDev community

Yippie! Just contributed back to the Indie game developers community with my first tutorial on solving an Artificial Intelligence behavior for enemy units in a game.

Thanks to all the gamedevs who have been writing tutorials, sharing their ideas and how they solved particular problems … I’ve learnt from couple of tutorials myself. Thank you for being generous and not being selfish / afraid that someone will steal your potential idea.

This is how Open Source works .. even at sharing knowledge.

Interested people can read my tutorial at

More will come as and when I find time…

October 30, 2011

Puppet Cheat Sheet

Filed under: Free / Open Source — krish @ 6:20 pm
Tags: , , , , , , , , ,

I’m trying to keep a log of my fixes, stuff learned while using puppet.
Many have skipped my mind already. 😦
I’ll try to change publish date on this post every time I edit it so that it stays on top.

How to find config settings or env variables in puppet?

$ puppet --configprint templatedir # Specific Env Variable
templatedir = /var/lib/puppet/templates
$ puppet --configprint all # Specific Env Variable

How to syntax check your templates?

$ erb -x -T '-' ../files/apt/sources.list.erb | ruby -c
Syntax OK
$ erb -x -T '-' ../files/apt/sources.list.d/lenny-backports.list.erb | ruby -c
Syntax OK

Unable to sign certificates?
The errors could be:

    a. hostname was not match with the server certificate (or)
    b. Exiting; no certificate found and waitforcert is disabled
    In both cases you will not find the certificate on pupptemaster to sign.


1. /etc/hosts file on client should have the server listed in format
IPAddress hostname_of_server short_hostname_of_server puppet
Example: predator01.mydomain.local predator01 puppet

2. Make sure that the domain and search parameters in /etc/resolv.conf of client is same as your host domain
Example: /etc/resolv.conf
domain local
search local
And my hostname is human01.mydomain.local
If your hostname is like then 'domain' and 'search' in /etc/resolv.conf should be

3. After ensuring (1) and (2) are fixed as above, clear ssl stuff
$ cd /var/lib/puppet/ssl
$ sudo mkdir old
$ sudo mv * old/

4. Now run client again
$ sudo puppetd -tdv

5. On server sign the cert
$ sudo puppetca --list
$ sudo puppetca --sign human01.yourdomain.local

October 28, 2011

Virtualization AMD-V on AMD E-350 Zacate

If you have a AMD Zacate processor based notebook ( Hp dm1, IBM x120e, Sony VaioYB ) and VirtualBox complains of AMD-V being unoperational.

The error on VirtualBox is something like:

VT-x/AMD-V hardware acceleration has been enabled, but is not operational. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.


Go to BIOS setup and find a option that says “SVM support” and Enable it.

AMD-V Enable "Secure Virtual Machine" mode

SVM means “Secure Virtual Machine” support.

Update: If your VirtualBox freezes when installing 64 bit OS using AMD-V capabilities, it is a bug in Virtualbox and has been fixes in 4.1.2
If you’re using an LTS Ubuntu and installed VirtualBox from repos, then you probably have 3.1.6. Uninstall it and install the >4.1.2 deb available on

September 28, 2011

Core dump Xen domU/guests

Filed under: Free / Open Source — krish @ 7:39 pm
Tags: , , , , , , , , , , ,

If you’ve been wondering why on_crash='coredump-restart' or on_crash='coredump_restart'(as per some manuals) doesnt work or gives you
“Error: Invalid event handling mode: crash”, here’s why:

I spend hours looking for the answer, and no one one ##xen would also tell me why (asked multiple times, and idled long enough)..and after breaking my head for hours I found the answer.
So listen carefully 🙂

A. Xendump can be configured to capture vmcore dumps of para-virtualized (PV) Xen domU/guests automatically upon a crash. ie., by using on_crash=’coredump-restart’

B. Core dumps from fully-virtualized (FV) Xen domU/guests can only be taken manually by running the `xm dump-core` command.


Here’s a detailed how-to on enabling coredump for Xen domU/guest:


1. On the dom0/Xenserver, edit /etc/xen/xend_config.sxp and uncomment
# (enable-dump no)
and make it
(enable-dump yes)

2. Restart Xend (depending on whether you use init.d scripts or service utility)
# /etc/init.d/xend restart
# service xend restart

3. On the domU/Guest, edit domU.cfg (domU’s configuration file) and add/edit line

#If your domU is fully-virtualized


#If your domU is para-virtualized

4. Start domU

# xm create /path/to/domU.cfg

5. Now, if your domU/guest is para-virtualized, login to the domU and

Check if kernel.panic key is true
# sysctl -A | grep -e kernel | grep -e panic

Set them if they are not
# sysctl -w kernel.panic=1
# sysctl -w kernel.panic_on_oops=1

6. Test it from inside domU/Guest. (Para-Virtualized Guest)
Warning: The next line of code will crash your domU for test.

# echo "c" >/proc/sysrq-trigger

Note: The above command is a way of invoking magic sysrq
a. It will not work if sysrq is disabled on the box
b. NO. I am not gonna talk about magic sysrq’s in this post; or even how to find if its disabled 🙂

7. Test it from dom0/Xenserver. (Fully-Virtualized Guest)
Warning: The next line of code will crash your domU for test.

# xm dump-core -C

8. Above steps 6/7 will dump vmcore to /var/xen/dump (default directory unless you have changed it)
Oh, BTW, make sure you create that directory if it doesn’t exists before taking the dump 😀

Enjoy analyzing the dump 😉

December 24, 2010

Poking DELL

Filed under: Free / Open Source — krish @ 1:24 am
Tags: , , , , ,

Just trying to poke Dell here, and see if this works 🙂


Need m101z minus Windows!

Update 24 Dec: Got a wake up call from DELL today, probably to understand this and take the suggestion to higher management.
Fingers crossed! ……… ok now uncrossed I gotta work. 🙂

Update 21 Jan:

Still waiting for News on this:

I am not paying for the OS I don't want!


Reminds me of

July 30, 2010

Introducing Android at IETE

Filed under: Free / Open Source — krish @ 1:27 pm
Tags: ,

Had fun giving a small seminar on Android at IETE Center, Hyderabad.

Was the last speaker of the day and audience was quite drowsy, half-dead due to long presentations and would have tied me up to a tree if I pulled a long seminar.
Finished it in short with a sprinkles of humor.

Content is available at
To download:
svn checkout TheAndroid.pdf

April 27, 2010

A book on Zabbix by Richards Olups from Packt Publishing

Filed under: Free / Open Source — krish @ 7:41 pm

Scrolling down page by page of this book, I no more feel like a reviewer; it has kept me hooked and there’s more to it than just looking at it with a critic’s angle.

While I am enjoying my special reviewers copy 😉 , you can download the sample chapter here.

If you think that’s neat, hear this:

“Celebrating the launch of two new brands; Packt Open Source and Packt Enterprise(26th April 2010), Packt is giving away two ebooks (that’s right not one, but two) to all those who log in to” – source

So, hurry guys, it’s still open. 🙂

Next Page »

Create a free website or blog at

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none


A signature of Kiran


This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion. is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: