Top Nav

Archive | Uncategorized

Block On X-Forwarded-For

Block an IP address based on the X-Forwarded-For header:

 

 

0

MySQL – Run Command On All Tables

Here’s a one-liner to run a SQL command on all tables in a database:

  • Replace “show create table” with the command that you wish to execute.
  • Replace “mydb” with your database name.
  • Replace “root” and “mypassword” with you username and password.
  • Replace “localhost” with your database server hostname or IP address.

 

0

Create Clonezilla USB Stick

This article describes the steps to create a bootable Clonezilla USB stick. This stick can be used to boot a computer and create or restore a cloned image.

The USB stick should be a minimum of 1GB in size. It will be totally overwritten and erased so make sure there is nothing of value on the stick.

This procedure assumes you’re working from a Windows PC. Additionally, this procedure uses the Rufus open-source utility to burn the Clonezilla ISO to the USB stick and make it bootable.  There are other utilities that can be used for this procedure for non-Windows environments.

  1. Download and install the Rufus utility from here: https://rufus.ie
  2. Download the alternative stable Clonezilla ISO image. Select the “amd64” CPU architecture and ISO file type from here: https://clonezilla.org/downloads.php
  3. Insert the USB stick.
  4. Start the Rufus utility.
  5. In the Device field, select the USB stick.
  6. Click the SELECT button and choose the Clonezilla ISO.
  7. Click the START button.

The process will take about a minute to complete. When finished remove the USB stick and close the Rufus utility.

0

Getting the CA Certificate Chain

Most SSL providers don’t include a complete CA certificate chain with their SSL certificate and it can be hard to track down the correct chain. There’s a great website for this purpose. Check out https://whatsmychaincert.com/ … just paste in the certificate and download the correct cert chain. I’ve used hundreds of times on many different SSL providers and it’s worked every time.

0

AccessControlAllowOrigin CORS Header With Multiple Domains

The AccessControlAllowOrigin CORS header does not allow multiple domains. This can be a problem in some cases. A workaround on the server is to detect the incoming Origin header, match against an allowed list and then generate the AccessControlAllowOrigin header using the domain. In Apache this can be accomplished with:

 

 

0