Monday, January 2, 2012

Key logger (Kernel space)

I am done with the development of a new Linux key logger (Kernel Space)..

Simply its a Linux kernel module that sniffs key strokes and saves it in an in-memory buffer, and then any user space can read it from /dev/klg virtual device node.

You can download the source code and try it yourself from sourceforge.

Here is the video demo for it..



i will supply a link to download another user-space one soon :)

Sunday, January 1, 2012

Apache JMeter for Performance/Load Testing

In this post i will describe the benefits and usage of JMeter as well as the installation steps.

Agenda
  • Introduction
  • Features
  • Installing JMeter
  • Using JMeter
    • Test plan
    • Building a simple web test plan
  • References
Introduction

The Apache JMeter™ desktop application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions. 

Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load. 

Features
  • Can load and performance test many different server types:
    • Web - HTTP, HTTPS
    • SOAP
    • Database via JDBC
    • LDAP
    • JMS
    • Mail - POP3(S) and IMAP(S)
  • Complete portability and 100% Java purity .
  • Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by seperate thread groups.
  • Careful GUI design allows faster operation and more precise timings.
  • Caching and offline analysis/replaying of test results.
  • Highly Extensible:
    • Pluggable Samplers allow unlimited testing capabilities.
    • Several load statistics may be choosen with pluggable timers .
    • Data analysis and visualization plugins allow great extendibility as well as personalization.
    • Functions can be used to provide dynamic input to a test or provide data manipulation.
    • Scriptable Samplers (BeanShell is fully supported; and there is a sampler which supports BSF-compatible languages)

Installing JMeter
  • Download the appropriate jmeter package (Here)
  • Extract the package (e.g., Linux use tar xvf PACK_NAME)
  • Go to the bin directory (e.g. Linux cd PACK_PATH/bin)
  • Run the jmeter.sh (Linux) jmeter.bat (Windows) (e.g. Linux ./jmeter on the terminal)
  • The previous step will require JVM to be installed on your machine (Here)
  • Check the PACK_PATH/docs for information of how to use it
Using JMeter

Test Plan

A test plan describes a series of steps JMeter will execute when run. A complete test plan will consist of one or more Thread Groups, logic conrollers, sample generating controllers, listeners, timers, assertions, and configuration elements. For more information about Test plan see Building a Test Plan.

Building a simple web test plan 

See the Building a Web Test Plan tutorial on the apache web site, Also you may go and have a look at my latest article about Apache JMeter along with JSF.

References 

Hudson (For java geeks)

While searching for a java program like ccache and distcc i found this project that includes the features included in both ccache and distcc and much more features.

Note: Distcc is a program that distribute builds of C/C++ across several machines on a network, while ccache acts as a cache pre-processor to C/C++ compilers, which results in 5 to 10 times speedup in common compilations.

Agenda
  • Introduction
  • Hudson features
  • Hudson best practices
  • Hudson eclipse plugin
  • How to contribute?
  • References
Introduction

Hudson monitors executions of repeated jobs, such as building a software project or jobs run by cron. Among those things, current Hudson focuses on the following two jobs:

Building/testing software projects continuously, Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity. 

Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Hudson keeps those outputs and makes it easy for you to notice when something is wrong.


Hudson features

Hudson offers the following features and much more:
  •  Change set support: Hudson can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help. There's no need to tweak XML manually anymore, although if you'd like to do so, you can do that, too.
  •  Permanent links: Hudson gives you clean readable URLs for most of its pages, including some permalinks like "latest build"/"latest successful build", so that they can be easily linked from elsewhere.
  • RSS/E-mail/IM Integration: Monitor build results by RSS or e-mail to get real-time notifications on failures. 
  • After-the-fact tagging: Builds can be tagged long after builds are completed 
  • Distributed builds: Hudson can distribute build/test loads to multiple computers. This lets you get the most out of those idle workstations sitting beneath developers' desks. 
  • File fingerprinting: Hudson can keep track of which build produced which jars, and which build is using which version of jars, and so on. This works even for jars that are produced outside Hudson, and is ideal for projects to track dependency. 
  • Easy installation: Just java -jar hudson.war for testing. Use a native package or deploy it in a servlet container for production use. No additional install, no database.
  • Easy configuration: Hudson can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help. There's no need to tweak XML manually anymore, although if you'd like to do so, you can do that, too. 
Hudson best practices 

Continuous integration with automated test execution has seen board adoption in recent years. The ideas behind continuous integration have been changed how companies look at Build Management, Release Management, Deployment Automation, and Test Orchestration. This section provides a set of best practices for Hudson - A Continuous integration to provide executives, business managers, software developers and architects a better sense of the development progress and code quality of projects throughout the development lifecycle. (View Hudson Best Practices)

Hudson eclipse plugin 

Hudson integrates with Netbeans, Eclipse, and many other IDEs and tools, check this link for a list of tools integrates with hudson.

Install using the Update Manager or drop dk.contix.eclipse.hudson_x.x.x.jar in the plugins/ dir.
The update site url is URL.
 
After installation, the plugin must be configured. This is done in Preferences under Hudson. The important parameter is Hudson base url, which should point to the main Hudson page.

When the plugin is running, a health icon is displayed at the bottom of the Eclipse window. The icon is red on build failure and green on success. Double-click on the icon to open the Hudson view, where all projects in Hudson can be tracked. Please note that due to limitations in Eclipse, the Hudson view must be active before the icon is displayed. 

How to contribute? 

Check out this page.

References