Getting the Brightness Control to work on Lenovo ThinkPad with Linux Mint 17 (x64) installed and with Nvidia Quadro K1000M on board

I haven’t had much problems with getting the Brightness Control to work in Mint 16, but after installing v17 I had to struggle much more.

I honestly admit that I don’t know which of the following steps actually did the trick, nevertheless it works now πŸ™‚

OK, I’m currently running Mint 17 x64 on Lenovo W530 with Nvidia Quadro K1000M and with Nvidia 331.38 installed.

Display mode in BIOS is set to “Discrete Mode”.

Here’s a list of things I did:

– I’ve updated the bios to latest available version (G5ET99WW (2.59))

Here’s my tutorial how to upgrade it from a USB pendrive

– Generated a new xorg.conf using “NVIDIA X Server Settings” -> “X Server Display Configuration” -> “Save to X Configuration file”

– Then added “EnableBrightnessControl=1” to the device section in /etc/X11/xorg.conf:

     Section "Device"
         Identifier     "Device0"
         Driver         "nvidia"
         VendorName     "NVIDIA Corporation"
         BoardName      "Quadro K1000M"
         Option         "RegistryDwords" "EnableBrightnessControl=1"
     EndSection

– After rebooting, the only thing I could find in /sys/class/backlight was:

thinkpad_screen

– Then I tried to set the “GRUB_CMDLINE_LINUX_DEFAULT” in /etc/default/grub to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"

or

> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nox2apic acpi_osi=Linux acpi_backlight=vendor"

but that didn’t work

– Finally I set it to only:

> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nox2apic"

– and after rebooting Brightness Control buttons (Fn+F8 & F9) started to work
and in the /sys/class/backlight I found acpi_video0 instead of thinkpad_screen

     $ ll /sys/class/backlight
     total 0
     lrwxrwxrwx 1 root root 0 Aug 10 10:14 acpi_video0 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/backlight/acpi_video0/

I hope this will help someone.
Pls drop some comments if it helped you!

Cheers,
SeΓ±or QA

Create a bootable USB on Linux (Mint, Ububtu) pendrive to upgrade Lenovo ThinkPad W530 BIOS

Recently I had to update the bios of my laptop from a USB pendrive, because I had no CD/DVD drive around.

Cameron Seader’s post http://blog.seader.us/2013/10/lenovo-bios-update-method-for-linux-and.html came very handy, but used an obsolete tool so I updated his instructions a bit to make them work.

1. Get the machine type and model of your laptop
In order to grab this information you can either go to the BIOS or use dmidecode or hwinfo.
In my case it was ThinkPad W530 2438-2KU.

2. Download appropriate bios update iso from Lenovo’s site
I got mine: “g5uj22us.iso” from http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS029170

3. Extract the boot image from the iso
To do it you can use genisoimage, which can be installed using regular:

$ sudo apt-get install genisoimage

or can be downloaded from: http://manpages.ubuntu.com/manpages/lucid/man1/genisoimage.1.html
Once you have this tool, run:

$ geteltorito g5uj22us.iso > biosupdate.img

4. Copy the boot image to the USB pendrive

$ sudo dd if=biosupdate.img of=/dev/usbthumdrive bs=512K

Reboot and boot from USB to run the Flash Utility

Cheers,
SeΓ±or QA

GEE [Jmeter-ec2] – video tutorials part 2

Hi All,

I just added few more videos showing how to configure your test environment to run your JMeter tests:

  • locally on a Vagrant box
  • using remote machines
  • and on Amazon EC2

04 – create a first test plan, run it using Gee and a vagrant box
Shows how to create a new test plan from a template project. Then how to run it using GEE on our local vagrant box.

05 – configure passwordless ssh access to a linux box
Shows how to configure a passwordless SSH access to a remote Linux box. Such access is required by Gee to run your JMeter tests on a remote machine.

06 – automatically install JMeter with plugins on a remote machine
Shows how to use download-jmeter.sh script to download JMeter and JMeter-plugins automatically on a linux host that will be used by GEE to run your load tests.

07 – run your JMeter test on remote linux hosts
Shows how to configure GEE and remote Linux hosts to run your JMeter tests. This video might come handy when you’d like to run your tests using internal network resources.

08 – run your JMeter test on Amazon EC2
Shows how to configure GEE to run your JMeter tests using Amazon EC2 services.

Configure your Logitech Performance MX Mouse buttons to work with Linux Mint

To make your extra mouse buttons work on Linux Mint (I’ve tested it with v15) follow all the steps listed in this tutorial except the step 4 πŸ™‚

Once you get to step 4, use this key mappings to make the ‘zoom’ and ‘switch between windows’ buttons work as on windows.

vi $HOME/.xbindkeysrc
...

