To explore global networking, I run an IPv6-only Autonomous System . Like any network operator, I need routers. One of the routers is connected to an Internet Exchange LAN network. A while ago, I noticed that router was installing an extra IPv6 default route, which caused routing errors. I didn't give it much attention at that point. Earlier this week, I decided to find out what was…
Intro For a while now I am interested in electronics. So after some false starts, I started following a long course on it: Crash Course Electronics and PCB Design . Lecture 9 was about alternating current (AC), the kind of current that flows from a wall socket. I struggled to understand how it's voltage is determined, so I took a lot of notes. This is the result. Warning: algebra ahead. Also:…
Why For a while now, I have been working on a personal project called newsletter2web , which I run on a Raspberry PI. As the title already indicates, it is written in Rust . Since compiling the project takes a while, especially on a Raspberry PI, I decided to investigate how to make it build automatically. That sounds like a job for continuous integration solution. But these tend to use quite a…
Why For a while now, I have been working on a personal project called newsletter2web , which I run on a Raspberry PI. As the title already indicates, it is written in Rust . Since compiling the project takes a while, especially on a Raspberry PI, I decided to investigate how to make it build automatically. That sounds like a job for continuous integration solution. But these tend to use quite a…
What's up? The past few days, I did an experiment to serve blog content over DNS (see here) . That page contains mostly the same content ast this post, but it is served in a completely different manner. This works because of DNS over HTTPS for which there is an API from Cloudflare . Comments at Hacker News , apparently. How it works The DNS over HTTP API from Cloudflare is used to load the…
For a while now I wanted to make my home network IPv6-only. That is a challenge, because my ISP does not enable IPv6. Therefore, I used a Hurricane Electric tunnel to give my home network IPv6. Here I will describe my setup. Requirements To ensure that my whole network is able to use IPv6 I deployed a Raspberry Pi 4 as a router. It is plugged into the router that I received from the ISP. This…
Last week, I had to write a piece of code that contains retry logic. Naturally, I want to test it. That proved trickier than expected. The application code looks like this: <? php class Sender { protected $connection; public function send () { $success = false ; $i = 0 ; do { $i ++ ; try { $success = $this -> doSend ($i); } catch ( SenderException $e) { $success = false ; } } while ( ! $success &&…
As an experiment, last night I decided to configure nginx with SSL and SPDY. Finding information on how to get it working with Ubuntu 12.04 wasn't that easy, so I decided to write the process down. I will assume here that you already have a certificate. If you don’t, you can get them from many vendors. Add the repository First, you need to have version 1.4 or higher of nginx. You can get that…
For Annabel (the name of the product that I currently work on), I need to be able to dynamically instantiate classes, based on options in a configuration file (Zend_Config_Ini). However, some of these classes have constructors (some with required options), others don’t even have a constructor. I first tried to instantiate them with call_user_func_array, like this: <? php $datatype_options =…
For our product Annabel, we have to clean up the data our customers provide us. Because this is a fully automated process, we are unable to give direct feedback and have them fix their input. Therefore, I need a means to clean the data on our end, so we can process it. Since we don’t need to support any unicode stuff, we can stick with just plain ASCII. That’s a very safe approach, which will…
Sometimes one might think: are the laws which God had given to Israel still relevant to us, or shall we just skip them? Did the Lord Jesus not fulfill the complete law when He died on that tree at Golgotha? Does that not mean that we do not need to keep these laws throughout our lives? Let us open up our Bibles and see what God has to say about this. The law is not passed away, for the first…
Well, it took some time, but now I’m back again with part 3 of the series on creating a PHP daemon with fork. In part 1, the introduction I talked about why I would write this series and gave an outline of it. In part 2 we talked about the way UNIX processes work, what forking is and so on. In this part, we will see how to create daemon in PHP which launches processes saying the famous Hello…
I was wondering how to create a user on my system without requiring a prompt or CLI access. The following script is the result: #!/bin/bash UADD = /usr/sbin/useradd OPENSSL = /usr/bin/openssl SHELL = /bin/bash # Generate 12 characters long password and print it. PASS = ` $OPENSSL rand -base64 12` echo $PASS # Make the password usable for the…
As promised in part 1, the introduction of this series on PHP fork, now we will talk about the way processes work in UNIX and Linux, and how we can use these from PHP. Much of the information in this article is based on the IBM Developerworks article on UNIX Processes . I added this part for your convenience and for completeness, but I won’t go into detail about UNIX processes. If you want to know…
In the past weeks, I have been writing a daemon in PHP for my work at Alphacomm. It now is quite finished, and I decided to share this knowledge with you in a tutorial. Another reason for writing this tutorial, is the lack of information available at the web on this subject. Generally, it’s very scattered and not really accessible. Also, most information I found about it, talked about a specific…
Did someone ever want to give you something of a very, very great value? Then you know how hard it can be to just accept it. It is nearly impossible to take it, and if you take it, you nearly drop it. An even greater value has the grace which our Saviour, Jesus Christ, achieved for us. To give us this, Hes had to die. Is the grace which He gives to us a consequence of our goodness towards Him? No…
Some time ago I’ve written a post-commit hook for Subversion in PHP, to make it easier to track code changes via email. I based it on another hook , written in Ruby. Because it had no license attached to it, and because I had to rewrite it myself, I decided to license it under the new BSD license. You can find the hook here: commit-email-color.php . It has the new BSD license attached to it. Enjoy…