Ruben Laguna’s blog

How to Disable Internal Loudspeaker

My Compaq Evo has two internal speakers, the PC speaker (the one responsible for beeps, etc) and another conventional loudspeaker connected internally to the sound board. One would expect that conecting the headphones to the headphones jack will automatically shut off/disable the internal speaker but it doesn’t. You must first go to the Volume Control at System → Preferences → Volume Control and then click Edit→Preferences and enable the Headphone Jack Sense checkbox. I wonder why it is not enabled by default.

How to Enable Windows Key as Super Key in Linux

I’ve you tried beryl or compiz you probably had notice that the Super key (the windows key, also known as Meta key) is used a lot. By default in my Fedora Core 6 installation the Windows key is not enabled, I had to add Option "XkbOptions" "altwin:super_win" to the InputDevice section of my /etc/X11/xorg.conf to activate it.

This is how the InputDevice section look like now:

...
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "es"
        Option      "XkbOptions" "altwin:super_win"
EndSection
...

via Noiesmo’s GNU/Linux Site

CVS Pserver,xinetd and SELinux

Today I faced a strange problem setting up CVS pserver as an xinetd service. I was getting “Permission denied” error on CVSROOT/config file. But cvs ran as root and config file permission were ok. Then I realized (by reading this post)
that the problem was SELinux.

setenforce 0

solved the problem. I have to dig a little more on restorecon and ls -Z to understand how to setup SElinux, xinetd and CVS in the right way.

Enabling Bash History and More

After reading the tip I mentioned in my previous post I made some changes to my `~/.bashrc` to enable bash history

1
2
3
4
5
6
7
8
9
10
11
12
13

1
2
3
4
5
6
7
8
9
10
11
12
13
<span class='line'>alias e32="$HOME/eclipse/eclipse321/eclipse"
</span><span class='line'>alias e33="$HOME/eclipse/eclipse33M4/eclipse"
</span><span class='line'>alias nb="$HOME/netbeans-5.5/bin/netbeans"
</span><span class='line'>
</span><span class='line'>JAVA_HOME=$HOME/jdk1.6.0
</span><span class='line'>PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:
</span><span class='line'>
</span><span class='line'>export PATH
</span><span class='line'>HISTFILESIZE=1000000000
</span><span class='line'>HISTSIZE=1000000
</span><span class='line'>HISTCONTROL=ignoredups 
</span><span class='line'>shopt -s histappend
</span><span class='line'>INPUTRC=~/.inputrc</span>

and to my `~/.inputrc`

1
2
3
4

1
2
3
4
<span class='line'># .inputrc
</span><span class='line'># "\e[A" and "\e[B" being whatever your terminal uses for up & down.
</span><span class='line'>"\e[A": history-search-backward
</span><span class='line'>"\e[B": history-search-forward</span>

And with the following simple command I can see the commands I use most:

1

1
<span class='line'>cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30</span>

JMeter JDBC Sampler

UPDATE2:: It seems that my bugreport has been reviewed and the patch I submitted is merged into the JMeter svn tree. I also submitted a couple of patches dealing with COMMIT behavior that also have been included into the svn tree. so I strongly advise to use the standard JDBC Sampler as it includes alll features of the Enhanced JDBC Sampler plus other corrections

UPDATE: It seems that the patch has been merged with the standard JMeter source code tree as SVN r528906. I think, however, that the change it’s not present yet in the 2.2 release you need to download the Nightly Build.

Some time ago I posted a bug report for Apache JMeter benchmarking utility (you can find my other jmeter bug reports here) . The bug report contains an enhancement of the current JDBC Sampler to allow JMeter to invoke PreparedStatements and also to change the way Callable Statements are handled to avoid performance problems when using some JDBC drivers (mainly Sybase). Because I don’t know if this bug report will ever be integrated in JMeter or when. I decided to release this “Enhanced JDBC Sampler” as a JMeter plugin.

The installation is quite simple just download EnhancedJdbcSampler.jar and put it in $JMETER_HOME/lib/ext. Once you restart JMeter you should see a new option under Add → Samplers called “Enhanced JDBC Request”. It works just like the old JDBC Sampler (see docs on how to use JDBC sampler here and here).Don’t forget to add the jdbc drivers jar into the lib directory The difference with the conventional JDBC Sampler is
that you now have more options under Query type and there are two new text boxes at the bottom of the page. In the first box,you write the param values, and in the second box you write the param types. See the image below for an example.

Enhanced JDBC Sampler Screenshoot

