Just another blog

A brain dump of Trozz

Using Wordpress as a Static Site

Many people prefer to use Wordpress over platforms such as Hugo, Ghost et al. many of these situations don’t need a blogging platform but instead choose Wordpress due to the array of plugins and ease of management, however this obviously have a overhead compared to a static site. Why use it There can be many reasons that someone decides to use Wordpress over a flat file content management system (CMS) or even just a normal static site, some advantages and disadvantages are listed below advantage Large community Many plugins Easy to administrate disadvantage Increased load time Vulnerabilities Issues with Caching What can be done Many people look to Varnish for caching sites such as Wordpress however not many people realise that Nginx has the ability to cache built in.

CentOS / RedHat remove unused kernel versions

I notice many servers tend to have many kernels, alot of the time people do not clean these up, this can obviously lead to /boot becoming full, there are a few ways that the unused kernels can be removed, Remember you should be running the latest kernel when possible The suggested method would be to use package-cleanup which is part of the yum-utils package. yum install yum-utils Once yum-utils is installed you can clean the unused kernels with the following command package-cleanup --oldkernels --count=2 This command would keep 2 kernel versions, you can obviously change this to however many you would prefer to keep.

Automating Hugo Deployments

As you may notice I have done a few updates today, I have always had the strong believe that if a task is repeated more than once that it should be automated, now deploying something like Hugo can be very easy as if you simply commit the public folder then this folder can be deployed, personally I do not commit this folder and infact exclude it via my .gitignore, this is a habit due to the fact that I believe in reproducible builds, yes even for something as simple as Hugo.

fail2ban cloud loadbalancers

Cloud Load Balancers (LBaaS) can be used for numerous reasons, the most commonly that is for distrobuting traffic between multiple servers instead of using HAProxy or a dedicated Load Balancer, there are possitives and negatives to this however in my view load balancing as a service is a fantastic service, with some draw backs which I am sure I will detail in future posts. Anywho on to the actural reason you are reading this Challenge When using any form of Load Balancing you cannot simply block the IP address of the requests as this will be the Load Balancers IP address, all hope is not lost however as the stand is to send along an additional header such as X-Forwarded-For or X-Real-IP, I am not sure where the latter came from but the former is the most likely to be seen, using this additional header we can get the users IP address, this can be used within system logging or your application, in the situation that we are going to discuss we are relying on the system logging the IP address correctly.

Resetting rax_service_level_automation metadata

During my previous time at Rackspace numerous users have had issues where their Managed Cloud Server would enter a failed status, this is commonly due to the post-build automation failing, the reasons for this can include novaclient not running, SSH running on a different port, package installation issues et al. This would commonly result in the user having to contact Rackspace to resolve the issue, while you should continue to contact Rackspace about this to ensure that the managed software is correctly installed, the below would allow you to update the metadata that is set due to this failure.