Say you’re about to cancel a VPS, but first you need to copy its contents (source) over to another server (destination). We will be using rsync. Note: rsync will keep the original timestamps for both files and folders, so that’s good. General idea: rsync –params source destination Because we will copy the whole source VPS,… Continue reading Migrate whole VPS to another server using rsync
Adding custom toggle control to Gutenberg Block Editor
Requirement. Every header (core/heading) block needs to have a toggle control for adding or removing a custom class name to/from the resulting element. Usage example. Building an automatic table of contents generator, which will pick only the headers having the custom class name. The admin needs to easily select headers that should be used for… Continue reading Adding custom toggle control to Gutenberg Block Editor
Webmaster Checklist
Things like sitemaps or robots.txt have been known for decades and are ovbious by now. Here’s the non-obvious stuff a webmaster should take care of. https://securitytxt.org/ https://web.dev/change-password-url/ webp with graceful fallback: https://serverfault.com/questions/630212/conditionally-serving-high-resolution-and-webp-images-with-nginx and https://alexey.detr.us/en/posts/2018/2018-08-20-webp-nginx-with-fallback/ Lastly, keep an eye on https://mozilla.github.io/standards-positions/
Add nvm-managed node to $PATH in init.d or crontab
When I was using node installed via apt-get, a simple NODE=$(which node) was enough. However, once I switched to the nvm-based node, it was no longer installed in one of the $PATH locations where the system is looking. So the correct path had to be added manually. One option is to hardcode whatever the current… Continue reading Add nvm-managed node to $PATH in init.d or crontab
Have fail2ban block the whole range
You will have to make changes to /etc/fail2ban/action.d/iptables-multiport.conf. To have fail2ban block the whole /24 range on every ban: actionban = -I f2b- 1 -s /24 -j To go back to blocking a single IP instead of the whole subnet: actionban = -I f2b- 1 -s -j
Can’t install Apple Watch apps? App Store or Apple ID is the reason
If you’re trying to install an app to your Apple Watch using the Watch app on your iPhone and it doesn’t work (the spinning is endless or reverts back to the "Install" button), most likely the reason is the App Store mismatch on Apple ID or store country between devices. Solution: Go to App Store… Continue reading Can’t install Apple Watch apps? App Store or Apple ID is the reason
creating-an-api-resource-in-cakephp-4
Post moved to https://faxmodem.eu/blog/development/cakephp/create-rest-api-resource/
cakephp-4-missing-or-incorrect-csrf-cookie-type
Post moved to https://faxmodem.eu/blog/development/cakephp/missing-incorrect-csrf-cookie-type/
MySQL Workbench Syncronize Model: Table Mapping not saving?
Problem Renamed tables in MySQL model Need to rename their counterparts on the live server The model does not recoginse the live tables because of different names The standard solution would be to click the mismatched entry, then go to Table Mapping and there choose the right mapping. However, in my case the new mapping… Continue reading MySQL Workbench Syncronize Model: Table Mapping not saving?
Cheapest .se domains (January 2023)
Tip: you can start by registering your .se with one.com, as they often have heavily discounted prices for the first year (for example, I recently got my .se for ~€3). Use the first year to try your idea and if you still want the domain once the year is over, transfer it elsewhere. Just make… Continue reading Cheapest .se domains (January 2023)