Quantcast
Channel: The Accidental Developer
Browsing all 144 articles
Browse latest View live

Notifying a REST API from Icinga2

I wanted to send Icinga2 notifications to Slack. Some hosts and services don’t rise to the level of a PagerDuty notification, but e-mail just doesn’t cut it. A message in a Slack channel seemed an...

View Article


Image may be NSFW.
Clik here to view.

Modifying a packet capture with Scapy

My motivation was to start from a known good packet capture, for example, a DNS request and reply, and modify that request to create something interesting: an example to examine in Wireshark, or...

View Article


Using Buildah to build containers for Docker and Podman

One of my colleagues pointed me to an article on using Buildah to create container images: How rootless Buildah works: Building containers in unprivileged environments. I decided to test it out! In...

View Article

Combining pcap (packet capture) files

Motivation: I wanted to combine 2 or more packet capture, or pcap, files in order to create an example: One that contains just malicious (or simulated malicious) network traffic Another contains...

View Article

Running VMs? Delete wireless packages!

A best practice for system configuration is to remove any unneeded software. It’s sometimes difficult to know exactly what is needed and what isn’t, but CentOS 7 minimal and CentOS 8 minimal both...

View Article


nmap scans the top 1000 ports by default, but which 1000?

From man nmap: The simple command nmap target scans 1,000 TCP ports on the host target. You might reasonable ask, which 1,000 ports is it? Is the particular port in which I am interested included?...

View Article

Size of data in bytes

This was prompted by an error I was running into with the AWS s3 service: I needed to tell the transfer utility the size of the data, in bytes, when transferring large files. In this case I am looking...

View Article

IPBan: fail2ban for Windows

I was looking for a tool to block IP addresses after a certain number of failed RDP login attempts, something like fail2ban but for Windows. I came across IPBan. Calling IPBan a “fail2ban for Windows”...

View Article


IPBan’s ProcessToRunOnBan functionality

The IPBan config file contains 2 interesting items that can trigger actions when IP addresses are banned or unbanned: ProcessToRunOnBan and ProcessToRunOnUnban. Here’s the default config entry for...

View Article


DIY Gist Chatbots

[This was originally posted at the now-defunct impractical.bot on 23 Feb 2019] I created a tool that will allow anyone to experiment with NLTK (Natural Language Toolkit) chatbots without writing any...

View Article

Running Splunk in AWS

I don’t like using Google Analytics. The data is useful and well-presented, but I really just want basic web stats without sending all my web stats (along with data from my users) to Google. I’ve...

View Article

WordPress 6.3 is incompatible with older versions of PHP

After installing WordPress 6.3, this site was broken because the new version of WordPress isn’t compatible with PHP 5.x. I know WordPress has been complaining about this for a while, but PHP 5.x is the...

View Article

Migrating database servers

As I’m migrating websites and applications from one server to another, I’m also migrating databases from one server to another. Even though I’ve done this dozens, if not hundreds, of times, I always...

View Article


3 ways to remove blank lines from a file

There are certainly more than 3 ways to do this. Typically I’ve always used sed to do this, but here’s my method using sed and two other methods using tr and awk: sed: sed '/^$/d' file_with_blank_lines...

View Article

Converting a WordPress site to a static site using Wget

I recently made a YouTube tutorial on converting a WordPress site to a static HTML site. This blog post is a companion to the video. First of all, why convert a WordPress site to a static HTML site?...

View Article


Renaming multiple files: replacing or truncating varied file extensions

In the previous post, I ran into an issue where Wget saved files to disk verbatim, including query strings/parameters. The files on disk ended up looking like this:...

View Article

Minor improvements to legacy Perl code

We’re always working with code we didn’t write. You’ll spend far more time looking at code you didn’t write (or don’t remember writing) than you will spend writing new code. Today I looked at an...

View Article


DirectoryIndex on a static HTML site hosted by AWS

Apache’s mod_dir has a DirectoryIndex option so that if you request a directory, it can return the index document for that directory. For example: https://www.example.com/dir/ would return...

View Article

Hosting a static site on AWS using S3 and CloudFront

A few years ago, Michael Berkowski gently scolded me for hosting a site on HTTP — not HTTPS. I decided that the easiest way to fix this (ignoring Let’s Encrypt for now) was to instead host the site, a...

View Article

Image may be NSFW.
Clik here to view.

Extracting links from Google Sheets

I was working with a shared Google Sheet at work and ran into this: An excerpt of a Google Sheet. Each row contains a cell with a hyperlink labeled Link, but the actual URL is not displayed. I get it,...

View Article
Browsing all 144 articles
Browse latest View live


Latest Images