All tags
Recent posts
You can track changes to a tag through AWS CloudTrail, AWS Config, or Amazon CloudWatch Events, these methods have already been documented but they’re too slow to respond to changes, too expensive to run, not as extensible out-of-the-box, or outdated. I haven’t seen much coverage on doing this with Amazon EventBridge, which has many integration options, is low-latency, and is fairly low cost (and in this case free). There is a page in the documentation titled Monitor tag changes with serverless workflows and Amazon EventBridge that covers just that, I’d recommend starting there. Read more...

To show related content on this blog I use Hugo’s in-built functionality, which works surprisingly well with no setup. I did, however, want to test out creating text embeddings from my posts and rank them by similarity. Before you continue reading, the usual disclaimer: Do not take the information here as good or best practice. The purpose of this entry is to post my learnings in somewhat real-time. I will use Amazon Titan Embeddings G1 - Text available through Amazon Bedrock and SQLite to store the results. Read more...

Brick station building with a tower, a pole with an M on a blue cube is in front of the station.
Amsterdam is a busy city with residents, businesses and visitors often talked about for its good urban planning, offering a walkable city that is still accessible by car, train, metro, tram, and bus. To those who have lived in or traveled around Amsterdam you will have come across the metro and their blue cubes with an “M” and red R-NET band at the bottom. If you’ve taken the time to travel on the Amsterdam Metro, does it seem like a typical metro? Read more...

It has been 87 days since I enabled the ability to show related content at the bottom of each post on this blog, aptly titled “Related ramblings”. This uses Hugo’s built-in Related Content functionality. If you use a pre-made theme you may never directly work with this feature. I wanted to highlight how easy it was to use and how impressed and I am with the results. To enable my theme to use this features, I simply had to create a new partial that could be used in my post template. Read more...

Photo of NS 1700 locomotive, number 1761, pulling DB coaches at Hilversum station.
Between 1990 and 1994 eighty-one Class 1700 locomotives were built by Alstom. These were an iteration of the Class 1600 that came before, based on the French BB 7200. Over the years they were used in a push-pull configuration for DD-AR coaches, ICRm coaches, and others. By the 2010s most of the locomotives were no longer used and in 2019 the 1700 locomotives were only used to pull the IC Berlin train from Amsterdam to Bad Bentheim by NS. Read more...

Picture of Sprinter train on a level crossing with barriers fully lowered.
Well, it’s time to revisit the topic of leaf fall. About a month has passed since my last post on the subject of adhesion and leaves on the track, and it is time for a quick update. As of 8th November, ProRail has deemed it unsafe to operate trains between Utrecht Centraal and Utrecht Maliebaan, the home of the railway museum. The culprit? Leaves on the track causing the train to go incognito. Read more...

It was a rainy Saturday afternoon when I was at a cafe with my wife scrolling through Hacker News when I came across Arne’s blog on why you should write your own static site generator (SSG). I had recently gone down that road myself, at least partially, so seeing someone’s views on the same topic intrigued me. I’ve been meaning to gather my thoughts around the subject, and what better time than now as somewhat of a response to Arne’s blog? Read more...

There have been a number of occasions where I needed to insert JSON objects into an SQLite database, the sqlite-utils Python library and CLI tool handled the task every time. I will be showcasing some of the JSON-inserting capabilities via CLI below. Inserting a single JSON object Here the object is stored in data.json, sqlite-utils takes in the insert command, the name of the database, the name of the table, the filename, and lastly, I also specify the column to use as the primary key. Read more...

To plot rail stations on a map for past blogs1 and toots23 I needed to fetch their longitudinal and latitudinal coordinates. This process can be described as geocoding, getting a coordinates from name or address. There are many powerful libraries out there that have the capability to do this, but I wanted something quick and simple to get started, this is where Nominatim comes in. In their own words: Nominatim (from the Latin, ‘by name’) is a tool to search OSM data by name and address and to generate synthetic addresses of OSM points (reverse geocoding). Read more...

Picture of trees with no leaves, green and yellow grass with a wire fence.
It’s that time of year again, pumpkin spice lattes are in at Starbucks, sweaters are making their way out of storage and leaves are falling off trees. That last point concerns this thread more than the others. Damp leaves and train tracks are not the best match. Wheel-rail contact and adhesion The train wheel and rail meet on a very small surface area, called the contact patch. That small area must have enough friction to start and stop the train. Read more...

