Holy on Dev
How to create and run Gatling 2.0 tests
Getting up and running with Gatling perf. tests as I would like so I record this for my future reference.
0. Create a project:
$ mvn archetype:generate \ -DarchetypeCatalog=http://repository.excilys.com/content/groups/public/archetype-catalog.xml -Dfilter=io.gatling:
(The trailing ":" in the filter is important.)
1. Import to IntelliJIn IntelliJ choose to import an object, instead of "from sources" select "from external model" and then Maven. You will also need to have the Scala plugin installed and, when imported, you will likely need to right-click on pom.xml and Maven - Reimport.
2. Record a simulation
- Run the
src/test/scala/Recorder.scala(right-click - Run 'Recorder')
- Set the port it should listen on, f.ex. 8000 (maybe you also need to set port for HTTPS, f.ex. 8001), set the target app (perhaps localhost, <some port>, <some https/dummy port>)
- Optionally set the class name of the recorded simulation and the target package (the output goes to
- Click [Start !]
- Go to your browser and configure it to use the recorder as its HTTP[s] proxy
- Browse localhost:8000/your_app as you want for the test
- Click [Stop and save] in the Recorder UI
- Run the
Kioo: How To Replace The Whole BodyKioo, the enlive-inspired templating library for React.js and derived libs such as Om, normally works by matching selectors against elements inside
<body>and transforming the matched elements while also keeping all the other ones. But what if you want to keep just the single matched element and drop all the others? You need some tricks and I will demonstrate one possible way.
Dislaimer: This is a result of my experimentation, not deep knowledge if Kioo.
Kioo: How to Troubleshoot Template Processing
Most interesting links of March ''14
Recommended Readings Clojure Corner Timo Mihaljov's Pimp My REPL (3/2014)- really great tips - user.clj, :dev profile, user-wide config in .lein/profiles.clj, tools.namespace, making funs available everywhere & more via Vinyasa, form println with Spyscope, debug-repl, difform, clj-ns-browser Tools/Libs clj-ds - Clojur
Framework Joy: Load in Hibernate Updates Data
Would you ever guess that this line
How To Generate A Valid Credit Card Number For A Bin (First 6 Digits)
There is plenty of generators that can produce numbers that are valid credit card numbers according to the Luhn check and specific rules of the individual issuer companies. However I have not found anything that would generate the missing digits given a bin, i.e. the first 6 digits of a credit card (the "bank identification number"). So I created one, reverse-engineering
org.apache.commons.validator.routines.CreditCardValidatorfrom common-validator 1.4:
I never remember what some of these HttpServletRequest methods return so here is an example:
Ansible: Best practices for deriving host-level var from a group var
I have a cluster and a group variable (in test/staging/prod) holding the hostname of the cluster master. For each host, I want to derive a variable which is set to either "slave" or "master" and use it in templates.
Frustration-Driven Development - Towards DevOps, Lean, Clojure
A post about development practices, speed, and frustration.
My wife has mentioned that she likes my passion for doing things right in software development. That made me thinking, why do I actually care so much and do not just enjoy the coding itself? It boils down to that I am not happy until my code is in production. Seeking the satisfaction of having my code used by and helping people while trying to eliminate all unnecessary mental drain is behind all the practices that I embrace and evangelize. It's a drug I like to take often, in small doses.
practices = f(max(delivered value), min(mental energy))
So how does this relate to DevOps, Continuous Delivery, testing, single-piece-flow, Lean Startup, Clojure? It is simple.
Petitioning EU to act against Russian aggression in Ukraine
As a citizen of a country that has been invaded by Hilter in 1938 under the pretext of protecting local Germans and again invaded by Russia in 1968, I cannot watch another such invasion and annexation taking place in Europe while EU does little of any consequences.
Recursive Copy In Ansible 1.5 And --diff
Ansible 1.5 has partial support for recursive copy of files:
- the synchronize module, using rsync
- cons: does not support group=, owner=
- -C and --diff - it does not print diff of the files changed; when running ansible with -v, it will print output of rsync's --itemize-changes, i.e., for each changed file/dir, something like "<f.st...... conf/httpd.conf\n" (< = file uploaded, s = size changed, t = timestamp changed, . = this attribute has not been changed)
- the copy module
- -C --diff - it only reports "changed" without naming the changed files or showing diffs (unless there is only one changed file)
- the local_action module, used to run rsync manually (essentially the same as synchronize but more control)
- So the only way to do a kind of recursive copy with working diff is to use
copywith with_fileglob for each directory and subdirectory :-(
Ansible Troubleshooting Tips
Few tips for troubleshooting Ansible, based on my brief experiences with Ansible 1.4 (read: do not rely on this info too much).
Run ansible-playbook in the verbose modeansible-playbook -vvvv ... will provide you with plenty of details of what is going on. (Notice that additional v:s, starting from none, add more detail.) Developing Modules.
Most interesting links of February ''14
Recommended Readings Development Falsehoods Programmers Believe About Names - summary: there are no rules that apply to names, do not assume anything (my favourite: 12 + 13) Nathan Marz: Principles of Softwar
Handling Deployments When Provisioning JBoss domain.xml (With Ansible)
It is tricky to manage JBoss with a provisioner such as Puppet or Ansible because its
domain.xmlcontains not only rather static configuration but also sections that change quite often such as
deployments. So how can we manage the static parts of
domain.xmlwith f.ex. Ansible while still enabling developers to deploy at will via
jboss-cli(and thus changing the
<deployments>sections of the file)? Here is one possible solution, based on extracting the sections from the current file and merging them into the template.
JavaServer Faces Are Evil (draft)
1. ProblemLet me start with a story. Once upon time
- there were 2 developers
- working together for 1 day
- Previous (5)Next (19)