Category: General
-
Inserting an element at cursor position in a content editable DIV
Step by step guide on how to use javascript to insert an element into a content editable div at the cursor position
-
Cleanup of the infamous WinSxS folder
How to Safely cleanup WinSxS folder for Windows 10+ installations using the Deployment Image Servicing and Management tool.
-
LetsEncrypt wildcard certificates and Bind9 auto update with DNS challenge
SSL is the standard in web content serving nowadays and LetsEncrypt does a wonderful job offering FREE SSL certificates that would otherwise cost you a decent amount of money on a yearly basis. The only downside to the FREE service is that these certificates have a very short 90 days life and, as such, they…
-
Localization function in Twig with CodeIgniter
CodeIgniter has a beautiful and simple Localization framework with each language in it’s folder and using aliases in views to get the localized version of a specific text. I will not go into details about this as I’m assuming you already have been using it for a while. For more details on it, please visit…
-
MySQL table with automatic partition adding
One of the advantages of using partitions in MySQL is that it speeds up queries, especially when large data volumes are in play. What happens when data grows and you surely don’t want to add new partitions manually? Well, this is where stored procedures and triggers come in place. First things first, you cannot partition…
-
Securing PHP login with Fail2Ban
Brute force attacks are a common issue for webapps. Combining Fail2Ban in Centos(Linux) and PHP logging can provide a powerful tool for temporarily or even permanently banning users from even reaching your server. This is an extreme measure but it is clean, simple and very effective. The article below requires the following perquisites: In this…
-
Prevent CSRF attacks with CodeIgniter 4
CSRF attacks are relatively common. They rely mainly on the user’s elevated permissions for a certain webapp and the hacker would thus attempt to get the user to perform a certain action on it’s behalf. To cut it short, it’s BAD! How the whole attack works is for sure not the scope of this article.…
-
Twig integration with Codeigniter
PHP templates for pages (aka views) have evolved in the last decade however, in the current MCV widely used project structure, Twig has provided a simplified, fast, secure and reliable solution to writing code. It has been my number one choice for a very long time. In this article: Why choose Twig over the default…