It does actually work
[video:youtube:wp0FT2tQ-8c]rblog
Almost no X-mas at home this year
PhantomJS and 0kb PDF-files
Have spent the past few days troubleshooting an issue with PhantomJS. While veryfing in development and test all was fine, the application running on WebSphere did produce PDF’s like a charm. But when we moved to stage that did not work. The strange thing was that all tests we did from command line was fine, but the application kept on producing 0kb files – the logs told us. Not empty files, empty PDF’s produced by PhantomJS will be 5kb, so this was another issue. So, a new version of the application was deployed which did not delete from the temp folder, .js and .html file was found, but no still no PDF.
I did from previous problems know that a 0kb file on Windows is not always a real file, more a pointer to a file that was there before. And after hours of work with no progress, other than improved logging and good test suites (but not that good since they did not test what caused the error), it turned out to be a .css import in the HTML causing the error. The import statement should be environment aware, but it turned out that it was referring to the development environment. This worked out fine in test since there was no firewall blocking the endpoint, but in stage it was. HTML-files with the import statement pointing to a blocked endpoint caused PhantomJS to produce nothing. Even if the code
console.log(prettyTime() + " [INFO] Now create pdf")
page.render(output, {format: 'pdf'});
console.log(prettyTime() + " [INFO] PDF has now been created")
did not throw any error. While writing this post I did search for page.render and error handling and found this post https://github.com/amir20/phantomjs-node/issues/290 Must admit that I do not understand what
I have changed this behavior to make it more clear. You can do catch() from promise.
really means. I will forward it to the developers. Anyhow, html-file with this error causes PhantomJS to produce nothing without any error. If we removed the import, all fine.
That time of the year when my addiction comes to life
At the theater: Jakob og Neikob
Santa drama in the kindergarten
Last Tuesday they had anual christmas event in the kindergarten, and as always, at the end everyone gathered outside of the storehouse (stabbur) and the kids started shouting for santa to come out. And all the kids, and the parents as well, could hear santa inside the storehouse, but no door did open. It turned out that the lock was in a deadlock state. So for many minutes – no santa
After about ten minutes santa finally managed to open the door, hooray!!
Svn:externals to the rescue
For years I have had this folder structure in SVN related to Splunk
|
|_apps
| |_my-config
|
|_deployment-apps
| |_my-config
Whenever doing changes in my-config under apps I have had to manually copy the changes to deployment\my-config. But today I realized that I have had it, so Google to the rescue. The solution was to use
svn:externals
. So what I did was
- SVN deleted the folder deployment-apps\my-config
- Updated the folder deployment-apps, added the property
svn:externals my-config https://mysvnserver/svn/myrepo/trunk/apps/my-config
Simple as that, and then when you do svn status you will see that deployment-apps\my-config has an X which indicates that is is external
svn status
X deployment-apps\my-config
Performing status on external item at 'deployment-apps\my-config':
My code is on git-hub
Years ago I created a Java program that exports the post from my blog and creates a PDF of the content. I used to have it on Google Code, but is has been taken down a long time ago. Finally I found time to store it elsewhere, now on Github https://github.com/rhellem/b2evolution-to-pdf
Not surprisingly since I am just about to finish the two day intensive GIT traning https://www.praqma.com/training/git-mastering/
Too short…
The kids has thrown a small ball up in the gutter and now it blocks the drain so I need to get up and remove it…but the ladder is to short.
Since I only have heard of HSE, but does not know what it is…the front loader to the rescue…
Løpetur til Elgheia
Tidligere i høst så prøvde jeg dette turforslaget https://www.ut.no/tur/2.14860/ sammen med ungene. Ulempen med å gå opp til Elgheia fra Aurskog er at mye av turen går på vei, det blir litt kjedelig i lengden. Derfor hadde jeg lyst til å prøve det fra Bjørkelangen, og endelig åpnet det seg en mulighet på formiddagen andre juledag. Jeg svingte av mot Rud og kjørte opp til bommen ved Årnes og løp derfra.
Karttjenesten til Sportstracker er nede akkurat nå, så det får bli med dette kartet enn sålenge.
Over brua som ligger i delet mellom Maltjenn og Vesle Maltjenn. Jeg løp opp fra Maltjennmoen, stien er ikke merket med annet enn et gammelt skilt som er litt vanskelig å se, men det er enkelt å finne den uansett. Jeg løp ned til Gromsrudsætra på tur tilbake, den stien/traktorveien er bedre merket, men går over mye mer myr og er derfor ikke det beste alternativet.
Utsikt fra tårnet.
Er god avstand mellom trappetrinnene, så de aller minste bør man passe litt ekstra på hvis man tar de med opp i tårnet.
Hadde god bruk for piggskoene, de leverer alltid på slikt føre.












