Skip to main content

Posts

Grinderstone under linux

I am using Ubuntu 9.10 jan@albotek:~/development/eclipse$ more /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=9.10 DISTRIB_CODENAME=karmic DISTRIB_DESCRIPTION="Ubuntu 9.10" I installed new eclipse 3.5.2, and inside eclipse used jdk 1.6.0.20 as default JRE, and jython 2.5.1 for my jython. Still I did not manage to get my grinder scripts with proxy working. The failure I was getting: Java exception initialising test script test1.record(grinder.getLogger().output) File "/home/jan/development/workspace-grinder/Grinder1/src/HelloWorld3.py", line 7, in Caused by: net.grinder.script.NonInstrumentableTypeException: Failed to wrap at net.grinder.engine.process.instrumenter.MasterInstrumenter.instrument(MasterInstrumenter.java:114) at net.grinder.engine.process.TestData.instrument(TestData.java:100) at net.grinder.script.Test.record(Test.java:114) In my output log I was seeing: 6/5/10 10:22:09 a.m. (process albotek-0): The Grinder version 3.4 6/5/10 10:2...

Grinderstone and instrumentation

At least I got my office PC (windows) working now. Script is: # A simple example using the HTTP plugin that shows the retrieval of a # single page via HTTP. from net.grinder.script import Test from net.grinder.script.Grinder import grinder from net.grinder.plugin.http import HTTPRequest test1 = Test(1, "Request resource") request1 = test1.wrap(HTTPRequest()) class TestRunner: def __call__(self): result = request1.GET("http://emeafraippqa08:80/") I used to get failures that had to do with instrumentation. In the end I added a new jdk6 (1.6.0.20) to eclipse, renewed my jython 2.5.1 reference so that it is using these libs, and now got it working. In my console I see the following path: 04.06.10 17:03:42 (agent): The Grinder 3.4 04.06.10 17:03:42 (agent): Worker process command line: java '-javaagent:C:\development\grinder-3.4\lib\grinder-agent.jar' -classpath 'C:\development\jython2.5.1\jython.jar;C:\Dokumente und Einstellungen\jan.keste...

record() not wrap()

With the new jython 2.5.1 instrumentation, you must use record() method of Test proxy, and not wrap(). The old one is deprecated. The difference: old: from net.grinder.script import Test from net.grinder.script.Grinder import grinder test1 = Test(1, "Log method") # Wrap the output() method with our Test and call the result logWrapper. logWrapper = test1.wrap(grinder.getLogger().output) class TestRunner: def __call__(self): logWrapper("Hello World2") new: from net.grinder.script import Test from net.grinder.script.Grinder import grinder test1 = Test(1, "Log method") # Instrument the output() method with our Test. test1.record(grinder.getLogger().output) class TestRunner: def __call__(self): grinder.getLogger().output("Hello World4")

Using grinder 3.4 and jython 2.5.1

By default grinder 3.4 comes with a jython jar under lib directory. It is version 2.2.1. In order two use a newer jython, you need to change two settings: add your newest jython jar in front of classpath add a jvm property that directs python_home to the home of your jython. You can either do this in grinder.properties or in your bat script that starts the agent. I prefer the latter as I would like to keep grinder.properties as general as possible, independent of machines/environment. My new startAgent_jython251.cmd script looks like: @echo off set GRINDERPATH=C:\development\grinder-3.4 call %GRINDERPATH%\setGrinderEnv.cmd set PYTHON_HOME=C:/development/jython2.5.1 echo %CLASSPATH% set CLASSPATH=%PYTHON_HOME%/jython.jar;%CLASSPATH% set JVMARGS="-Dpython.home=%PYTHON_HOME% -Dpython.cachedir=%GRINDERPATH%/cachedir" java -Duser.language="en" -Dgrinder.jvm.arguments=%JVMARGS% -cp %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES% When I run a script with this...

My first grinder runs