What I like about Sass and other CSS preprocessors, despite my limited usage of them, is the ability to nest CSS elements to assign style rules to children. Earlier this year the first version of the CSS Nesting Module specification was published by W3C. This brings the feature of CSS nesting to the browser! According to CanIUse, nesting is already supported by all major browsers as of this year. Here’s a basic example, I have an article with a <h1> and <h2> header where I’d like all <h2> headers within the article to be blue. Read more...

I host all my images outside of Hugo to prevent any large files from residing in my git repository. This has led me to serve high resolution images in most of my posts which aren’t ideal for the end user. I recently learned about Hugos ability to get remote images, aptly titled resources.GetRemote, which then allows me to apply Hugo’s image rendering capabilities. This video by Eric Murphy covers some compressing and resizing methods within Hugo that I’ve applied to this blog. Read more...

Markdown is a neat and simple way to format text using a basic editor. You’ll have come across it on various different forums, instant messaging apps, and blogging platforms among other places where text fields are used. It was created by John Gruber in 2004 and had then been adopted across different platforms but lacked a standardised implementation. To address these inconsistencies, Jeff Atwood, John MacFarlane, and others have formed a group in an effort to standardise. Read more...

Update 2023-12-19: Got an update from the issue I raised that the AWS Backup Access Policy and IAM role issue has been resolved in the Terraform AWS Provider version v5.30.0 via this Pull Request thanks to @nam054 and @johnsonaj. They delay has now been added as part of the provider itself and I’ve confirmed it works! You can disregard the rest of this post or continue reading if you’re interested. Read more...

Picture of two SLT trainsets coupled.
The year is 1992, Sir Mix-a-lot’s Baby got Back is on the pop charts, and the Dutch railway (NS) is dominated by the Mat ‘64 trains, with a fleet of 246 units. These trainsets were introduced in 1961, making them 31 years old by 1992. Also during this time, the original Sprinter, the Stadsgewestelijk Materieel (SGM) is only 17 years old and approaching the middle of its expected lifespan. Read more...

The following post outlines how to use ffmpeg to take a number of images and create a video with each image present for a set duration with cross fades. The images are centered in the video with a black background. There are some instances when a previous image may be visible if it’s too large, it’s been a while since I tested this thoroughly so it could use some tweaking. Read more...

SGM number 2133 at the Railway Museum at Utrecht in its yellow, blue and white livery.
Sprinters in the Netherlands are easily recognisable by their blue and white livery. These trains are specifically designed to accelerate and decelerate quickly, making frequent stops along their route. In contrast, Intercity trains primarily serve large stations with fewer intermediary stops. During the 1960s and 1970s, the Netherlands went through a wave of suburbanisation, prompting the government to start the construction of planned cities such as Nieuwegein.1 It was during this time that the Dutch national railway company, NS, released “Spoor naar ‘75” a plan outlining the future of public transport in the country. Read more...

Disclaimer: Do not take the information here as a good or best practice. The purpose of this site is to post my learnings in somewhat real-time. AWS IAM Identity Center (previously and more commonly known as AWS SSO) allows you to control access to your AWS accounts through centrally managed identities. You can choose to manage these identities through IAM Identity Center, or through external Identity Providers (IdPs) such as Okta, Azure AD, and so on. Read more...

Picture of Class 345 EMU, number 006, on platform at Southall station under a pedestration bridge with passengers disembarking.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 24 June 2023 19:34 Recently, I had the opportunity to ride the Elizabeth Line, a commuter rail and rapid transport system, much like the Paris RER, connecting greater London to its core. After starting construction in 2009 it was officially inaugurated on 17 May 2022, the line goes from Reading and Heathrow in the west to Shenfield and Abbey Wood in the east. Read more...

Red and white carriage with Euroepan Sleeper logo at platform
European Sleeper is a Dutch startup created in 2021 with plans to run European night trains. Formed by Elmer van Buuren and Chris Engelsman, the train operator ran their first passenger service on 25th May 2023, from Berlin to Brussels, through Amsterdam, Rotterdam and Antwerp. From 2024, European Sleeper also plans on expanding past Berlin to Dresden and Prague. Since earlier 2022, I’ve been closely following the progress made by European Sleeper, anticipating their first ride. Read more...

