Automating hudson/jenkins via REST and curl – a very small cookbook
As you know, Hudson supports a RESTful-API. So here a small cookbook using curl (running in cygwin). It is very easy, when you are accustomed to it.
#Get the current configuration and save it locally curl -X GET http://user:password@hudson.server.org/job/myjobname/config.xml -o mylocalconfig.xml #Update the configuration via posting a local configuration file curl -X POST http://user:password@hudson.server.org/job/myjobname/config.xml --data-binary "@mymodifiedlocalconfig.xml" #Creating a new job via posting a local configuration file curl -X POST "http://user:password@hudson.server.org/createItem?name=newjobname" --data-binary "@newconfig.xml" -H "Content-Type: text/xml"
Update: Use
--data-binary to post the data, else the line-endings won’t be transfered correctly.
Netbeans: “Copy fully qualified name” plugin for 7.1.RC2
As an eclipse veteran, i wondered why i could not copy the fully qualified name of the currently selected class to the clipboard. I looked it up, there is already a plugin Copy FQN. But it only runs with Netbeans 6.X.
So i introduced myself to the netbeans plattform api and migrated the plugin to be runable with Netbeans 7.1.RC2.
Netbeans module development with JRebel
In [project]\nbproject\platform.properties add the following line
run.args.extra=-J-noverify -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true
Note:
- This requires a proper installation of jrebel in the path
e:/tools/jrebel/ - You have to compile the changed java source manually by
Menu->Run->Compile file(“Compile-on-save” is not yet available for netbeans modules) - There will be some OSGI-exceptions when running/debugging the application, but class reloading works properly.
Tested with NetBeans IDE 7.1 RC2 (Build 201111302200)+7.1, JRebel 4.5.3
Other resources: http://blogs.codehaus.org/people/mkleint/2009/07/maven-netbeans-platform-javare.html
Update: You can also have a look at Javeleon
Update 2: In maven-based nbms you can run modules the following way
- enable “compile on save”
-
generate
rebel.xmlto/src/productionusing the context menu of jrebel (this way it will be copied totarget/classes) - alter the properties-section of the
pom.xmllike this
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <netbeans.run.params.ide/> <netbeans.run.params>-J-noverify -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params> </properties> - run the module the normal way – you will accounter some osgi-exception as mentioned above
- make changes to your classes and jrebel will pick it up like
[207230] JRebel: Reloading class 'b2s.compare.clipboard.TextDiffer'. - small issue: the jrebel-messages do not appear on the output-window – but in
jrebel.log
[Quicktip] Format a drive larger than 32 GB with FAT32 using Win7
Use h2format from http://www.heise.de/software/download/h2format/40825
For more alternatives see http://popelbratwurst.wordpress.com/2009/05/26/fat-32-unter-windows-vista-und-windows-7-formatieren/
Cool retro-combination: dosbox+abandonia.com+dosbox games launcher
- http://members.quicknet.nl/blankendaalr/dbgl/ (java based launcher incl. dosbox 0.74)
- http://www.abandonia.com/ (games)
[Quicktip] Changing font and font-size in g-brief
You want to change the font and font-size of latex “g-brief” (usage: business letters)?
Here you go
% change size
\documentclass[german,a4paper,10pt]{g-brief}
% change font
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
Sources:
http://www.wer-weiss-was.de/theme155/article2405641.html
http://www.mrunix.de/forums/showthread.php?t=51401
[Quicktip] CVS-Changelog plugin for eclipse
As you know CVS is file-based and therefore it has many issues.
For example: In Eclipse (using the standard CVS-plugin) you can only see changes of the currently selected file in the history view. When you select the project, you see no history entries in the project like you are used to using SVN. I know, you can call "cvs log" to see all changes of all file, but that is not very comfortable.
A solution: Install the changelog plugin (http://code.google.com/a/eclipselabs.org/p/changelog/) and working with CVS is now easier… Internally it will call "cvs log" and present the processed results in a clear table view manner. (See the screenshot at the project page and you will see what i mean.)
[Update] Monitoring tomcat instances
Here are some OSS projects to monitor your tomcat instances (f.e. memory-/cpu-usage, sessions, mbeans)
- http://code.google.com/p/psi-probe/ (psi-probe – fork of lambda probe)
- http://www.lambdaprobe.org/ (lambda probe, project seems to be dead)
- http://code.google.com/p/javamelody/(javamelody)
Off course you can also monitor your tomcat via VisualVM (http://visualvm.java.net/ or included in JDK6)
Update: Or use JRDS http://jrds.fr/
[Quicktip] Importing a “dependencyManagement”-section from an external artefact
Situation: You have a parent pom with defined dependencies in the “dependency management”-section. This way you do not have to provide versions for your dependencies. Standard-Maven-Stuff.
New situation: BUT for some reason you have to switch to another totally different parent pom with totally different “dependency management”-section. Your previously declared dependencies have no version, so there will be errors when invoking maven on this pom.
One solution: A cool thing you can do since Maven 2.0.9 is the import of the “dependency management”. So still no versions required for your previously declared dependencies…
This is accomplished by declaring a pom artifact as a dependency with a scope of “import”.
The offical documentation can be found here
More shortcuts/quickfixes for eclipse
After a short detour to Idea Intellj, i am back to eclipse now and there is still potential to learn new features/shortcuts for improved productivity.
Here a few i was not aware of:
- Ctrl-3: quick access – all commands, filterable
- Ctrl-E: to list open files, there you can close the currently selected file by pressing del
- Alt-Shift-W: Show current file in view xyz
- F12: go to editor pane
- Shift-Enter: Create a new line below – no longer Shift-End, Enter
- Ctrl-Q: go to the last edit location
- Ctrl-T: Quick type hierarchy
- Sharing plugins in external folder – how to manage it properly.
- Pick out part of a string via Quickfix
Mainly influenced by http://eclipseone.wordpress.com/
Any cool missed features or quickfixes out there?
Recent Comments