It happens once every few years. Because of whatever reason I request another VPS at a service provider, provision the machine with Ansible and deploy a few services, usually as docker containers. And what? They don’t work, unfortunately. In 99% of the cases, I forgot to update the DNS records and with Traefik and Let’s Encrypt, I hit the rate limit while investigating and I…
This post guides you through the config to put pi-hole’s web interface behind Traefik. For all local (home) services I use Traefik as a reverse proxy, which eases my configuration. However, pi-hole is not a simple web application serving plain HTML, as my local DNS server it has to respond to DNS queries over port 53. Traefik can proxy plain TCP and UDP, but in pi-hole’s case this is…
The last days I have been experimenting in different ways how I can secure a MQTT setup for my home automation. There’s an increasing use of IoT here at my home and most of the applications communicate over MQTT. You simply cannot control every device and how it gathers information. To prevent eavesdropping, it’s time to secure MQTT.
When you are a heavy user of your Synology NAS like me, you might use Hyper Backup to backup your NAS data to an external site in an orderly fashion. My backups run daily for almost three years now to a OwnCloud instance I have at a Dutch hosting provider, via WebDav. At that time I made a choice how to layout my data, but I have come up with a better plan and needed to change the destination…
A neat trick from OpenVPN is you can have a client configuration with two remote servers. You can connect by default with udp at port 1194 but if firewalls block either udp traffic or port 1194, your client will automatically have a failover using tcp at port 443. In this post I will show you how, using the new udp capabilities in Traefik 2.2, released just last month.
Today is March 5th 2018. It’s more than 2,5 year ago I wrote my last programming article on this blog. Since I’ve moved on , I haven’t wrote any (good) piece of code at all. Looking back, I have no incentive anymore to publish articles. There are so many good resources out on the internet, there’s simply so much going on, I have not been able to keep up with it. All the…
In Slim v2, there is the option to invoke the error or not found handler with respectively $app->error() or $app->notFound() inside your controller/closure. In Slim v3, the feature has been removed* but there is a way to manage the same result with middleware.
Recently I stopped being an entrepreneur and moved to work for another company. It felt great and I would like to share this experience with you. I made the move not because I couldn’t stand the entrepreneurial environment any more, or because the business was in decline (on the contrary actually). It was because I stuck to my most important lesson: Do what you love and evaluate what you do
This tutorial is a copy of the features from the react tutorial about building a comment section , but then for riot . Starting with react, it felt utterly complicated for small use cases and riot is a perfect, minimalistic alternative. Here I show you how it works.
The composer bash completion from iArren is fantastic, but is doesn’t work out of the box on Ubuntu (14.04). I found out this is due to an old version of bash-completion on Ubuntu and with a simple fix I got it working.
This week I will leave my own business. It has been prepared for 3 months, but now it is getting really close. I am ready for the next step and I am honestly happy the company will keep running without me. However, this period felt like a roller coaster and I would like to share some thoughts how such a process could be guided (or the alternative title for this post: “what I learned from my…
Today I was looking how you can populate an ssh known_hosts file with ansible. For ssh access (pulling git repositories) I need to accept a fingerprint and I do not want to do this manually for every target. Therefore, I want to populate the known_hosts file so ssh can connect to them without interaction. And in fact, it was quite easy to achieve.
For a project we required tracking of events for various user interactions. The goal was to provide insights in user behaviour for certain sections of the site, but most of these interactions included “outbound links”: hyperlinks pointing to a URL. Simply tracking the events with an onClick handler will not work in this case, so I wrote a simple wrapper to solve this problem.
This week is quite a productive week and today Soflomo\Cache is released. Caching is an essential part in scaling your application, but Zend Framework 2 was missing a utility to manage your caches. Until now!
There are numerous e-mail modules available on modules.zendframework.com , but all fail the goal to be reusable for a medium-wide range of use cases. Therefore is today Soflomo\Mail v0.2.0 released: a facade module that helps users to execute three steps in a single method call: Compose an e-mail message object (with address fields, subject and so on) Render view templates for the body text (both…
Based on a Twitter conversation I promised to blog about how we deal with API authentication. In short, you have a few formats: if HTTP Basic and HTTP Digest are no option and OAuth2 is not a good candidate either, you can choose to sign your requests with a signature and send the signature in a header.
As of today Soflomo\Prototype has been updated to support tight integration into your existing application. Before, Soflomo\Prototype could be used to either bootstrap the first phase of your application design process or to document your REST APIs . However, prototyping new features in your existing application is a very useful add-on to this list.
Last year there was some discussion about the relation between a dependency injection container and a service locator. Up until now, developers struggle to use a dependency injection container without injecting the container itself. It happens quite often I point them out to a blog post explaining more in depth the reasoning behind containers and locators. Because I collected a nice list of…
Doctrine repositories are instantiated “magically”: If you call $em->getRepository() you get a default repository class. You can create your own repository as well, but you never create that instance yourself. What if you need to inject a dependency into the repository? In this post I will explain how to achieve this with Zend Framework 2.
Using the Zend Framework 2’s AstractRestfulController allows you to quickly set up a RESTful interface. However, in my development environment I was looking for an option to quickly enable pretty print in the JSON output. Zend Framework does not support this by default, but it is easy to implement this with events.
Today people still ask why a certain service is not available in a constructor. You can think of events, the event manager or the service locator: there are some variations, but all are about the same topic. Perhaps you can recognise one or more of the list: Why is $this->getServiceLocator() not available in my controllers’s __construct() ? Why does $this->getEvent() return null inside…
A few weeks ago I have been asked to review Zend Framework 2.0 by Example from Krishna Shasankar V. As of today, I have finished the book and here are my thoughts. In short: it is a mediocre book about the framework, but for beginners quite complete in it’s overview.
iDEAL is the de facto standard for online payments in The Netherlands. As of August 1st, iDEAL updated its messages to be SEPA compliant. The new version, stated 3.3.1, requires quite some changes in comparison to the earlier versions. The most important change is the switch to the XML Signature Syntax and Processing standard for XML signatures. To ease the use of iDEAL payments in php, I created…
Most web development agencies have a testing or staging environment for their clients, to show them new stuff before it gets into production. A common problem we encounter is that clients often forget what the difference between the environments is. This results in data entries at the staging environment, which are not visible on the production site. Or even worse, clients point their audience to…
The visual change of this blog recently also helped me to enrich the html markup with more semantics. Using the latest <header> , <section> or <footer> elements annotates the document structure but it does not tell what type of content is shown. Using microdata, you can even tell search engines what the content is about . There are four simple steps to help search engines and all major social…
As from now on, juriansluiman.nl uses https by default. If you used to browse via http, you now get redirected to the https version. In December 2012 Tim Bray announced the switch on his personal blog and others followed shortly . This time, I join the club.
A lot of senior developers are advocating to inject your dependencies . However, in many cases you have to deal with legacy code, an application already in production or you are half way the development of a new application. So although it can be a good advice, it might not be directly applicable for your use case if you have done things differently. This guide will help with refactoring your code…
In the past months I have had many ideas about blog posts. Posts that were neither difficult to write nor required lots of research on beforehand. Nevertheless, I did not write much . This week I realized it was just too painful to write things down. The slow system, the cluttered admin, the awful editor and unpleasant reading experience of the design all had it parts. The only thing needed to…
Packt Publishing is often requesting people to perform a technical review of their books. I have done that a while ago for a Zend Framework 1 title and this week I have been asked to do the same for a Zend Framework 2 title: “ Zend Framework 2.0 by Example ”.
Yesterday, I released the Release Candidate number 1 of SlmMail . SlmMail provides API implementations of the largest email service providers. So if your sendmail or SMTP fails, include SlmMail and offload the risk of sending emails to others. In the last years, emails must be secured with all kind of mechanisms like SPF, DKIM and DMARC. It just costs a lot of time and knowledge to maintain your…
After using Zend Framework 2 for more than a year, I just found out about strategies for hydrators today. Yes, today and thanks to Michael Gallego who introduced me to this concept. But I think many people underestimate what they can do with hydrators and their strategies, so this post explains why strategies for hydrators are awesome .
Many components in Zend Framework 2 following the adapter or plugin pattern, make use of the AbstractPluginManager . The abstract plugin manager is a service locator implementation which allows to define services as invokable or with factories. Many of these plugin managers are loaded automatically (see for example my earlier post about service managers ). However, the manager for loaders of…
Tomorrow is the first day of LaunchLab: an initiative I will join with my company Soflomo. LaunchLab is a new program from the incubator from the Delft University of Technology, called YES!Delft. The idea is to help start-ups creating their business model based on lean methods: validate your assumptions, talk with your potential clients and do not muddle along too long with your initial plans. Out…
Today we at Soflomo released Soflomo\Prototype , a new Zend Framework 2 module. The module is just in use for about a couple of hours, but it already saves us so much work, we would like to share it. It is available under the New BSD (3 clause) license, feel free to use it! The goal is to make it extremely easy inside Zend Framework 2 to start prototyping html pages. Designers and frontend…
There have been some questions around in the IRC channel and on Twitter how you could enable the Json view strategy for only a specific module in Zend Framework 2. Because I was requiring this feature too in the near future, I started exploring the code behind Zend\View and its strategies, to make this happen.
The Zend\ServiceManager is a component which handles (besides other stuff) dependency injection. During the developments of Zend Framework 2 I have looked at dependency injection thoroughly. A good resource is from Martin Fowler, where he explains there are three types of dependency injection . In this post I am particularly interested in injecting soft dependencies with interface injection. The…
Since October 2011 I maintained a small module for the Gedmo Doctrine extensions . These extensions were quite useful and with the Doctrine modules from Marco Pivetta ( Ocramius ) it was fairly easy to build a module configuring and autoloading the Gedmo extensions. However, the Zend Framework changed drastically a couple of days back: a service manager, Composer integration and many more features…
Zend Framework 2 uses a ServiceManager component (in short, SM) to easily apply inversion of control. I notice there are good resources about the background of service managers (I recommend this blog post from Evan or this post from Reese Wilson ) but many people still have problems to tune the SM to their needs. In this post I will try to explain the reason why the framework uses multiple service…
The release of the first RC ( release candidate ) of Zend Framework 2 is getting close. One last beta (beta5) and then the RC will be announced! With the current pace of modules spawning on GitHub, I think it is a good idea to give some insights in how you can use 3rd party modules. In this blog post I will focus on MVC modules: modules with routes pointing to controllers and view scripts for…
With the recent beta5 release of Zend Framework 2, a completely new Zend\I18n component is shipped. The component is (without any misunderstanding about the work to get this done) a kind-of helper layer on top of ext/intl, a php extension for all kind of i18n tasks. Since this Zend\I18n release I was thinking about using the Accept-Language header a browser sends with a request. When there is no…
The navigation component of the Zend Framework was introduced at version 1.8. From my perspective, the navigation is besides the MVC stack one of the most useful components of the system. All menu bars, breadcrumbs, meta links, sitemaps and all their variations can be created with this powerful and flexible component. Nevertheless, some people find it difficult to use Zend_Navigation because of…
Het is alweer een maand geleden dat ik het vorige stukje heb geschreven… de tijd vliegt hier zo voorbij, dat is zeker. Afgelopen weekend was ik even terug in Nederland. Hier in Duitsland vieren ze Allerheiligen (dat was afgelopen dinsdag) dus dat betekende een lang weekend vrij (zaterdag - dinsdag). Een arts de bij Maquet werkt woont in Aken en gaat elk weekend op en neer. Ik kon meerijden…
Deze week heb ik voor het eerst een “eigen” opdracht van Maquet gekregen. De plannen die er voor mij klaar lagen, heb ik veel sneller doorgewerkt dan verwacht en nu ben ik op de afdeling ook binnen een projectteam geplaatst. De afdeling hier wordt door andere afdelingen ook wel de “feestafdeling” genoemd. Er (schijnen) best wat gelegenheden te zijn die we hier gezamenlijk…
Hierbij (eindelijk!) een eerste blogpost nu ik in Duitsland zit. Ik zal proberen het kort te houden, ik kan natuurlijk alles vertellen van de afgelopen 22 dagen, maar ik denk dat niemand daar echt op zit te wachten. In ieder geval: alles gaat goed, het is hier leuk & ik red me prima (voor de TL;DR)! De eerste paar dagen hoefde ik nog niet te beginnen, maar dat gaf me wel de gelegenheid om een…
Nowadays a lot of effort is made to have support for Doctrine in the Zend Framework. Doctrine is a great tool and having the support for all Doctrine specialities (code generations, migrations and behaviours like i18n and versionable) is a must for all real developers. Searching the Internet about a variety of topics, I think I found now the perfect method to have Doctrine loaded all your models.
In a previous article I talked about a method to resize images on demand. The article (from October 2009) was written with extensibility in mind, but (of course) not with the counterparts we found out after a while. On-demand resizing of images server-side is very nice, because: Browsers are less capable to resize images Bandwidth is minimalized for unnecessary large images Nevertheless we ran…
In the new versions of Zend Framework (since 1.11.0, released 2 November 2010 ) it is possible to detect devices with the new Zend_Http_UserAgent component. The component detects the User-Agent of a client and the corresponding capabilities. This with the help of WURFL , Tera_WURFL or DeviceAtlas . In my case the WURFL library is the easiest solution and sufficient for my use cases. With…
I work more and more with web applications where users persist personal data and realize the functions to access this data requires a secured connection. Currently I do not use SSL for login, but for next projects I would like to incorporate this into the Soflomo system. 1 To enable an SSL config with Apache2 on a Linux system (in our case Ubuntu Linux) the Ubuntu wiki provides a very good…
It’s -for me- a pain in the ass to write too much code when it isn’t necessary. For example, you’re able to fetch a view helper simply by using the magic method __call() from Zend_View_Helper_Abstract , but when you try to magically load an action helper in an action controller, this is (by default) not possible. This article is just a small talk how to call the direct() method…
For the best user experience, it’s useful to post sometimes a html <form> with an asynchronous request. The javascript acquires the data, sends it to the server and waits for a response. But when the form contains errors, you need to return the messages in order to be displayed for the user. This article provides a strategy to fetch the response, looks if the form contained errors and…