In this example there are two parameters: the literal 1 and the variable ${A}. (In this particular case the ${A} comes from a Counter). The type of both parameters is INT. Check the list of JDBC Types. Source code If you are interested in looking at the code you can download it. It an Eclipse project so you can import it to your workspace using “Import→Existing projects into workspace”. Or you can just unzip it and use Apache Ant to build the project.

Better JMeter Graphs

If you are tired of the old “Graph Results” listener that JMeter provides and want better charts in your Jmeter test plan take a look at this JMeter plugin.

This is how the old “Graph Results” look like:

Old Graph Results

Click on the above image or here to see an enlarged version of the old Graph Results

Checkout
this new JMeter plugin that provides a new Statistical Aggregate Report listener. (see the screenshot)

Statistical Aggregate Report

Click on the above image or here to see an enlarged version

Installation

To install the plugin you only have to unzip the StatAggVisualizer.zip
into the JMeter 2.2 installation dir. The zip file has four files, three of them go into the $JMETER_HOME/lib directory and the other file goes into the $JMETER_HOME/lib/ext directory. When you unzip the zip file it will create the appropiate directory structure, but just in case the jcommon-1.0.5.jar, jdnc-0.6-all.jar and jfreechart-1.0.2.jar goes in the $JMETER_HOME/lib and StatAggVisualizer.jar goes on the $JMETER_HOME/lib/ext.

Once is installed, restart JMeter and now you must see a new “Statistical Aggregate Report” in the Add → Listener menu.

This plugin it’s mainly the work of Lars Krogjensen (he provided most of the code) I only modified it a bit and repackaged it. You can find the source code below.

Previous version was compiled with jdk1.6.0 and therefore it only run on jre1.6.0 (Thanks to Daniel for pointing this out). This new version I’ve tested it with j2re1.4.2_10, jre1.5.0_06 and jdk1.6.0 and it runs on all three java platforms.

Source code

For those of you that want to take a look to the source code I exported the Eclipse project from my workspace as a zip file . Once you have downloaded it go to Eclipse “Import→Existing projects into Workspace”. You can also unzip it and use Apache Ant to build the plugin.

Hope you find it useful.

Enhanced JDBC Sampler for Apache JMeter

I’ve moved this post to the following page.

UPDATE: The files here will only run in JRE 1.6. I will try to provide JRE 1.5-compatible files as soon as possible. Thanks to Daniel for pointing this out. Some time ago I posted a bug report for Apache JMeter benchmarking utility (you can find my other jmeter bug reports here) . The bug report contains an enhancement of the current JDBC Sampler to allow JMeter to invoke PreparedStatements and also to change the way Callable Statements are handled to avoid performance problems when using some JDBC drivers (mainly Sybase). Because I don’t know if this bug report will ever be integrated in JMeter or when. I decided to release this “Enhanced JDBC Sampler” as a JMeter plugin. The installation is quite simple just unzip the EnhancedJdbcSampler.zip and put the EnhancedJdbcSampler.jar file in the $JMETER_HOME/lib/ext directory. Once you restart JMeter you should see a new option under Add → Samplers called “Enhanced JDBC Request”. It works just like the old JDBC Sampler (see docs on how to use JDBC sampler here and here). The difference with the conventional JDBC Sampler is that you now have more options under Query type and there are two new text boxes at the bottom of the page. In the first box, you write the param values, and in the second box you write the param types. See the image below for an example. Enhanced JDBC Sampler Screenshoot In this example there are two parameters: the literal 1 and the variable ${A}. (In this particular case the ${A} comes from a Counter). The type of both parameters is INT. Check the list of JDBC Types.

Better JMeter Graphs

I’ve moved this post to the following location

UPDATE: The files here will only run in JRE 1.6. I will try to provide JRE 1.5-compatible files as soon as possible. Thanks to Daniel for pointing this out.

If you are tired of the old “Graph Results” listener that JMeter provides

Old Graph Results

Click on the above image or here to see an enlarged version

Checkout
this new JMeter plugin that provides a new Statistical Aggregate Report

Statistical Aggregate Report

Click on the above image or here to see an enlarged version

### Installation ###

To install the plugin you only have to unzip the zipfile
into the JMeter 2.2.1 installation dir. The zip file has four files, three of them go into the $JMETER_HOME/lib directory and the other file goes into the $JMETER_HOME/lib/ext directory.

Once is installed, restart JMeter and now you must see a new “Statistical Aggregate Report” in the Add → Listener menu.

This plugin it’s mainly the work of Lars Krogjensen (he provided most of the code) I only modified it a bit and repackaged it. I’ll post the source code as soon as I can.

Hope you find it useful

Copyright © 2015 - Ruben Laguna - Powered by Octopress