Sunday, May 24, 2015

about Resilient testing

With the wide spread adoption for Agile development methodologies and continuous integration features a recondite form of testing called a Resilience testing in coming into focus. If you have not heard of Resilient testing, then its better late than never to learn about it.

Resilience is a non-functional form of testing which evaluates as to how well a product can deliver when one of many of its components fail. Irrespective of the type of coupling (Cohesion) between modules of a product or between interdependent services, the resilience testing is always relevant because, for example, continuous integration of modules can bring about failure in the system if the necessary scenarios are not covered during testing.

Resilience testing can also be understood as how well a system/product can bounce back or continue to perform in face of some failure. It is also refereed to as Recoverability testing and this would extend its meaning as to how well the system/product/service can recover from a failure. For example, assuming a we-server went down, Resilience would also test how best it would bounce back with out loss of data or functionality.

Please do share your view about Resilient and Recoverability testing.

Wednesday, May 13, 2015

Data formatting stupidity can make you waste a lot of productive time.

Last night I kept getting JSON related errors, I looked at my java code that was using JSONObject to extract data. Below is what happened and what was learned from it to avoid wasting time (esp when you are burning the midnight oil)

Mistake: Instead of looking at how the data was being handled, once read it from the file, I kept looking at the JSON in the file.

I had JSON data in a text file and I was trying to parse through it. So during the initial code write up, I read the data and stored it all in a String and to be able to confirm that all the data is being read I reinserted the formatting to make it look like how it looked in the text file. I printed it and once satisfied that data was being read correctly, I moved on to implement further functionality .....without.... deleting the debug code.......and reusing the same string object to extract the needed data. Brilliant!!! ain't it.

lesson learned: comment or delete the debug code once its purpose is completed. Always look at how the data is being handled.



Wednesday, December 24, 2014

SoupUI stuck in splash screen on Ubuntu 14.**

I ran into this issue with SoupUI, where the application is stuck at splash screen and nothing else happens. After banging my head, checking Java path, logs and general common mis-configuration possibilities. I decided to Google and BHAM!, it was configuration err..... we lets not say configuration, since there seems to be an dependency related issue with installation of the SoupUI that comes with its own JRE.

So instead of downloading the executable  SoapUI-x32-5.0.0.sh (119.2 MB) (which comes with the JRE in it), we should download SoapUI-5.0.0-linux-bin.tar.gz, just extract it to the desired location and you are good to go. 

I am not sure if this issue is seen with OpenJDK as well, since I had Oracle's JDK 7 installed. 

Monday, May 28, 2012

Installation of PHP5,MySQL and Apache on Ubuntu


This article will describe installation of Apache,MySQL and PHP on a Ubuntu host. This is the most simple and straight forward way to install. If you intent to use the host as just a server and not for everyday desktop/laptop use, then its better install Ubuntu server edition of LTS (Long Term Support), which would be 12.04 as of this writing. Though one can use Tasksel to install the lamp-server, We prefer to install each package at a time. This way we can only install what the server will be used for.

Installation on Ubuntu can be done in three ways:


  • from Ubuntu repositories using apt-get, aptitude or Synaptic package managers.
  • from source file; compiling and installing them individually. (the hardcore method).
  • from the binary packages available at the respective sites.


Installation of  Apache  :

The Apache2 web server is available in Ubuntu repository  as “apache2” package.
  1. Open a terminal window, and use the following command to install Apache2 :

>  sudo apt-get install apache2

     2.  To check whether the Apache2 is stored:

           go to  “/etc” and check for apache2 folder. The folder should  contain main configuration file i.e., “apache2.conf”.

     3.  After making any required changes or after installation, we should restart Apache2  service. this can be done by executing the command:

         >  sudo /etc/init.d/apache2 restart

     4.  Create a new text editor file such as "sudo nano " or "gksudo gedit"

          >sudo nano /etc/apache2/conf.d/fqdn
           or
         >gksu "gedit /etc/apache2/conf.d/fqdn"


Installation of  php5  :


PHP5 is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages.

      1. Open a terminal window, and use the following command to install php5:
         >  sudo apt-get install php5


      2. If you are running PHP you will also need to install the php module for apache2 :
         >  sudo apt-get install libapache2-mod-php5


      3.  To check whether the PHP5 is stored:
 go to  “/etc” and check for php5 folder . The folder should  contain configuration folder i.e., “conf.d”.In this folder there will be all .ini files.



Checking PHP 5 installation :


   1. Create a new text editor file such as "sudo nano " or "gksudo gedit"