I downloaded grinder 3.4, and unpacked. I installed java jdk 1.6.0.20 on my machine. Inside the root directory of my installation I added following scripts: setGrinderEnv.cmd set GRINDERPATH=C:\development\grinder-3.4 set GRINDERPROPERTIES=C:\development\grinder-3.4\grinder.properties set CLASSPATH=%GRINDERPATH%\lib\grinder.jar;%CLASSPATH% set JAVA_HOME=C:\Programme\Java\jdk1.6.0_20 PATH=%JAVA_HOME%\bin;%PATH% startProxy.cmd set GRINDERPATH=C:\development\grinder-3.4 call %GRINDERPATH%\setGrinderEnv.cmd echo %CLASSPATH% java -Duser.language="en" -cp %CLASSPATH% net.grinder.TCPProxy -console -http > ipp.py startConsole.cmd set GRINDERPATH=C:\development\grinder-3.4 call %GRINDERPATH%\setGrinderEnv.cmd echo %CLASSPATH% java -Duser.language="en" -cp %CLASSPATH% net.grinder.Console startAgent.cmd set GRINDERPATH=C:\development\grinder-3.4 call %GRINDERPATH%\setGrinderEnv.cmd echo %CLASSPATH% java -Duser.language="en" -cp %CLASSPATH% net.grinder.Grin...

Adding your own styles