# show all windows: Scale
"xte 'keydown Control_L' 'keydown Alt_L' 'key Down' 'keyup Control_L' 'keyup Alt_L'"
  b:10 + release

# Zooming with Logitech Performance MX mouse
# thx to: http://www.ralf-oechsner.de/opensource/page/logitech_performance_mx
# Press 'zoom' button and scroll up/down to zoom in/out
# then press the 'zoom' button again to exit from the 'zoom' mode
"xte 'keydown Control_L' &"
   b:13
"xte 'keyup Control_L' &"
   Control + b:13

I hope that you’ll like Mint even more from now on πŸ™‚

How to add official Chromium-browser PPA repository to Linux Mint 15 and install the latest stable build

Here’s the official Chromium-browser PPA repo: https://launchpad.net/~chromium-daily/+archive/stable

To install latest stable build follow 3 simple steps:

Step 1:
add “deb http://ppa.launchpad.net/chromium-daily/stable/ubuntu raring main” to /etc/apt/sources.list

Step 2:
add repo’s pub key so that we can avoid problems like the one below:

W: GPG error: http://ppa.launchpad.net raring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
sudo gpg --keyserver hkp://keys.gnupg.net:80 --recv 5A9BF3BB4E5E17B5
sudo gpg --export FBEF0D696DE1C72BA5A835FE5A9BF3BB4E5E17B5 | sudo apt-key add -

btw. using hkp://keys.gnupg.net:80 will work even if you’re behind a firewall or proxy πŸ™‚

Step 3:
Update package list and install Chromium

sudo apt-get update
sudo apt-get install chromium-browser

Step 4:
Happy browsing πŸ™‚

Monitoring JVM metrics via JMX managemnet interface in JMeter

What do we need:

Once you have plugins installed them in the jmeter’s/lib/ext folder, then:
1 – On the box you want to monitor, copy templates: jmxremote.password & jmxremote.access from $JAVA_HOME/lib/management to for example: /srv/play/
2 – edit them according to your liking
3 – launch your JAVA application with additional parameters:

java -jar your_application.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=10006 -Dcom.sun.management.jmxremote.password.file=/srv/play/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/srv/play/jmxremote.access

4 – start a server-agent (http://jmeter-plugins.org/wiki/PerfMonAgent/) on the host which JVM metrics you want to monitor using command like:

cd ${jmeter_folder}/lib/ext/
java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 0 --tcp-port 7777

You can also run it as background process and detach from your session, so it will continue to work even if you disconnect from the server.

cd ${jmeter_folder}/lib/ext/
nohup java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 0 --tcp-port 7777 &

5 – add “PerfMon Metrics Collector” to your test plan
6 – provide the hostname/IP address of the box running server-agent in the “Host/IP” field (don’t forget about the port πŸ™‚ )
7 – select JMX as the “Metric to collect”
8 – double click on “Metric parameter” field and then click on the “…” button to the right
9 – enter all the credentials that the server-agent will use to connect to the local JVM via JMX port. Here’s an example config:

url=localhost\:10006:user=role:password=password:gc-time

where role & password are of course defined in the jmxremote.password & jmxremote.access files

btw. Here’s an example test plan with preconfigured PerfMon listener.

If everything was configured properly the you should see something like that on the PerfMon graph:

example PerfMon graph with JVM Metrics

example PerfMon graph with JVM Metrics

How to selectively run, in jBehave, stories tagged with multiple words in a meta field.

Prerequisites:
1) a working jBehave based project
This short tutorial is based on an jbehave-tutorial project available on github: https://github.com/jbehave/jbehave-tutorial.
To be precise I used the “java-spring” submodule from the “etsy-selenium” module, available here: https://github.com/jbehave/jbehave-tutorial/tree/master/etsy-selenium/java-spring, to run the modified story presented below.
2) Maven

OK, let’s consider a situation when we have stories belonging to multiple features, categories etc.
Below is an example story, tagged with multiple categories and features:

anExampleStoryWithMultipleWordsInAMetaKeyword.story

Meta:
@categories category1 category2 category3
@features feature1 feature2 feature3 feature_4

Scenario: scenario description
Given I'm on the homepage
....

Now, we’d like to run stories only for a selected category or a feature.
To accomplish this we’ll use the value pattern matching mechanism implemented in the jBehave meta matcher and described here.

Examples:
Run stories covering only category3:

mvn clean install -Dmeta.filter="+categories *category3*"

Run stories covering only feature_4:

mvn clean install -Dmeta.filter="+features *feature_4*"

And finally, run stories matching feature2 and category1:

mvn clean install -Dmeta.filter="+features *feature2* +categories *category1*"

Notice:
It seems that jBehave is not handling “-” hyphens in the keyword value properly, but it works fine with “_” underscores, separate words and camelCase notation πŸ™‚