Picture of a boxy metro car M-2610 (variant A) at Tribunal station with red lights.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 14 May 2023 11:56 This weekend we have the series 7000 and 9000 manufactured by AnsaldoBreda for the #Madrid #Metro 🇪🇸, in 2002 and 2006 respectively. They're designed for the wide guage lines and come in single and dual-voltage variants as the metro system use both 600V DC and 1500V DC through rigid overhead catenary. Read more...

Picture of Protos, number 5035, at Amersfoort Centraal. The trains namesake, Marijke van Haaren, is printed on the right alonside Valleilijn with blue livery. "niet instappen" is shown on the train display.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 6 May 2023 15:37 Not all Dutch trains are yellow! This is the Protos, an EMU built by Fahrzeugtechnik Dessau (FTD). Only 5 of these trains were ever put in service and they all run on the Valleilijn 🐓between Amersfoort and Ede-Wageningen operated by Connexxion since 2007. #train Replies: 1 Boosts: 0 Favourites: 0 | Source @PeskyPotato 6 May 2023 15:41 Connexxion operates the Protos and FLIRT 3 along the Valleilijn however, from December 2023, Keolis will take over the staff and rolling stock from Connexxion after winning the tender. Read more...

Picture of the Gothic Arch before an at-grade crossing from platform 1 of Hilversum Sportpark.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 30 April 2023 17:10 It's the weekend again, and it's time to spew information on my current rail obsession. The Netherlands started electrifying railway lines in the 1900s, and during WW2 concrete catenary masts were favoured because of the scarcity of steel. The Utrecht-Hilversum line was electrified in 1942 and received these unique horseshoe-like shaped portals nicknamed de Gotische Bogen (the Gothic Arches). Read more...

ICNG 3133 and 3222 coupled at a platform in Amsterdam Centraal.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 19 April 2023 06:38 And we're off! Behold the wasp, it's shiny and smells like brand new sneakers. #train #ICNG Replies: 1 Boosts: 0 Favourites: 2 | Source @PeskyPotato 19 April 2023 07:53 @phrawzty Indeed! A few more from this morning. #ICNG Replies: 0 Boosts: 0 Favourites: 1 | Source @PeskyPotato 21 April 2023 16:25 Perfect timing, the ICNG stickers I sent to print has arrived. Read more...

Picture of the control and power car of the Talgo II, named Virgen de Aránzazu. Painted gray with red strips and window cut outs to view the diesel-electric engine.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 15 April 2023 15:18 Talgo, innovative Spanish train manufactuer, started experimenting in the 1930s with self-guiding wheels, articulated trainsets and aluminium train bodies with a low center of gravity to come up with the Talgo II. Replies: 1 Boosts: 0 Favourites: 1 | Source @PeskyPotato 15 April 2023 15:20 Talgo II was manufactured by American Car Foundry under Talgo's watch entering service in 1950 between Madrid, Spain and Hendaye, France, traveling up to 120 km/h. Read more...

The AWS API allows you to list-rules which returns a list of all the rules but does not list targets. The API also provides you with list-targets-by-rule which allows you to list the targets associated with a specific rule. If you want to find all the rules with a specific target, this case an event bus, you can join both of them together. No idea if this is acceptable practice, or if I’ll ever use this again, but I will unleash this string of commands and pipes to the world. Read more...

NS SLT 2445 second class carriages on a Jacobs bogie.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 1 April 2023 09:31 We're spotting Jacobs bogies! A Jacobs bogie is shared across two carriages as opposed to two bogies per carriage. Pictured is the Thalys PBKA at Paris Nord, NS SLT, and NS SNG at Utrecht Centraal. #train Replies: 0 Boosts: 0 Favourites: 1 | Source

Yellow classic refurbished tram 28 on road heading in the direction of Prazeres.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 5 March 2023 11:39 Here's Lisbon's very popular #Tram 28E at Praça Martim Moniz. Carris operates 6 tram routes, 5 of which are served by these classic refurbished trams, and one by articulated trams built by Siemens/CAF and Siemens/Sorefame. Replies: 1 Boosts: 0 Favourites: 0 | Source @PeskyPotato 5 March 2023 11:42 p. Read more...

This post details how to update a domain record entry on Linode based on the public IP of a machine running Linux. We will create a python script and use the Linode API to accomplish this. Create a personal token in Linode From your Linode console under My Profile > API Tokens you can create a personal access token. The script only requires read/write access to the Domains scope. From here you can also set your desired expiration time. Read more...

