<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrew MacRobert on Medium]]></title>
        <description><![CDATA[Stories by Andrew MacRobert on Medium]]></description>
        <link>https://medium.com/@Andrew-MacRobert?source=rss-f70b2cff09b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jLFStycFofq6EXUb</url>
            <title>Stories by Andrew MacRobert on Medium</title>
            <link>https://medium.com/@Andrew-MacRobert?source=rss-f70b2cff09b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:06:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Andrew-MacRobert/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Verify an Electrum GPG Signature on macOS]]></title>
            <link>https://medium.com/@Andrew-MacRobert/how-to-verify-an-electrum-gpg-signature-on-macos-cf141fb96a83?source=rss-f70b2cff09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf141fb96a83</guid>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[electrum]]></category>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Andrew MacRobert]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 19:31:08 GMT</pubDate>
            <atom:updated>2025-08-12T19:31:08.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Before sending or receiving cryptocurrencies, it’s important to verify your software client is what it says it is. If a malicious actor was able to get an altered version installed on your computer, they could do anything with your wallets — including taking all your money.</p><p>To make sure you’re not vulnerable to such an attack, you must verify the software. Here’s how to do that with <a href="https://electrum.org/">Electrum</a>, a popular Bitcoin wallet, on macOS.</p><ol><li>In the terminal, install gnupg: brew install gnupg <br>(if you get “command not found: brew, ” you need to first <a href="https://brew.sh/">install homebrew</a>).</li><li>Download Electrum from its <a href="https://electrum.org/#download">offical website</a>, electrum.org.</li><li>Download the Signatures associated with the download from the downloads page.</li><li>Download the four public keys that are used to sign the executables (Right click &gt; “Save Link As” on each of these):<br><a href="https://raw.githubusercontent.com/spesmilo/electrum/master/pubkeys/ThomasV.asc">ThomasV</a>, <a href="https://raw.githubusercontent.com/spesmilo/electrum/master/pubkeys/sombernight_releasekey.asc">SomberNight</a>, <a href="https://raw.githubusercontent.com/spesmilo/electrum/master/pubkeys/Emzy.asc">Emzy</a>, and <a href="https://raw.githubusercontent.com/spesmilo/electrum/master/pubkeys/felixb_f321x.asc">felixb_f321x</a>.</li><li>In the terminal, navigate to your downloads and import the keys:<br>gpg --import ThomasV.asc sombernight_releasekey.asc felixb_f321x.asc Emzy.asc</li><li>Verify your downloaded software with the signatures file (changing the filenames as necessary):<br>gpg --verify electrum-4.6.1.dmg.asc electrum-4.6.1.dmg</li></ol><p>If everything is correct, you should see something like this, with four counts of “Good signature from ____”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7CY5NDnMJOzzYYeRpsG2w.png" /></figure><p>Now you can go open and use Electrum without fear of your software being compromised.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf141fb96a83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Cheap Static Website with Symfony and AWS]]></title>
            <link>https://medium.com/@Andrew-MacRobert/build-a-cheap-static-website-with-symfony-and-aws-66560f885357?source=rss-f70b2cff09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/66560f885357</guid>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[static-site]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Andrew MacRobert]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 14:20:05 GMT</pubDate>
            <atom:updated>2022-08-29T14:29:43.980Z</atom:updated>
            <content:encoded><![CDATA[<h4>Host your hobby sites for under $1/month by rethinking your stack</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XORmpPtaGfV6dB5xDi-utw.png" /></figure><p>Every year, my shared hosting bill makes me wonder if it’s worth renewing.</p><p>A few hundred dollars is fair for what most shared hosting companies provide, but it‘s hard to justify when all you’re running is a few hobby sites that don’t change much, don’t have user logins, and don’t make much money.</p><p>For example, my <a href="https://andrewmacrobert.com/">photography website</a> was a Symfony application running on JustHost’s “Plus” plan for $14.99 a month . That price provides space on a shared Linux server running Apache, PHP, and MySQL, which the application needed to serve traffic and let me author its content.</p><p>In reality, sites like that could just as well be a collection of cheaply hosted static HTML files instead of a website run on a LAMP stack costing about $200/year. But I just don’t want to sacrifice using Symfony. The Twig templating engine makes building webpages a pleasure, and bundles like Sonata Admin makes authoring the site’s content a breeze. I don’t want to get stuck writing HTML myself.</p><p>Luckily, there are some great solutions. Here’s mine:</p><ol><li>I used a static site generator to build a static site from my Symfony site,</li><li>hosted the site on AWS S3 behind a CloudFront distribution, and</li><li>built a deployment process to automate it all whenever I author or change the content.</li></ol><p>Here’s the how-to, step by step:</p><h4>Step 1: Use a static site generator to create your static website</h4><p>I used <a href="https://stenopephp.github.io/Stenope/">Stenope</a> to generate the static site from my Symfony site. Stenope crawls your Symfony site and builds a static version of it as it exists at that time.</p><p>You can use any site generator that suits your needs. There’s a good list at <a href="https://jamstack.org/generators/">jamstack.org/generators</a>.</p><p>If you use Stenope, install it with:</p><pre>composer require stenope/stenope</pre><p>Then build the static site with:</p><pre>bin/console -e prod stenope:build ./static</pre><p>This will build the site and put the resulting HTML files and assets in a directory namedstatic.</p><p>Each of your website’s routes will be its own directory holding an index.html file. As long as you can ensure those document indexes are displayed by default, all your existing routes will work as usual (e.g. “/blog/123” should respond with the generated file “/blog/123/index.html”).</p><h4>Step 2: Create your AWS infrastructure</h4><p>Next you’ll need to create a place to host your site. I use AWS for its ease and low cost (well, low cost for this particular purpose).</p><p>Here’s what we want:</p><ol><li>An s3 bucket that will store the static website code</li><li>A CloudFront distribution to make serving the site fast anywhere</li><li>A domain name for the site, pointing to that CloudFront distribution</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*Tr5PeAf04zLtjiAk5qQGrg.jpeg" /></figure><p>For my site, I did #1 and #2 with a CloudFormation template. It’s always worth describing your infrastructure as code in case you need to pick it up and put it in another account, or just reset things to a working earlier version.</p><p>Here’s that template:</p><pre># static-website.yaml</pre><pre>Resources:<br>  WebsiteBucket:<br>    Type: AWS::S3::Bucket<br>    Properties:<br>      BucketName: YOUR-BUCKET-NAME<br>      AccessControl: Private<br><br>  WebsiteBucketPolicy:<br>    Type: AWS::S3::BucketPolicy<br>    Properties:<br>      Bucket: !Ref WebsiteBucket<br>      PolicyDocument:<br>        Statement:<br>          - Action: s3:GetObject<br>            Effect: Allow<br>            Resource: !Sub &#39;arn:aws:s3:::${WebsiteBucket}/*&#39;<br>            Principal:<br>              AWS:<br>                - !Sub &quot;arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ${DistributionOAI.Id}&quot;<br><br>  DistributionOAI:<br>    Type: AWS::CloudFront::CloudFrontOriginAccessIdentity<br>    Properties:<br>      CloudFrontOriginAccessIdentityConfig:<br>        Comment: &#39;OAI for CloudFront access to s3&#39;<br><br>  Distribution:<br>    Type: AWS::CloudFront::Distribution<br>    Properties:<br>      DistributionConfig:<br>        Origins:<br>          - DomainName: !GetAtt WebsiteBucket.RegionalDomainName<br>            Id: &#39;s3-origin&#39;<br>            S3OriginConfig:<br>              OriginAccessIdentity: !Sub &quot;origin-access-identity/cloudfront/${DistributionOAI.Id}&quot;<br>        PriceClass: PriceClass_100<br>        Enabled: true<br>        DefaultCacheBehavior:<br>          TargetOriginId: &#39;s3-origin&#39;<br>          ViewerProtocolPolicy: &#39;redirect-to-https&#39;<br>          FunctionAssociations:<br>            - EventType: viewer-request<br>              FunctionARN: !GetAtt RewriteDefaultIndexRequest.FunctionMetadata.FunctionARN<br>          ForwardedValues:<br>            QueryString: &#39;false&#39;<br>            Cookies:<br>              Forward: all<br><br>  RewriteDefaultIndexRequest:<br>    Type: AWS::CloudFront::Function<br>    Properties:<br>      Name: RewriteDefaultIndexRequest<br>      AutoPublish: true<br>      FunctionCode: |<br>        function handler(event) {<br>          var request = event.request;<br>          var uri = request.uri;<br>          if (uri.endsWith(&#39;/&#39;)) {<br>            request.uri += &#39;index.html&#39;;<br>          }<br>          else if (!uri.includes(&#39;.&#39;)) {<br>            request.uri += &#39;/index.html&#39;;<br>          }<br>          return request;<br>        }<br>      FunctionConfig:<br>        Comment: &#39;Add document indexes to requests&#39;<br>        Runtime: cloudfront-js-1.0</pre><p>Some notes on that infrastructure:</p><p><strong>Distribution pricing</strong>: For the CloudFront Distribution, I opted for the “PriceClass_100” <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html">PriceClass</a>. That’s the cheapest option for the CDN, which caches your site in North America and Europe.</p><p><strong>Serving index.html</strong>: Since this site isn’t hosted on a traditional web server, we have to tell it to serve, say, “/about/index.html” when a user goes to “/about” in their browser. That’s done with the code you see in the “RewriteDefaultIndexRequest” CloudFront Function.</p><p><strong>Bucket privacy</strong>: The site’s s3 bucket is private. Only the CloudFront distribution can read from it, using the “DistributionOAI” origin access identity.</p><h4>Step 3: Build and upload your static website</h4><p>Since this website needs to rebuild and redeploy itself (or parts of itself) every time content changes, that process needs to be repeatable. Tie everything together with a deployment script like this one:</p><pre>#!/bin/bash -e<strong><br><br></strong># Deploy the website infrastructure<br>aws cloudformation deploy \<br>  --template-file static-website.yaml \<br>  --stack-name my-website-prod \<br>  --region us-east-1 \<br>  --no-fail-on-empty-changeset<br><br># Build the static website<br>bin/console -e prod cache:clear<br>bin/console -e prod stenope:build ./static<br><br># Sync the built site to s3<br>aws s3 sync ./static/ s3://YOUR-BUCKET-NAME --delete</pre><p>This uses the <a href="https://aws.amazon.com/cli/">aws cli</a> to deploy the CloudFormation stack for the infrastructure (which I do every deployment because it doesn’t hurt and I believe services should be responsible for their own resources [ok, not always]), then builds a new version of the static website with Stenope, and finally uploads that build to the s3 bucket using <a href="https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html">aws s3 sync</a>.</p><p>If you wanted to go a step further, you could then create a new cache invalidation for the CloudFront distribution to invalidate the cached versions of the newly updated s3 objects.</p><p>This script could be run automatically every time you make a content change, or manually whenever you want to push updates.</p><h3>Ta-da!</h3><p>You now have a fast and secure website, hosted dirt cheap on a platform you don’t have to think about.</p><p>Read on for more considerations.</p><h4>Adding a domain name</h4><p>You may want to use a custom domain name for your site instead of the gobbledygook generated by CloudFront.</p><p>To do that, follow these steps:</p><ol><li>Register your domain in Route53, create an SSL certificate in ACM, and <a href="https://aws.amazon.com/premiumsupport/knowledge-center/route-53-validate-acm-certificates/">validate</a> the certificate for the domain</li><li>Add “Aliases” and “ViewerCertificate” to your distribution’s “DistributionConfig” in the CloudFormation template (see below).</li><li>Follow the steps <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html">here</a> for adding Alias records to your domain’s hosted zone.</li></ol><pre> Distribution:<br>   Properties:<br>     DistributionConfig:<br>+      Aliases: [ <strong>YOUR-DOMAIN.com</strong> ]<br>+      ViewerCertificate:<br>+        AcmCertificateArn: <strong>ARN-OF-YOUR-ACM-CERT-FOR-YOUR-DOMAIN</strong><br>+        MinimumProtocolVersion: TLSv1<br>+        SslSupportMethod: sni-only</pre><p>A .com domain through Route 53 will add $12 annually, plus $0.50 per month for the hosted zone totaling $18 per year.</p><h4>Jamstack</h4><p>There’s nothing preventing you from adding JavaScript to your pages that makes API calls out to various services. In fact, that would be the final part of the <a href="https://jamstack.org/">Jamstack</a> (JavaScript, APIs, Markup) architecture.</p><p>Examples include adding a comments section to your static pages with <a href="https://disqus.com/">Disqus</a>, or showing the day’s forecast using the <a href="https://openweathermap.org/api">OpenWeather API</a>.</p><p>And of course you can write your own API called by your static site, and serve that API on, say, Lambda via API Gateway. At that point the cost savings benefit falls short, but separating static frontend assets (webpages and related files) from your backend (API) is a worthy endeavor nonetheless.</p><h4>SPAs</h4><p>If you want to adopt this strategy to host single-page applications written in React, Vue, or another JS framework, just update the CloudFormation function from Step 2 (“RewriteDefaultIndexRequest”).</p><p>Your update would make all requests that aren’t for a specific resource (like an image) return your application’s entrypoint HTML file instead. Then you can handle routing in your SPA, knowing that anyone who lands on a different route will still get served the application.</p><p>By rethinking your stack a little bit, you may find you have sites that can be statically built and rebuilt when necessary. That can make them faster, cheaper, and more available — pleasing your users, while taking a burden off your wallet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66560f885357" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scalable Batch Jobs on Lambda with Parallelized Producers]]></title>
            <link>https://awstip.com/scalable-batch-jobs-on-lambda-with-parallelized-producers-6fdbf65df29a?source=rss-f70b2cff09b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fdbf65df29a</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Andrew MacRobert]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 22:27:58 GMT</pubDate>
            <atom:updated>2022-06-22T10:45:48.873Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WaK7zN02y4i4d6zyNUEMg.png" /><figcaption>Separating batch jobs into producers and consumers, then parallelizing both, can increase scalability and reduce processing time.</figcaption></figure><p>At <a href="http://mequilibrium.com/">meQuilibrium</a>, a SaaS resilience coaching platform, we decided to move our 10+ microservices from EC2 instances to AWS Lambda. This has worked out great for us, but came with unique challenges.</p><p>Many of these microservices include scheduled workloads for batch-processing large amounts of data. That’s easy enough on an always-on server, but Lambda processes have a maximum 15-minute lifetime. If you don’t complete your processing in 15 minutes, you’re out of luck. This limitation of Lambda turned out to be a blessing because it forced us to implement a scalable and robust solution for our batch jobs.</p><p>The anatomy of batch jobs is generally 2 steps:</p><ol><li>Get a set of data to process (often with a database query)</li><li>Process that data, using each element as the input for some process</li></ol><p>Let’s take a look at the solution’s evolution.</p><h3>Initial solution: Process procedurally</h3><p>As an example, imagine a batch process that bills users who are due for a monthly payment.</p><p>Using a long-running batch process, that might look something like this:</p><pre>// Step 1: get the data <br>users = getUsersWithPaymentDue()</pre><pre>// Step 2: process the data<br>foreach (user in users):<br>    billUser(user)</pre><p>This presents a scalability issue. As your business grows and you accept more paying customers, the time it takes to run increases linearly (O(n)). If it takes 300ms to run billUser(), the most users you can bill in a Lambda’s lifetime are 3,000 — likely less due to overhead.</p><h3>Better solution: Use a queue as a buffer</h3><p>The next logical step is to separate the two steps of a batch job. Step 1 (get the data) and step 2 (process the data) can be separated respectively into a producer and consumer. Using an SQS queue as a trigger, Lambda will scale the consumer automatically as needed. That solution looks like this:</p><p>Step 1: The producer gets all the users due for payment, and publishes an SQS message for each user:</p><pre>// PRODUCER<br>users = getUsersWithPaymentDue()</pre><pre>foreach (user in users):<br>    publishToQueue(user)</pre><p>Step 2: Independently, the consumer reads from the queue and dedicates a single invocation for each user billed.</p><pre>// CONSUMER<br>user = receiveFromQueue()<br>billUser(user)</pre><p>This is a step forward: The producer and consumer are now separate, replacing a bottleneck with a component that’s free to scale horizontally as needed.</p><p>However, it still has a similar issue as before. Publishing to an SQS queue can take about 6ms. In our example, it alleviates a lot of the pressure and allows us to go from processing 3,000 to 150,000 users (minus overhead). But if you are processing more than 150,000 users, your producer will still run into Lambda’s 15-minute time limit while populating your queue.</p><h3>Truly scalable: Parallelize the producer</h3><p>To scale much further, you can parallelize both the producer and the consumer. AWS handles scaling the consumers. At meQuilibrium, we scale the producers using a recursive divide-and-conquer algorithm that uses a Lambda function’s invocation as the algorithm’s iteration. Here’s how that looks for the example:</p><p>First, the producer gets the batch job’s data as before. But instead of publishing one SQS message per user, it arranges the data into payloads each with a maximum size of 256KB (SQS’s maximum message size before resorting to S3 to store messages). Then it publishes each of those payloads to SQS:</p><pre>users = getUsersWithPaymentDue()</pre><pre>while (users.count &gt; 0):<br>    payload = []</pre><pre>    while (sizeInKB(payload) &lt; 256 AND users.count &gt; 0):<br>        payload.push(users.pop())<br>        <br>    publishToQueue(payload)</pre><p>Then, the consumer will be our recursive function. The base case will be when it receives a payload with a manageable number of users to process, which we know it can do well within the 15-minute Lambda time limit. The recursive case will be when the payload contains a larger amount of users, in which case it will divide the payload into two smaller payloads each containing half of the original payload. Then it publishes just two SQS messages (one for each payload) and exits.</p><pre>BASE_CASE = 100<br>users = receiveFromQueue()</pre><pre>// Base case: Process the users<br>if (users.count &lt; BASE_CASE):<br>    foreach (user in users):<br>        billUser(user)</pre><pre>// Recursive case: Split the payload in 2<br>else:<br>    payload1 = firstHalf(users)<br>    payload2 = secondHalf(users)<br>    publishToQueue(payload1)<br>    publishToQueue(payload2)</pre><p>Theoretically, if the data we’re using as our input are 8-byte user IDs, the maximum number of users we could process with this method is <strong>4.8 billion</strong> (minus some due to the producer’s overhead). At that point, we’d be limited by memory, not time. It would also allow us to double the number of users we process while only increasing the execution time by the duration of one base-case Lambda invocation. In actuality it would take longer, since AWS limits Lambda function concurrency and increases that limit minute-by-minute as needed, rather than allocating all available concurrency at once — but it’s close enough to call this algorithm O(log(n)).</p><h3>In practice</h3><p>Here are a few additional considerations for implementation we’ve encountered at meQuilibrium:</p><h4>Developer experience</h4><p>To ease development, we wrote an abstract “Parallel SQS Handler” class that can implement this algorithm for any type of data set (not just user IDs) and handle the chunking of batch job data into 256KB payloads. Any developer can extend this class for a new type of batch job and implement a handler for processing, with no need to understand the underlying algorithm.</p><h4>Database loads</h4><p>This architecture can easily move bottlenecks from your application code to your database (or other resources shared by parallel consumers). It is important to make sure whatever underlying resources are used by your consumers are ready to scale. For databases, utilize connection pooling and read replicas.</p><p>Additionally, you can protect your resources by setting an upper limit for your consumer’s concurrency. On Lambda, do this by setting the function’s reserved concurrency.</p><h4>Monitoring progress</h4><p>One downfall to moving from procedural batch processing to parallel processing is that you lose some visibility — no longer can you tell how far a batch job is simply by looking at, say, a progress bar in its output.</p><p>If this visibility is important to you, solve it like so:</p><ol><li>When your producer gets its data, write the number of records somewhere (such as a redis cache or database).</li><li>When your consumer processes a record, increase a counter somewhere.</li><li>In a UI, show the progress calculated from the above two numbers.</li></ol><p>At meQuilibrium, we saw producer parallelization reduce batch job processing times from hours to minutes (or less). It allowed us to move our microservices to Lambda without relying on external long-running processes, and simultaneously remove bottlenecks, process jobs faster, and improve scalability.</p><p>Interested in working on the forefront of digital wellbeing? Check out our <a href="https://www.mequilibrium.com/about/careers/">jobs page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fdbf65df29a" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/scalable-batch-jobs-on-lambda-with-parallelized-producers-6fdbf65df29a">Scalable Batch Jobs on Lambda with Parallelized Producers</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>