My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Category: Server

  • WordPress: Creating Gutenberg-Block Compatible Posts Using Rest API

    This article shows how you can dynamically create new WordPress posts using REST API that is compatible with Gutenberg blocks. When done correctly, there is no need to manually convert the content from Classic Editor to Gutenberg Block Editor, or fix incorrectly converted blocks. This is a big time saver when you plan to create […]

  • Squid: Configuring Whitelisted URLs

    PROBLEM To configure a proxy server that only allows whitelisted URLs through. SOLUTION Install Squid… in this case, on Ubuntu. Ensure the service is running. Create a file ( /etc/squid/whitelist.txt ) containing the whitelisted URLs. In this example, only one URL is whitelisted. To simplify the configuration, backup /etc/squid/squid.conf and create the same file with […]

  • Nginx: Requesting and Configuring SSL Certificate

    INTRO Step by step instructions for my future self to obtain the SSL certificate and to configure it in Nginx because my fragile little brain cannot retain them at the moment. INSTRUCTIONS Generate a private key and store it in a safe place. Generate a certificate signing request (CSR). Request a SSL certificate from Certificate […]

  • Azure: Deploying WAR File to Tomcat

    PROBLEM Typically, when using ZipDeploy to push a WAR file (ex: my-app.war) to an Azure instance, we need to:- This zip file will automatically be unzipped under site/wwwroot:- Tomcat detects ROOT.war and will try to unpack the WAR file under ROOT/:- The problem is sometimes Tomcat is unable to fully unpack ROOT.war because some files […]

  • Feign + Eureka: UnknownHostException when Attempting to Invoke a Service

    PROBLEM When attempting use Feign to invoke a service through Eureka, the following exception occurs:- SOLUTION Go to the donkey-kong-service app and add the following line to the application.properties:- Now, when Feign tries to invoke the service, the IP address will be used instead of the OS’ reported hostname.

  • Spring Boot: Connecting to IBM MQ over JMS using non-IBM JRE

    There are several ways to connect to IBM MQ:- This article shows you how to connect with Spring’s JmsTemplate. CONNECTIVITY INFO Typically, the MQ admin will provide the following connectivity info that allows you to connect to MQ:- DEPENDENCY Add the following dependency:- SPRING CONFIGURATION While the connectivity info can be hardcoded in Spring Boot’s […]