Front and side view of the M2 metro set with "53" in the front window.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 25 February 2023 14:13 This is an M2 metro set built by Linke-Hofmann-Busch (LHB). All fairly alike, the M1/M2/M3 sets were used when the Amsterdam metro first opened on 14 October 1977. They were nicknamed "Zilvermeeuw" (translates to Herring Gull) for their shiny stainless steel exterior. This set was the last to be taken out of service on 19 December 2015 as the newer M5/M6 series from CAF were introduced between 2012 and 2015. Read more...

SBB RAm and NS DE4 power car pained red and beige.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 19 February 2023 20:20 This is the diesel-electric NS DE4 (and SBB RAm TEE) developed by SBB and NS for the Trans Europ Express and put in service in 1957. Five of these 4-part trains were built, each consisting of a power car, passenger car, dining car and control car. #train Replies: 1 Boosts: 0 Favourites: 1 | Source @PeskyPotato 19 February 2023 20:21 The trainsets were discontinued in 1973 and sold to Ontario Northland Railway in 1977. Read more...

The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 17 February 2023 21:55 Last month Strukton showcased their battery powered locomotives at a press event with the State Secretary for Infrastructure and Water Management. This isn't just a battery powered locomotive but can also be charged through overhead lines. https://struktonrail.com/our-stories/news/2023/01/state-secretary-gives-green-light-for-rail-terminal-lage-weide-and-battery-locomotive/ Replies: 1 Boosts: 0 Favourites: 0 | Source @PeskyPotato 17 February 2023 21:56 Strukton Rail previously purchased one NS Class 1600 locomotive and three NS Class 1700 locomotives, all built by Alstom. Read more...

Passengers entering MI 09 train.
The contents of this post were originally toots on Mastodon, you can find the original thread there. @PeskyPotato 12 February 2023 06:52 It's the weekend and time for #trains! Here's the MI 2N "Altéo" a dual-voltage EMU from Alstom and Bombardier that serves the busiest rail line, RER A, in France and possibly Europe. Replies: 1 Boosts: 0 Favourites: 1 | Source @PeskyPotato 12 February 2023 06:53 I'm impressed with the efficiency at which the Paris metro runs. Read more...

G.Washington steam locomotive
I recently visited Disneyland Paris and I spent more time researching and experiencing the Paris metro system and the RER than looking up and preparing for Disneyland itself. Upon visiting the park in Disneyland Paris I was pleasantly surprised to be greeted by a railway line right by the park entrance. There was no crowd, no line whatsoever, just an elegantly designed station. Going up the stairs I saw the steam locomotive coupled to passenger cars about to depart. Read more...

Disclaimer: Do not take the information here as a good or best practice. The purpose of this site is to post my learnings in somewhat real time. Create an OIDC IdP on AWS This needs to be done once for an AWS account, this configures the trust between AWS and GitHub through OIDC. Create an OpenID Connect identity provider for GitHub on AWS. From the IAM console, choose Identity providers and then Add provider. Read more...

Install exiftool. sudo apt install exiftool # sudo apt install libimage-exiftool-perl Remove all tags. exiftool -all= image.jpg Remove only EXIF tags exiftool -EXIF= image.jpg

Server and client setup Install Wireguard on both server and client sudo apt install wireguard Create the public and private key on both server and client. Store the private keys in a secure place. wg genkey | tee privatekey | wg pubkey > publickey Server configuration Create and open the file /etc/wireguard/wg0.conf. Insert the following block and view the examples on the table below. Variable Exmaple <server-ip> 10.0.1.1 <subnet> 24 <interface> eth0 <server-private-key> kj202323j23mwnew0= <server-port> 51820 [Interface] Address = <server-ip>/<subnet> SaveConfig = true PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o <interface> -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o <interface> -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o <interface> -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o <interface> -j MASQUERADE ListenPort = `<server-port>` PrivateKey = <server-private-key> Bring up Wireguard on the client Read more...

Recursively deleting all objects in a bucket and the bucket itself can be done with the following command. aws s3 rb s3://<bucket_name> --force If the bucket has versioning enabled any object versions and delete markers will fail to delete. The following message will be returned. remove_bucket failed: s3://<bucket_name> An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. You must delete all versions in the bucket. Read more...

