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

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.

https://www.google.com/takeaction

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 http://www.scirra.com/tutorials/408/enemy-ai-for-range-of-fire-and-line-of-sight-top-down-player/

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.

Solution:

1. /etc/hosts file on client should have the server listed in format
IPAddress hostname_of_server short_hostname_of_server puppet
Example: 192.168.1.90 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
nameserver 8.8.8.8
And my hostname is human01.mydomain.local
If your hostname is like human01.yourdomain.com then 'domain' and 'search' in /etc/resolv.conf should be domain.com

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
human01.yourdomain.local
$ 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.

Solution:

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 virtualbox.org

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
or
# 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
on_crash='restart'

or

#If your domU is para-virtualized
on_crash='coredump-restart'

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 :D

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 http://toonheart.com/?p=11

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 http://code.google.com/p/toonheart/source/browse/tags/2010/docs/TheAndroid.pdf
To download:
svn checkout http://toonheart.googlecode.com/svn/tags/2010/docs/TheAndroid.pdf 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 http://www.packtpub.com”; – source http://www.packtpub.com/news/brand-launch-free-ebooks

So, hurry guys, it’s still open. :)


April 9, 2010

Mail reporting from postfix

Filed under: Free / Open Source — krish @ 12:36 pm
Tags: , , , ,

One of the good log analyzing scripts that I’ve come across is pflogsumm.
It designed to provide an over-view of postfix activity, with just enough detail to give the administrator a “heads up” for potential trouble spots.

Here’s how you get it running into your mail server:

1. Download the current production version from http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz

2. Download the md5 hash from http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz.md5

3. Check md5

# md5sum pflogsumm-1.1.1.tar.gz
2f570477b2e205f9dfc1df13f00b5c0d pflogsumm-1.1.1.tar.gz

# cat pflogsumm-1.1.1.tar.gz.md5
2f570477b2e205f9dfc1df13f00b5c0d pflogsumm-1.1.1.tar.gz

4. Copy the script to one of $PATH’s location and remove write access

# cp pflogsumm-1.1.1/pflogsumm.pl /usr/local/sbin/

# chmod 500 /usr/local/sbin/pflogsumm.pl

5. Write a script depending on whether you want to parse archived maillog or current maillog; I used current maillog

# vi /root/.krish_scripts/postfix_reporter.sh

#!/bin/bash
DATE=`date`
/usr/local/sbin/pflogsumm.pl -u 10 -h 10 --no_no_msg_size --no_deferral_detail --no_bounce_detail -q /var/log/maillog | mail -s "Hourly Mail Statistics for super secret mailserver $DATE" sysadmin@somedomain.com

6. Run the script hourly

# ln -s /root/.krish_scripts/postfix_reporter.sh /etc/cron.hourly/mailreport

7. Take a coffee break ;)

Best thing about this – It is licensed under GPL.

March 25, 2010

Promising Open Source Cloud – Eucalyptus

Filed under: Free / Open Source — krish @ 10:09 am
Tags: , , , ,

Eucalyptus Public Cloud (EPC) is a sandbox environment in which members of the community can test-drive and experiment with Eucalyptus.

It is an open source software framework for cloud computing that implements what is commonly referred to as Infrastructure as a Service (IaaS).
It provides users with the ability to run and control isolated collections of virtual machine instances with many EC2/S3-compatible tools.

So finally something to compete EC2 from the open source world :)

Looks promising.. downloading it already. Any experiences? Anyone?

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: