Constructing a hyperlink to start a Facebook Messenger Conversation (Misc)

If you're running a business website (or are just particularly chatty), you might want to display a button which allows users to contact you via Facebook Messenger. This ease of access can lead to increased conversion rates.

Facebook used to provide a "Message me" widget, however these were discontinued in September 2024.

However, it's possible to construct a hyperlink which can be used to initiate a conversation via facebook messenger.

This snippet details how to construct a link which begins a messenger conversation with your account on Facebook.

Business Pages

This approach also works for business pages, however you'll need to ensure that you've set a username for the page:

  1. Switch to your page profile
  2. Settings -> Page Setup.
  3. Click the View button next to Name
  4. If you've a username set it'll be displayed, otherwise there'll be a textbox to select it.

Read more…

List Resource Requests and Limits for Kubernetes pods (Misc)

Running kubectl get pods is pretty straightfoward, but it can do also do a lot of filtering

If you've ended up with fewer pods per node than expected, it's worth looking at what resources are being requested. Similarly, if you're seeing a high rate of evictions, it's worth looking at what the limits are

This snippet details listing requests and limits, per pod, on a node

Note: if you have, or are able to install the kubectl-ice plugin it's a far superior method because it can also show you what's actually been used.

Read more…

Calculating the difference between subsequent values in SQL (SQL)

It's sometimes desirable to caculate the difference between subsequent points.

This might be necessary, for example, if a record's value is drawn from a cumulative total (such as packet counter on a switch) - we're not really interested in the total value so much as the change over time.

The LAG function can be used to look at the previous value, whilst LEAD can be used to look at the next

If the source is something like a packet counter, it might also be desirable to generate a non-negative difference so that a counter reset doesn't lead to large negative figures being reported.

Read more…

List pods running on a kubernetes node (Misc)

Running kubectl get pods is pretty straightfoward, but it can do also do a lot of filtering

If contention is suspected, it's often useful to be able to see what other workloads the underlying node is carrying

This snippet details getting node information from kubectl, with an example showing out how to list all pods that are running on the same node as a pod with a specific label.

Read more…