Grabbing just an IP address from a network interface can be useful for scripting. In the example below the assumed interface is eth0. ip a show eth0 | grep "inet " | cut -d' ' -f6 | cut -d/ -f1 You can then save this into a variable and use it in other commands. local_ip=$(ip a show eth0 | grep "inet " | cut -d' ' -f6 | cut -d/ -f1) python3 -m http. Read more...

ffmpeg -i input.mkv -ss 00:00:03 -t 00:00:08 -async 1 output.mkv Arugment Description -i Specify input filename -ss Seek start position -t Duration after start position -async 1 Start of audio stream is synchronised See these StackOverflow answers for a debate on various other methods of trimming a video with ffmpeg.

Updating images for containers that are run through docker-compose is simple. Include the appropriate tags for the image value. docker-compose pull docker-compose up -d You can then delete the old, now untagged image. The following command deletes all untagged images. docker image prune Rollback to a previous image If you wish to rollback to the previous image, first tag the old image. docker tag <IMAGE ID> <REPOSITORY>:<TAG> Replace the image value in the compose file with the new <TAG> and recreate the service. Read more...

Install the NFS client pacakge. For distros that use yum install nfs-utils. sudo apt install nfs-common Manually mount the share in a directory. Replace the following with your own values: server with your NFS server /data with your exported directory /mnt/data with your mount point sudo mount -t nfs server:/data /mnt/data To automatically mount the NFS share edit /etc/fstab with the following: # <file system> <mount point> <type> <options> <dump> <pass> server:/data /mnt/data nfs defaults 0 0 To reload fstab verbosely use the following command: Read more...

EBS sends events to CloudWatch when creating, deleting or attaching a volume, but not on detachment. However, CloudTrail is able to list detachments, the command below lists the last 25 detachments. aws cloudtrail lookup-events \ --max-results 25 \ --lookup-attributes AttributeKey=EventName,AttributeValue=DetachVolume Setting up noticiations is then possible with CloudWatch alarms for CloudTrail. The steps are summarized below: Ensure that a trail is created with a log group. Create a metric filter with the Filter pattern { $. Read more...

Introduction These are tar commands that I use often but need help remembering. Contents Introduction Create an archive Create a gzip compressed archive Extract an archive Extract a gzip compressed tar archive List files in an archive List files in a compressed archive Extract a specific file from an archive Create an archive tar -cvf send.tar send/ -c Create an archive -v Verbose -f Specify filename Create a gzip compressed archive tar -czvf send. Read more...

Squash commits already pushed to GitHub Here I squash the last N commits by rebasing and force pushing to GitHub or another remote while avoiding this helpful but unwanted error. To https://github.com/LameLemon/pepe-is-the-man.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/LameLemon/pepe-is-the-man.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull . Read more...

Web scraping is the act of extracting data from websites. This is a repository of scrapers I’ve built over the years for various websites. They download media files and other data. These scripts exist purely for education purposes. The scrapers are built using Python 3 and BeautifulSoup which is a library for grabbing and navigating data from HTML and XML files. The source code can be found on GitHub.

ffmpeg -y -i combined.mkv -vf fps=24,scale=1080:-1:flags=lanczos,palettegen palette.png ffmpeg -i combined.mkv -i palette.png -filter_complex "fps=24,scale=1080:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif -y Overwrite output wihtout asking -i Specify input filename -vf Video filtergraph -filter_complex Creates a complex filtergraph with inputs and/or outputs Explanation and other resources: How to make GIFS with FFMPEG (GIPHY Engineering) High quality GIF with FFmpeg “You can’t just code a gif”

Only applies if video has an existing audio track. ffmpeg -i video.mkv -i audio.mp3 -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 ouput.mkv -i Specify input filename -c:v Encode all video streams -c:a Encode all audio streams -strict Specify how strictly to follow the standards -map Designate one or more input streams as the srouce for the output file

ffmpeg -i input.mkv -vf reverse -af areverse output.mkv -i Specify input filename -vf Video filtergraph -t Audio filtergraph

ffmpeg -i input.mkv -ss 00:00:03 -t 00:00:08 -async 1 output.mkv -i Specify input filename -ss Seek start position -t Duration after start position -async 1 Start of audio stream is synchronised Resources ffmpeg Documentation - Official FFmpeg documentation ffmprovisor - A repository of useful FFmpeg commands for archivists

Previous Page Next Page