To get nice formatting of your blog, you can add your own style elements. Under Customize - Layout - Edit Html you can adapt your style sheet. Find the element: ]]></b:skin> </head> and above this add: pre { background:#eeeeee; border:1px solid #A6B0BF; font-size:120%; line-height:100%; overflow:auto; padding:10px; color:#000000 } pre:hover { border:1px solid #efefef; } code { font-size:120%; text-align:left; margin:0;padding:0; color: #000000;} .clear { clear:both; overflow:hidden; } Now you have two new styles you can use: pre and code. To use them, switch to Edit HTML mode, and use html tags pre or code.

My first grinderstone project

I followed instructions to set up grinderstone: eclipse 3.5.2  pydev from update site  grinderstone from update site jython 2.5.1 installed grinder 3.4 installed Under windows preferences I added a jython 2.5.1 jar as jython interpreter. It asks which libraries to include on the python system path. I choose the defaults, excluding __pyclasspath__ and __classpath__. Not sure where these get used for; probably to include your project's  .classpath or python path in the jython execution's classpath. Also under windows-preferences, I set show whitespace characters to true. Next I create a python project. I added grinder.jar and grinder-agent.jar to the external libraries of the project build path. Now I can add my first grinder file under src/HelloGrinder.py: from net.grinder.script.Grinder import grinder # An instance of this class is created for every thread. class TestRunner:     # This method is called for every run.     def...

Setting up ldap on Ubuntu 9.10

Installing slapd on Ubuntu 9.10 is not enough. The configuration of slapd requires more steps. I refer to article: http://doc.ubuntu.com/ubuntu/serverguide/C/openldap-server.html which apparently also applies to 9.10. Make sure you load the necessary schemas: ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif My ldif file I wanted to load contains dc=ldap,dc=example,dc=ipp. So I wanted to set up a rootdn starting with same domain. # Load dynamic backend modules dn: cn=module,cn=config objectClass: olcModuleList cn: module olcModulepath: /usr/lib/ldap olcModuleload: back_hdb # Database settings dn: olcDatabase=hdb,cn=config objectClass: olcDatabaseConfig objectClass: olcHdbConfig olcDatabase: {1}hdb olcSuffix: dc=ldap,dc=example,dc=ipp olcDbDirectory: /var/lib/ldap olcRootDN: cn=admin,dc=ldap,dc=example,dc=ipp olcRootPW: secret ...

Publishing xml

I always had the problem in my posts to include xml snippets. A problem other people must have experienced too. I came across the blogger site: http://formatmysourcecode.blogspot.com/ . It allows to copy your xml, paste and convert it. An example is below, it should show xml ... <?xml version="1.0" encoding="UTF-8"?> <templates>         <template autoinsert="true" context="gettercomment_context"                 deleted="false" description="Comment for getter method" enabled="true"                 id="org.eclipse.jdt.ui.text.codetemplates.gettercomment"                 name="gettercomment">                 /** * @return the ${bare_field_...

encrypt directory

I wanted to encrypt some personal directories I have on my laptop. I have an encrypted directory: jan@eee901:~/Documents$ ls /home/jan/.encrypted/ 4g1Vb4HRZTsVFGXkeqcIsv3q JgpUH0yio4s6r6QuYYyNEKQVUoXKU1j937UTbHa1YOgQK, qoSuRuAL7FFdp49ZL2J9UgZp My destination directory /home/jan/Documents/encrypted is empty after a new boot. Now I can mount with: encfs /home/jan/.encrypted /home/jan/Documents/encrypted an@eee901:~/Documents$ encfs /home/jan/.encrypted /home/jan/Documents/encrypted EncFS Password: jan@eee901:~/Documents$ ls encrypted/ addresses To umount: fusermount -u /home/jan/Documents/encrypted When you run the command for the first time, it will ask you to set password.

Using sdhc card from boot

My Eee PC 901 runs Ubuntu. I have no hard disk, but just an internal sd card, and an additional inserted sdhc card in the sd card slot. I wanted to have all my /home stuff on the external card, so that in case of crash, I can just buy a new card. The internal card is more difficult to replace, so I want to use the external card for whatever possible. As the ext card has my /home directory, I need it to be available on boot. With lsusb I found the details of my card, and then added an udev rule jan@eee901:~/svn/hydra_test$ more /etc/udev/rules.d/01-jankester.rules #ID_SERIAL_SHORT=058F63356336 #ID_FS_UUID=dd4cb63c-0329-4dc6-8ca8-c2e68b9d233e BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="058F63356336", NAME="SDHC", OPTIONS+="last_rule", RUN+="/bin/mount /dev/SDHC" Now I added entry in fstab: /dev/SDHC /home ext3 defaults,noatime 0

Ubuntu: starting db2 at bootup

I installed db2 express 9.5 under ubuntu 8.04. After installation of several packages, it installed well. Only, after installation, it did not automatically start at boot. Setting db2set autostart=yes (by db2inst1 user) did not help. So in the end, I added a /etc/init.d/db2 script: http://www.tldp.org/HOWTO/DB2-HOWTO/ubuntu704.html#AEN794 #!/bin/sh # # Script to start DB2 instances on bootup. # set -e . /lib/lsb/init-functions case "$1" in start) /opt/ibm/db2exc/V9.1/instance/db2istrt ;; stop|restart|reload) ;; esac exit 0 Then I installed bum package, and ran System-Administration-Bootup Manager to activate the db2 script at startup.

Websphere 6.1 administrative security + self signed certificates

I installed websphere 6.1 and chose the default "enable administrative security". Once I finished my installation, I noticed I could not login under https://localhost:9043/admin/console. I got a message about a certificate not being trusted. First I discovered, that I had renamed my machine, but that /etc/hosts still had old entries for 127.0.0.1. Because of that, my node and cell names were still deduced from the old machine name. I fixed that and reinstalled. At login I got the failure: invalid security certificate. My browser did not trust the self signed certificate that the websphere server uses. I did following to fix that: In /bin, started keyman: sudo ./ikeyman.sh Opened jks file under profiles/AppSrv01/etc/DummyClientTrustFile.jks, password is WebAS. there I looked up the default_signer, and selected the extract option. I exported cert.arm as base64 ascii. under firefox, preferences, advanced, view certificates I imported the CA certificate I restarted firefox. The ...

Installing websphere 6.1 under hardy-heron

I had problems to get websphere installed on Ubuntu 8.04. The install did work, but the configuration of profiles failed. In the end it turned out, that /bin/sh points to /bin/dash instead of /bin/bash. I executed following commands: sudo unlink /bin/sh sudo ln -s /bin/bash /bin/sh During installation I set an admin console username/password. When I start the server, and go to the console page http://localhost:9060/ibm/console/ I get redirected to https://localhost:9043/ibm/console/ and get an error that my self signed certificate is not trusted.

Dual screen for Dell D830

My Dell D830 uses an Intel Graphic Card GM965. To use dualscreen, you must use the package xrandr. As a normal user you can see your current configuration with: xrandr -q When you connect a second monitor (docking station), then by default you will get both screens displaying the same. Example: jan@southfork:~$ xrandr -q Screen 0: minimum 320 x 200, current 3600 x 1200, maximum 3600 x 1200 VGA disconnected (normal left inverted right) LVDS connected 1920x1200+0+0 (normal left inverted right) 331mm x 207mm 1920x1200 60.0*+ 1280x800 60.0 1280x768 60.0 1024x768 60.0 800x600 60.3 640x480 59.9 TMDS-1 connected 1680x1050+0+0 (normal left inverted right) 434mm x 270mm 1680x1050 59.9*+ 1280x1024 75.0 59.9 1152x864 74.8 1024x768 75.1 60.0 800x600 75.0 60.3 640x480 75.0 60.0 720x400 70.1 TV disconnected (normal left inverted right) In my example above you will see that both screens start their output ...

VPNC

On Ubuntu 7.10, install vpnc package. /etc/vpnc/netscreen.conf IPSec gateway xxx.xxx.xxx.xxx IPSec ID "XXXXXXXXXXXXX" IPSec secret xxxxxxxxxxxx Vendor netscreen Perfect Forward Secrecy dh2 Xauth username xxxxxxxx Xauth password xxxxxxxx #Debug 3 In /etc/vpnc/vpnc-script Put following before set -x INTERNAL_IP4_DNS= CISCO_SPLIT_INC=1 CISCO_SPLIT_INC_0_ADDR=xxx.xxx.xxx.0 CISCO_SPLIT_INC_0_MASK=255.255.252.0 CISCO_SPLIT_INC_0_MASKLEN=22 CISCO_SPLIT_INC_0_PROTOCOL=0 CISCO_SPLIT_INC_0_SPORT=0 CISCO_SPLIT_INC_0_DPORT=0 Create a version for /etc/resolv.conf.thuis, /etc/resolv.conf.sungard. Create aliases: alias sungard-vpn-down='sudo /usr/sbin/vpnc-disconnect; sudo cp /etc/resolv.conf.thuis /etc/resolv.conf' alias sungard-vpn-up='sudo /usr/sbin/vpnc /etc/vpnc/netscreen.conf; sudo cp /etc/resolv.conf.sungard /etc/resolv.conf'

jboss with embedded derby in network mode

Embedding derby into Jboss In this post I want to show how you can start jboss with an embedded derby network database. The aim is, that when jboss starts: it will start derby open port 1527 for derby to receive jdbc calls create a new database if there is none existing create a datasource inside jboss You can now use any derby jdbc client to communicate with the database, and use derby datasource inside jboss as well. I had to implement three components: an mbean to start the derby network server a datasource to connect to derby database with option create=true an mbean that will get an initial connection so that database gets created Jboss mbean In Jboss you can deploy mbeans, which automatically get started on deployment. The implementation of an Mbean is very simple: you must create an interface that ends with Mbean and has methods start() and stop(), and implement a class for this interface that shares the same name without the Mbean part. Then you create an xml with a reference t...
Installing ubuntu 7.10 behind a proxy I installed my laptop Dell D830 behind a proxy with a password. After putting in the install CD, I get a tryout system that shows me how ubuntu will look like. In this system I already set the proxy, else I will get problems during installation that it cannot find the deb repositories. I made proxy settings under System - Preference - Network Proxy, and, under Synaptic - Preferences - Network. I think the latter is most important. This will make the installation work. After the installation I needed to set these proxy settings again.
Updated Blogger Finally got a bit further with blogger. It seems that usernames had to be updated, before blog clients would work. Now I am curious whether xmls will work. That was my problem last time I used it: I could not paste in build.xml files.

Deploying weblogic 9.2 with openldap

Install weblogic 9.2 Installed under /usr/local/bea Admin console: http://localhost:7001/console Start / stop By default weblogic comes with some preinstalled examples: /usr/local/bea/weblogic92/samples/domains/wl_server To start/stop a weblogic domain: bin/startWebLogic.sh bin/stopWebLogic.sh You can also stop weblogic by killing the pid. Also in the admin console, environment, servers. Quick start /usr/local/bea/weblogic92/common/bin/quickstart.sh Domains Create domain Create a new domain with the configuration wizard /usr/local/bea/weblogic92/common/bin/config.sh create a new domain generate automatically for weblogic server username/password weblogic/weblogic development mode, sun sdk 1.5 additional configuration: yes Adminserver defaults: 7001 Add managed server: name ms1, 7001 No clusters No specific machines domain name domain_oraxe, location /usr/local/bea/user_projects/domains Delete a domain Delete the directory /usr/local/bea/user_projects/domains/<do...