> gksudo "gedit /var/www/testphp.php" 2. Write some php code to test php5 or use the following simple codes to test php5. (1) <?php print_r (phpinfo()); ?> (2) <?php echo "Hello, world!"; ?> 3. Run in the browser as “//http://localhost/testphp.php " If you use the 1st test code : You will see the complete information of PHP5 i.e., php version, configuration, apache environment ,......... so on. If you use the 2nd test code : You will see Hello, world! The file “testphp.php” is stored in the /var/www directory. 4. To run PHP5 scripts from command line you should install php5-cli package. To install php5-cli you have to enter the following command in the terminal prompt: >sudo apt-get install php5-cli 5. You can also execute PHP5 scripts without installing PHP5 Apache module. To accomplish this, you should install php5-cgi package. You can run the following command in a terminal prompt to install php5-cgi package: >sudo apt-get install php5-cgi



Installing MySQL 5 Server on Ubuntu is a quick and easy process:


MySQL is a widely spread SQL database management system mainly used on LAMP (Linux/Apache/MySQL/PHP) projects. 1. Open a terminal window, and use the following command to install Mysql5 : > sudo apt-get install mysql-server 2. If you are running PHP you will also need to install the php module for mysql 5: > sudo apt-get install php5-mysql 3. If you have already set a password for the mysql root while installing, then you will need to use: > mysql -u root -p Enter Password:

How-To create a MySQL database and set privileges to a user : In order to be able to use a database, we need to create: a new database, give access permission to the database server to a database user and finally grant all right to that specific database to the user.
  
1. Create a mysql database  :
Syntax :
mysql>  CREATE  DATABASE  <databasename>;
           
            Example:
mysql>create database guest;
 Query OK, 1 row affected (0.00 sec)

      (The above command creates the database called “guest”)
   
      2.  After the database is created, we must select it to continue with our database building.

mysql> use guest;
Database changed
           mysql>


     3. Granting all privileges to new  user :

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost'
                    IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;


     4. Granting fewer privileges to new user  :

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,      ALTER, CREATE TEMPORARY   TABLES, LOCK TABLES ON database1.* TO
'yourusername'@'localhost' IDENTIFIED BY 'yourpassword';
 

Exit from MySQL : 

 To exit the mysql prompt type:
     mysql> \q   
     (or)
     mysql> exit



Important Links:


1) Ubuntu LTS: http://www.ubuntu.com/
2) Apache Project: http://www.apache.org/
3) MySQL: http://www.mysql.com/
4) PHP5: http://www.php.net/
5) LAMP Installation on Ubuntu: https://help.ubuntu.com/community/ApacheMySQLPHP

Tuesday, November 9, 2010

Accessing encrypted home folder using Ubuntu live cd

So my laptop crashed during the upgrade to 10.10.
There was no easy way to recover the system,
so time to back up data. but I did not realize until,
I encrypted the home my home folder. so how to
recover the data for back up.

below is the solution provided by "jrider" from Ubuntu forums.

//Mount the disk partition containing
//the Encrypted Home Directory:
ubuntu@ubuntu$ sudo mount /dev/sda1 /mnt
Establish a proper chroot environment:
ubuntu@ubuntu$ sudo mount -o bind /dev /mnt/dev
ubuntu@ubuntu$ sudo mount -o bind /dev/shm /mnt/dev/shm
ubuntu@ubuntu$ sudo mount -o bind /proc /mnt/proc
ubuntu@ubuntu$ sudo mount -o bind /sys /mnt/sys
ubuntu@ubuntu$ sudo chroot /mnt

//Become the user whose data needs recovery (i.e. “foo”)
//and manually add the necessary mount passphrase to the
//kernel session keyring:

root@ubuntu$ su – foo
foo@ubuntu$ ecryptfs-add-passphrase --fnek
Passphrase:

Mount the encrypted directory and then access the data:
foo@ubuntu$ ecryptfs-mount-private
foo@ubuntu$ cd $HOME
foo@ubuntu$ ls -alF

Friday, October 31, 2008

its 1:34 am!

Life can be easy of it can be tough, it depends on how one sees it. I try to see it in a new way every single time, but the view is still the same and I end up fooling myself thinking its going to be different.

I ask myself, do I like my life?, the answer strikes me "what else can you do?". You can get fatter or thinner, you can be famous for good or bad reasons, But what is the use of it, the world will still be as it was......it might influence some people, but honestly who are we fooling. Even after people like Buddha, Mahatma Gandhi, Martin Luther and thousands others crying out for peace......we still fight and kill. so what has changed and will it change if I stand still.