Welcome to my encyclopedia of shitty code!
-
PHP + Composer: The Process “php -S 0.0.0.0:8080 -t public index.php” Exceeded the Timeout of 300 Seconds
PROBLEM Given the following composer.json… When running composer start… The PHP built-in web server stops with the following error message… SOLUTION There are several ways to extend the timeout value, but here is one way to do it through composer.json. To extend the timeout value from 300 seconds to 2000 seconds, add the following config… Read More…
-
Slim: Class ‘X’ Not Found
PROBLEM Let’s assume we have the following project structure with src/model/Person.php created… … and the class may look something like this… … and it is being used in other file… When hitting the given route from the browser, we get the following error:- SOLUTION #1: Using import/require One way to solve this is to use… Read More…
-
Spring Security: Propagating Security Context to Spawned Threads
PROBLEM Let’s assume we have the following Parent class… … and Child class… Let’s also assume the user has successfully logged in and Spring Security has set up the user authentication info. The Parent will spawn a new thread (through @Async) to run Child. When invoking the Parent, this is what we see:- The Child,… Read More…
-
JEE Security: Preventing Clickjacking Attacks
PROBLEM Clickjacking is an attack that tricks the users to perform unintended actions… see OWASP’s Testing for Clickjacking (OTG-CLIENT-009) SOLUTION To prevent clickjacking attacks, the app must set X-FRAME-OPTIONS header with an appropriate value:- If set correctly, the HTTPS response should show X-FRAME-OPTIONS header:- There are several ways to set this header. Solution 1: Using… Read More…
-
JEE Security: Disabling HTTP OPTIONS method
PROBLEM HTTP OPTIONS method is used to provide a list of methods that are supported by the web server. For example, the following shows both GET and HEAD are allowed on the given link:- Enabling OPTIONS may increase the risk of cross-site tracing (XST)… see OWASP’s Test HTTP Methods (OTG-CONFIG-006). SOLUTION There are several ways… Read More…
-
Maven GPG Plugin: Prevent Signing Prompt or “gpg: signing failed: No such file or directory” Error
PROBLEM Given the following Maven settings.xml:- … and the following Maven GPG Plugin configuration in pom.xml:- When running mvn clean deploy, you either get a prompt for you to enter the GPG passphrase:- … or, get the following error:- The long story short, Maven GPG Plugin isn’t using the passphrase defined in the Maven settings.xml…… Read More…
-
Groovy: Copying Properties Between Two Beans
PROBLEM Given two beans… There are several ways to copy properties from one bean to another:- SOLUTION Groovy provides a helper class to solve this problem called InvokerHelper. The advantage of using this is there’s no need to import yet another dependency and it still allows us to keep our code concise. Scenario 1: Both… Read More…
-
Spring MVC: Failed to convert value of type ‘java.lang.String’ to required type ‘java.time.LocalDateTime’
PROBLEM Given the following controller … When executing … … the web service call returns 400 Bad Request with the following error in the console log:- SOLUTION One solution is to change the data type from java.time.LocalDateTime to java.lang.String before parsing it to java.time.LocalDateTime. However, it is a little more verbose than I like. A… Read More…
-
MS SQL Server + Hibernate 5: Incorrect syntax near ‘@P0’
PROBLEM When upgrading to Hibernate 5, the following exception is thrown:- SOLUTION Change the MS SQL Server dialect from this… … to this … Read More…
About Author

This author has 20+ years of experience in software engineering and cloud engineering. In an industry where knowledge becomes obsolete in the next three months, he learns anything that crosses his path indiscriminately. He floats from one technology to another like a moth and stings the problem sets like a mosquito. This author codes Java while drinking Espresso and writes Spock specifications while listening to Groovy beats. He masters Google Cloud Platform just like how he masters the art of predicting the movement of dark clouds over his backyard, where 60% of the time, he is right every time.
This author suffers from the Dunning-Kruger effect, where he overestimates his competence and underestimates his ignorance. Technology buzzwords never faze him, for he does not know enough to be afraid of in the first place. GCP, GCS, GCR, GKE, GWT… everything sounds the same to him. He never fears acronyms, synonyms, or antonyms, for he has ChatGPT in his back pocket. This author is a jack of all trades but a master of none. He writes like he knows all the answers, yet he googles for better solutions from elsewhere. He fakes it until he makes it; if he doesn’t, that’s okay because he has the attention span of a squirrel. The blog posts are his buried walnuts, in case he needs them one day.
In conclusion, this author is full of something. He apologizes in advance if you are trying to solve your company’s real problems with his shitty solutions. There, he has successfully written paragraphs of nonsense because every professional blogging website needs a section about the author, with a too-cool-to-smile portrait staring sideways into the abyss.