Finally after some days researching and thinking alot about the best approach for this, using Laravel I finally solved. I have to say that this was specially difficult in Laravel 5.2, because in this version the Session middleware only is executed in the controllers used in a route, it means […]
Рубрика: Без рубрики
Microsoft WSL CentOS / Red Hat Enterprise Linux
Some distros are available only via GitHub releases. They were implemented using (a very thin C99) OS-agnostic wrapper called WSLDL. ATM, we have Alpine, Arch, Artix, CentOS, Void (glibc & musllibc) available: https://github.com/yuk7/wsldl#install-with-prebuilt-rootfs. Navigate to one of those repos, fetch latest release build (zip) e.g. CentOS-7.5.1804.zip at https://github.com/fbigun/WSL-Distro-Rootfs/releases/tag/v0.0.1. After that […]
What’s the point of input type in GraphQL
The Object type defined above is inappropriate for re‐use here, because Objects can contain fields that express circular references or references to interfaces and unions, neither of which is appropriate for use as an input argument. For this reason, input objects have a separate type in the system. Since posting […]
Docker and IPtables
TL;DR; By default, docker daemon appends iptables rules for forwarding. For this, it uses a filter chain named DOCKER. Chain FORWARD (policy DROP) target prot opt source destination DOCKER all — 0.0.0.0/0 0.0.0.0/0 … Chain DOCKER (1 references) target prot opt source destination Moreover, when you tell docker to expose […]
Laravel custom model casts
So I ended up going down the Traits route to override various Model methods, this turns out not to be for the fainthearted as attribute casting is quite deeply embedded into the way models work. To make this work for the most general case, i.e. being able to easily add […]
How to convert string to boolean php
Depending on your needs, you should consider using filter_var() with the FILTER_VALIDATE_BOOLEAN flag. filter_var( ‘true’, FILTER_VALIDATE_BOOLEAN); // true filter_var( 1, FILTER_VALIDATE_BOOLEAN); // true filter_var( ‘1’, FILTER_VALIDATE_BOOLEAN); // true filter_var( ‘on’, FILTER_VALIDATE_BOOLEAN); // true filter_var( ‘yes’, FILTER_VALIDATE_BOOLEAN); // true filter_var( ‘false’, FILTER_VALIDATE_BOOLEAN); // false filter_var( 0, FILTER_VALIDATE_BOOLEAN); // false filter_var( ‘0’, […]
Show which git tag you are on
Show all tags on current HEAD (or commit) git tag —points-at HEAD
PHPUnit: How do I create a function to be called once for all my tests
Take a look at setUpBeforeClass(). For the one time tearDown you should use tearDownAfterClass();. Both this methods should be defined in your class as static methods.
How do I change my locale to UTF-8 in CentOS?
In CentOS try with system-config-language command. That’s the CentOS way ? Also you can try with: localedef -c -f UTF-8 -i en_US en_US.UTF-8 export LC_ALL=en_US.UTF-8
SSH connection problem with “Host key verification failed…” error
«Host key verification failed» means that the host key of the remote host was changed. SSH stores the host keys of the remote hosts in ~/.ssh/known_hosts. You can either edit that text file manually and remove the old key (you can see the line number in the error message), or […]