Rob Henley

I’ve integrated a few payment gateways over the years including Authorize.net, WePay, Spreedly, and Stripe but recently had the opportunity to integrate Authorize.net into our system. It’s actually not the first time I’ve integrated Authorize.net as I did a server-side implementation years ago when server-side implementations were still cool. I mention this to show I’ve seen a couple of ways this can be implemented. Maybe I’m missing something but the new Accept.js model seems to fall short in what seems like the most basic ways. ...
I have yet to find the “perfect” workflow for images for any platform but stumbled on one that could work at least for posts that tend to contain a lot of screenshots. The thought occurred to me that I could just take the latest screenshot move it to the current directory and rename it to its md5 sum. So I added the following function to my ~/.bashrc. # MOVE MOST RECENT SCREENSHOT # Moves the most recent screenshot from the Screenshots directory into the current directory # # An example output would be: # Screenshot 2024-05-25 at 9.40.31 AM.png => 7be6a2f02ea74453d5e1912f32680795.jpg mmrs() { EXT=png SCREENSHOTS_DIR=`defaults read com.apple.screencapture location` LATEST_SCREENSHOT=`ls -1t ${SCREENSHOTS_DIR} | head -1` MD5_SUM=`md5 -q "${SCREENSHOTS_DIR}/${LATEST_SCREENSHOT}"` mv "${SCREENSHOTS_DIR}/${LATEST_SCREENSHOT}" "./${MD5_SUM}.png" # Convert, resize and reduce if imagemagick is present if command -v magick &> /dev/null; then # NOTE: This keeps the original png magick "${MD5_SUM}.png" -strip \ -resize 1920x \ -quality 65 \ -interlace JPEG \ -sampling-factor 4:2:0 \ "${MD5_SUM}.jpg" EXT=jpg fi # Copy markdown to clipboard if `pbcopy` exists if command -v pbcopy &> /dev/null; then echo "" | pbcopy fi echo "${LATEST_SCREENSHOT} => ${MD5_SUM}.${EXT}" } Then I can just take a screenshot normally with CMD+Shift+4 or CMD+Shift+5 and run the bash function to move it into the folder for my page resource: ...
When setting up Borg if you get the following error Remote: bash: line 1: borg: command not found Connection closed by remote host. Is borg working on the server? This was because only the .bashrc is executed for non-interactive sessions and inside the .bashrc of at least Ubuntu (24.04) is the following at the very top of the file. This meant that in my case I needed to put the path related environment variables above the following lines so SSH could find the borg command. ...
I’m trying to recursively download a S3 folder from an EC2 instance. I have role with a policy that includes: s3:ListBucket among other things attached to the EC2 instance and can download individual files but keep getting the following error when trying to do so recursively: “An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied” The command being used that was erroring: aws s3 cp s3://<bucket>/<path>/ ~/temp --recursive --debug ...
This is mostly a note to myself because for some reason when testing CORS headers I nearly always manage to forget to include the Origin header. For completeness here’s an example using curl: curl -v --request OPTIONS 'localhost:8080' --header 'Origin: http://example.com' Here’s an example of doing an OPTIONS request to test authorization against AWS S3: curl --head --request OPTIONS \ --header 'origin: https://www.example.com' \ --header 'Access-Control-Request-Method: GET' \ https://s3.amazonaws.com/example/path/to/object/my-image.jpg NOTE: Probably more to the story but CORS seems very expensive! In my completely non-scientific tests CORS added 3x cost to the speed of the request. ...