After rebuilding a CentOS 7 system with a Laravel app on it, every time the app attempted to mail a notification using MailTrap, the above error got fired.
SELinux. Again. It’s always flipping SE LINUX! The SELinux policy can block in and outbound ports and all sorts of things. It’s a git. A clever useful git.
Running `sudo sealert -a /var/log/audit/audit.log` showed the problem. If sealert isn’t possible, then tailing the audit log with `sudo tail -f /var/log/audit/audit.log` goes some way to finding the problem.
In this case a solution (being Linux there are probably 74 equally effective and largely contested solutions) was to allow Apache to use port 2525 like so:
Problem: I’m retro-fitting ‘scopes’ to an existing Laravel Passport API to allow some different levels of client access. After adding the available scopes with Passport::tokensCan, and default scopes with Passport::setDefaultScope, and attempting to specify a scope on a route like so:
Problem: I own a Pentax P30t Film SLR which only allows ISO to be set via DX encoding on the film canister. If no DX code is present, the ISO defaults to 100.
Solution: There are all sorts of existing solutions involving tin-foil, stickers or scratching the canister but I wanted a more permanent re-usable solution and came up with this ‘shim’ idea.
The method is as follows, with simple explanation in the captions where needed:
0.4mm aluminium sheet was the thinnest they had in my local hobby store. I plan on trying .3mm sometime soon.
Choice of tape matters. Good quality soft PVC tape can be punctured by the pins in the camera, and is also quite thick. Cheap electrical tape is probably better. Best would be to block-out the code with etch-primer and a suitable hard shell paint I think. Future version
The length of the piece of aluminium’s important as you want it to butt-up to the inside corner to prevent the shim rotating when the film is inserted.
Choice of former, in my case a socket, is a bit hit and miss. You want to over curl it and let it spring back to the final size.
I taped the sheet to the former before rolling with duck-tape.
Testing the shim: For a camera like the P30t, there’s no way to read-back or verify which ISO value has been set by a DX code. i.e there’s no LCD display. So to check that the shim is working:
Insert a factory canister with a DX code on it that differs from the one on the shim and take a light meter reading against a constant light source. A PC/Laptop screen showing a white background is a good one. Note the reading.
Add the shim to the canister, and take another reading, noting it.
Compare the readings with what you’d expect to see.
For example let’s say the factory canister has a 100 ISO DX code on it, and the reading is 1/60th at ƒ8. If the shim has a 400 ISO code on it, you would expect there to be a difference of 2 stops in the reading. So 1/250th at ƒ8 or 1/60th at ƒ16.
The WordPress menu builder makes it easy to add nested menu item links to a named menu, and display it in pre-defined theme location. However, as of writing in Jan 2019, there’s not an easy or built-in way to add menu sections or section headers. Here’s my solution:
The adjacent image shows the design that I’ve been asked to translate to a WordPress native menu. The orange items are page links. The white items are section headers and should not be active in any way. They are simply visual cues to aid navigation.
‘Out of the box’ WordPress doesn’t provide a place for menu section headers like ‘Services’ and ‘Products’ to be entered. It is possible to add them based on a menu item’s class or ID using the CSS ‘content‘ property, or an absolutely positioned image, but this is tacky and hard-coded, so site owners and admins can’t easily change the menu section headers without a developer type person or some Additional CSS hackery.
I use Postbox, the Mail Client as a tool for checking problems with customer’s email accounts, and migrating mail data. When I have finished using it I don’t want to retain their data, nor do I want it taking up space on my machine. Just removing the ‘accounts’ doesn’t actually remove the data, it sits in Application Data forever (well maybe not forever, but a long time).
Laravel 5.7 ships with bundled Email Verification. This is great if you want to make sure a user’s email address is valid (or at least that the user can access it) before allowing them access.
Problem: What if you want to manually verify a user without sending them an email address? For example you might want to add or import a load of existing ‘known-good’ users to a migrated app. Or you might be creating Admin or System users that don’t really have accessible email addresses. There could be many reasons.
At present as soon you register a user, the sendEmailVerificationNotification method is called. There’s a good breakdown of how this works in this Stack Overflow answer. If a user is manually created, then when they try to log in they’ll still see the “Verify your email address” message:
Whilst attempting to upgrade an old Laravel project, I hit the following error.
Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
Problem: The routing of the vacuum hose on the GT6 is a bit poo. Actually I don’t know what it was like from the factory, but most engine bays I’ve seen recently have it draped around the rocker cover or across it, and that can lead to problems.