Skip to content

Instantly share code, notes, and snippets.

View tvlooy's full-sized avatar
🐧
<(o)

Tom Van Looy tvlooy

🐧
<(o)
View GitHub Profile
@tvlooy
tvlooy / example.vhost
Created November 23, 2016 07:12
PHP 7 FPM on Apache 2.2 with PHP 5 mod_php running
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !www.example.com [NC]
RewriteRule ^(.*)$ http://www.example.com$1 [L,R=301]
DocumentRoot /var/www/example/current/web
<Directory />
@tvlooy
tvlooy / errordocs.patch
Last active November 30, 2018 19:47
OpenBSD httpd errordocs patch
Index: httpd.conf.5
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v
retrieving revision 1.76
diff -u -p -u -r1.76 httpd.conf.5
--- httpd.conf.5 14 Nov 2016 10:28:31 -0000 1.76
+++ httpd.conf.5 21 Nov 2016 19:12:34 -0000
@@ -128,6 +128,9 @@ If not specified, it defaults to
within the
.Xr chroot 2
@tvlooy
tvlooy / vmm_howto.md
Last active February 28, 2024 15:14
OpenBSD VMM howto

OpenBSD VMM howto

Setup

/etc/rc.conf.local

apmd_flags="-A"
dhcpd_flags=vether0
vmd_flags=
ntpd_flags="-s"
@tvlooy
tvlooy / get_dns_blacklists.sh
Last active September 9, 2019 03:33
Block ads by DNS
#!/bin/sh
# "include: /etc/unbound/ad-blacklist.conf" in /var/unbound/etc/unbound.conf
# run this script as a daily cron
#
# The list URLs were taken from the pi-hole project.
# More experimental lists are at https://github.com/pi-hole/pi-hole/blob/master/adlists.default
TMPFILE=$( mktemp get_dns_blacklists-XXXXXXXXX )
trap 'rm -f $TMPFILE; exit 1' EXIT KILL INT QUIT TERM
Java EE is dead. Stop using it
There is a lot of chatter on the internet about Java EE being dead. As someone who spent a lot of time implementing some of the core specs like CDI and also helping customers adopt JavaEE I was interested in determining if this is true.
Unfortunately the anecdotal evidence all points to JavaEE going the way of the DODO slowly. I am here to ring the bell. Please write all your future apps with Spring, LightBend etc., or even no framework.
This is the evidence now points towards JavaEE being dead:
1. Most of the prominent Java EE evangelists - Folks who in some cases are friends and I admire deeply have left their respective Java EE shepherd companies. Reza Rahman from Oracle, Kenny Bastani from Oracle and Arun Gupta from Redhat to name just a few ...
2. Oracle, Redhat and IBM - the three most prominent supporters of JavaEE are now spending their money and developers innovating elsewhere. Oracle cloud,OpenShift and Bluemix respectively.
@tvlooy
tvlooy / analysis.txt
Last active December 17, 2015 21:57
find . -name "*.php" > phan.txt; ./vendor/bin/phan -f phan.txt | grep -v '^./vendor' | grep -v './tests' | grep -v '/Tests/' | grep -v 'simpletest' > analysis.txt
./core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php:306 ParamError required arg follows optional
./core/modules/block/src/Entity/Block.php:78 UndefError Can't access undeclared constant \Drupal\block\Entity\block::BLOCK_REGION_NONE
./core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php:42 UndefError Can't access constant ROLLBACK_DELETE from undeclared class MigrateIdMapInterface
./core/modules/migrate/src/MigrateMessage.php:23 UndefError Can't access constant INFO from undeclared class RfcLogLevel
./core/modules/migrate/src/MigrateMessage.php:24 UndefError Can't access constant ERROR from undeclared class RfcLogLevel
./core/modules/migrate/src/Entity/Migration.php:116 TypeError assigning array to property but \Drupal\migrate\Entity\migration::idmap is string
./core/modules/migrate/src/Entity/Migration.php:162 UndefError Can't access undeclared constant \Drupal\migrate\Entity\migration::SOURCE
./core/modules/search/src/SearchQuery.php:506 TypeError Default value for float $multi
@tvlooy
tvlooy / build_nginx.sh
Last active January 24, 2017 04:31 — forked from Belphemur/build_nginx.sh
Compiling Nginx with LibreSSL & HTTP/2 patch
#!/bin/bash
set -e
# Names of latest versions of each package
export NGINX_VERSION=1.9.4
export VERSION_PCRE=pcre-8.37
export VERSION_LIBRESSL=libressl-2.2.3
export VERSION_NGINX=nginx-$NGINX_VERSION
@tvlooy
tvlooy / ipv6_telenet.txt
Last active August 29, 2015 14:27
IPv6 bij telenet
Abbo: basic internet
Modem: modem-only DOCSIS 3.0
Router: Soekris / OpenBSD 5.7
-----
Test via autoconfiguration:
(inet6 autoconfig in /etc/hostname.vr0)
Tcpdump:
@tvlooy
tvlooy / validator.php
Created July 28, 2015 10:26
Symfony validator without entities or objects
<?php
// See http://symfony.com/doc/current/book/validation.html#validating-values-and-arrays
$email = $app['request']->get('email');
$emailConstraint = new \Symfony\Component\Validator\Constraints\Email();
$emailConstraint->message = 'Invalid email address';
$errorList = $val->validate(
$email,
$emailConstraint
);
var_dump($errorList);
@tvlooy
tvlooy / selenium-server.sh
Created July 27, 2015 15:52
Selenium server init script
#!/bin/bash
NAME=selenium-server
SCRIPT="/usr/bin/xvfb-run -- java -jar /root/${NAME}-standalone-2.44.0.jar"
PIDFILE=/var/run/selenium-server.pid
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec $SCRIPT