<?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 Peyton Casper on Medium]]></title>
        <description><![CDATA[Stories by Peyton Casper on Medium]]></description>
        <link>https://medium.com/@peytoncasper?source=rss-74eb46e29419------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*MRdFWhBZEl5cz2Zz3RvdLg.jpeg</url>
            <title>Stories by Peyton Casper on Medium</title>
            <link>https://medium.com/@peytoncasper?source=rss-74eb46e29419------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 18:14:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@peytoncasper/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[Terraform Cloud Onboarding]]></title>
            <link>https://medium.com/@peytoncasper/terraform-cloud-onboarding-76236df28b6f?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/76236df28b6f</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-cloud]]></category>
            <category><![CDATA[sentinel]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Thu, 12 May 2022 14:49:45 GMT</pubDate>
            <atom:updated>2022-05-12T14:49:45.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVN0pwhu0hMVz4QvCJb4oQ.png" /></figure><h3>Introduction</h3><p>I think its safe to say at this point that Infrastructure as Code in its many forms has proven itself to be an invaluable form of deploying infrastructure. Terraform, Ansible, Kubernetes/Helm, and other tools like it have single handedly changed the way that vendors of all shapes and sizes expose their software to the world. Show me a product that doesn’t already provide or isn’t exposing their configuration via an API, and I’ll show you a company fading into obscurity.</p><h3>The Cloud</h3><p>Despite the unending catalog of AWS services or the infinite complexity of IAM, the cloud providers that are alive today absolutely nailed two things.</p><ol><li>Onboarding new users</li><li>Providing an API first approach for configuring their platform</li></ol><p>Any time a thread comes up about a huge AWS bill, I look for my favorite comment.</p><blockquote>You could have saved X% by running this on bare metal</blockquote><p>I’d love to have a conversation with this person in real life, because I suspect they either work for Cisco, manage the ServiceNow infrastructure at work or consult for IBM.</p><h3>We Took a Human and Put a Queue in Front</h3><p>Ticketing systems, probably a product of their time, are the alternative approach to the experience above.</p><p>Instead of investing in automated API interactions, we built massive, customizable task queues that hands out tasks to the next available human. In a surprise to someone, the queue got long.</p><p>Instead of removing roadblocks to getting applications into production, we decided to inject as many approval chains as possible in the process. If Bob, Melissa, Jessica, Jack, Joe, and the omnipresent Architecture Review Board approve, well then clearly it’s well thought out.</p><h3>Onboarding</h3><p>Onboarding in my mind is the process of getting a user from zero to productive. The efficiency of your onboarding process is how quickly you can do it. While enterprise after enterprise are tripping over themselves to get to the cloud, a lot of them are trying to bring the same ineffective onboarding process with them.</p><p>Security teams believe that only they can traverse the vast depths of IAM policies and return unscathed, CCOE teams become the very ticket queues they wanted to replace and Cloud Wars: Return of the Architectural Review Board releases in a conference room near you.</p><h3>It’s Hard. Like Really Hard.</h3><p>Finding that optimal intersection between centralized teams and self service workflows is really challenging. What I’ve found time and time again, is that you have to be maniacal about thinking of your team as providing a product, not a service.</p><p>When you provide a product, the cost to solve a problem for one customer is the same as solving it for hundreds. When you provide a service, you solve the same problem hundreds of times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*SxNzzHEzt1qlpXTSV_-4vQ.png" /></figure><h3>Terraform Cloud (TFC)</h3><p>Terraform Cloud provides a platform, API and governance framework around Terraform. This includes standard capabilities like SSO and RBAC while also including Terraform specific capabilities like a private module registry and a policy-as-code engine. Despite the ability for Terraform to provide a framework for offering infrastructure as a product, I don’t see much conversation about how to provide Terraform itself as a product to an organization.</p><p>How do you balance the maintenance of operations with the needs of development and the requirements of security?</p><h3>The Maintenance of Operations</h3><p>The amazing thing about Terraform is that we can Terraform, Terraform Cloud. This allows us to codify the configuration of TFC and an important component of this post is the modularization of Terraform code for reusability. Providing a product that can be reused, ideally with only a little customization by the end user is critical to finding a happy medium between maintenance and user growth.</p><p>In the model below, a centralized team still approves an initial pull request from the team, but makes an effort to decouple themselves as much as possible. This is an example <a href="https://github.com/peytoncasper/tfc-onboarding/blob/main/root-workspace/main.tf">Terraform module</a> that leverages the TFE Provider and GitHub provider to create the following resources while <a href="https://github.com/peytoncasper/tfc-onboarding/blob/main/root-workspace/main.tf">minimizing the amount of input</a> needed by the team that is onboarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kgwFMlGkQUrgXpXlBRlSRA.png" /></figure><ol><li>A Terraform Cloud Team (Role) is created that matches the the onboarding teams SSO group</li><li>A Github repository is created that is owned by the onboarding team and allows them to add additional Terraform Cloud configuration</li><li>A workspace is created that is bound to the Github Repository</li><li>The team is granted write permissions to their workspace</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*jCvSqD_pTNkAyHiKDAIIZw.gif" /></figure><h3>The Needs of the Developer</h3><p>Now that a team has their own workspace within TFC, they are now provided a place to onboard their own applications and infrastructure without direct involvement with the TFC operations team. There is also a massive parallel between the configuration of a team workspace and an application workspace. This example <a href="https://github.com/peytoncasper/tfc-onboarding/blob/main/team-workspace/app_workspace_module/main.tf">Terraform module</a> provides all of the same resources with one minor change.</p><p>The permissions to access an application workspace derive themselves from the <em>team_owner </em>variable which is injected during the deployment of the team workspace. As a result, we can essentially codify an inheritance model, in which application workspaces are only visible to members of the team or SSO group that created them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*sALin94TWupwlLKpduuLqA.gif" /></figure><h3>The Requirements of Security</h3><p>The challenge with tools like Terraform, is that they typically have massive privilege boundaries. I have yet to find a good solution for giving Terraform least privileged IAM permissions, because the list of privileges can change any time someone wants to deploy a new resource. As a result, Terraform is usually given a permission equivalent to root for whatever API it is configuring.</p><p>This leads us to two rules.</p><ol><li>The credentials that Terraform uses should ideally be ephemeral and should never be accessible by anyone other than the pipeline that executes Terraform</li><li>A pipeline is not a development environment. You need to provide a development environment that is isolated for local development of Terraform code. Yes, this means that someone will have cloud credentials on their laptop.</li></ol><p>When we delegate permissions to a pipeline, this makes production environments more secure and allow us to transition to a git based approach. In our example above, this means that no individual TFC user except the owners of TFC and a pipeline have the ability to create, update or delete workspaces. Instead a user is required to codify what they want and submit a pull request which among many things also creates an audit log.</p><p>At this point you’re probably asking how we ensure that a user can’t simply grant themselves owner level permissions or delete the workspaces of another team.</p><p>The answer to that is by leveraging a Policy-as-Code engine such as Sentinel or OPA. Sentinel gives us the ability to not only inspect the Terraform code that is written before it runs, but also validate the source of the code we are about to execute. If we combine this with our modules above, we can effectively create <a href="https://github.com/peytoncasper/tfc-onboarding/tree/main/sentinel">three policies</a> that enforce the following requirements.</p><ol><li>Resources that are created in our root and team workspaces can only be created via a module</li><li>We only allow an agreed upon list of modules and ensure that those modules come from a trusted repository such as TFC’s private module registry</li><li>Once a team workspace has been created, no one is allowed to modify the <em>team_owner </em>variable without requiring additional approval</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*XfpAB0YVZrbwcKEPbCwzqg.gif" /></figure><p>To violate one of these policies, a user would either have to be able to override the policy themselves or impersonate a user with higher privilege. By leveraging IaC to drive our configuration, we drastically reduce the number of people who have direct access to configure TFC which also reduces our attack surface.</p><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d30CPboTMDoxNlrKuohtQQ.gif" /></figure><p>If we put everything together, we’re left with the workflow depicted above. The team that manages Terraform Cloud is able to focus their effort on defining modules and policies that put necessary guardrails in place without having to insert themselves into every team’s workflow. At the same time, application teams are provided with a self service workflow that allows them to focus on getting their infrastructure deployed.</p><p>If I can leave you with one thing, focus on providing a reusable product not a hands on service.</p><p><a href="https://github.com/peytoncasper/tfc-onboarding">GitHub - peytoncasper/tfc-onboarding</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76236df28b6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Excelize with Go]]></title>
            <link>https://medium.com/codex/exploring-excelize-with-go-88ce3712a5?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/88ce3712a5</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[report]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 13:43:25 GMT</pubDate>
            <atom:updated>2021-11-24T13:43:25.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMoxUccC0Zny4KErj2NgrQ.png" /></figure><p>Formulas, pivot tables, and plugins all provide ways of transforming or manipulating your data once it’s in a CSV or XLSX format. But, what if you are interested in continuously loading data into a shared report that other team members can more easily leverage in Excel or Google Sheets?</p><p>Excelize is a Go library for generating Excel-compatible spreadsheets with support for embedding formulas, styles, charts, and more. I’ve recently been working on an automation project where I have leveraged Go and Excelize to catalog a directory structure and turn that information into an auto-updating spreadsheet.</p><p>It’s been an exciting experience leveraging Go for this type of lightweight “ETL-ish” type of workload, and I wanted to share some of the insights I picked up while working with Excelize.</p><h3>Style Definition</h3><p>Unsurprisingly, Excel has a style system embedded into a spreadsheet when you change a cell’s background, text, or border attributes. It took me a bit longer than I would like to admit to understand how Excelize handles styles. Specifically, a lot of the documentation examples provide a style object as a JSON string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMpPUt5ibVzu-wuN1dfJIg.png" /></figure><p>This isn’t how you would want to structure your styles as you lose all type checking and have to handle escape characters and JSON formatting manually. It turns out that the NewStyle function supports an interface{} parameter, and when you pull back the covers, this function simply unmarshals your string into a Style object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*UN2EoppKdD6J7_pkIqj_4w.png" /></figure><p>If we take this one step further with the example above, you can define the Style struct inline. Now you don’t have to worry about writing JSON by hand or messing up the types on individual attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*D-1DIQnyzAjz9VEduVxC5Q.png" /></figure><p>A final note on styles, some attributes such as the Border are typed to accept a slice of strings. If you’re like me, this makes it seem like you can have any number of border style definitions which doesn’t make sense.</p><p>It turns out, that similar to CSS, the expectation is to define four Border structs for the four sides of a cell (top, left, right, bottom). In the example on the left, you’ll notice that you designate each side by setting a Type attribute.</p><p>It seems like an interesting choice to leverage a slice over a map for this data structure but might have some hidden benefits under the hood. If you have any thoughts on this, I’d love to hear about it in the comments.</p><h3>Style Indexing</h3><p>Excelize builds an index of styles that get embedded in the spreadsheet; unfortunately, it only exposes that index via an incremental id. I’m assuming this is how Excel handles tracking this information internally, but I found this a bit error-prone as I added more styles. I opted to build a centralized index of these styles by registering them upfront and then leveraged a map[string]int to attach a name to a style’s internal ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*eymh1BgddUAXN2PWMjBSMg.png" /></figure><p>This lets me inject the style index into various functions and retrieve a style by its name. I also wrote wrapper methods on the StyleIndex struct to provide better autocomplete and abstract away the underlying key if I need to change it in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*Ni1KGPHcPPIU6d_39FrxEg.png" /></figure><h3>Cell Configuration</h3><p>Excelize provides functions for setting a cell’s attribute individually but lacks higher-level functions that group together standard configurations. This was probably the right call for the library as a whole but led to a lot of duplicate code to perform the same set of actions each time. I wrote a few helper functions like the example below in which I grouped merging multiple cells and setting styles and values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LeKKSJ-WB8Yng1tAflD1UA.png" /></figure><p>You should also notice the StyleIndex struct that is being injected into the function. I went back and forth on whether to pass around the index or pass in a style ID from one layer up. I’m not sure which option I prefer more, as each has its own tradeoffs regarding reusability.</p><ul><li>Having each call to a function specify its own style ID makes it more generic and reusable.</li><li>Defining a separate function for each style means the end-user doesn’t need to have as much knowledge of the underlying styles used.</li></ul><p>Do you have some thoughts on this tradeoff? Maybe, you’ve run into this problem in another styling system.</p><h3>Generating Cell and Row Offsets as you iterate through data</h3><p>At some point, you’re going to need to programmatically determine which row and column you need to write a piece of data in. Below is an example of how I accomplished this by leveraging the ColumnNumberToName function and an offset value. This allowed me to calculate the column position for multiple pieces of data without doing any ASCII calculations to calculate what comes after column AX1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rahGfx1Vp8Mv-mzMdwyO3g.png" /></figure><h3>Conclusion</h3><p>I’ve enjoyed leveraging Excelize to automate the generation of spreadsheets with rich content embedded. It very much feels like a lower-level API on top of the Excel file format, and that means you’ll have to spend some time creating higher-level functions for yourself. Have you leveraged Excelize before or perhaps another excel library in a different language?</p><p>Drop a comment below or reach out to me on <a href="https://twitter.com/peytoncasper">Twitter</a>; I would love to continue the conversation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88ce3712a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/exploring-excelize-with-go-88ce3712a5">Exploring Excelize with Go</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps: Days 5 and 6]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-days-5-and-6-2e019c82452?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e019c82452</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 14:15:40 GMT</pubDate>
            <atom:updated>2021-08-15T14:15:40.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*vVMquwCG6RgaaJLrglQ8NQ.png" /></figure><p>On Monday, August 9th I started a challenge for myself to bootstrap a business from the group up during my 7 day vacation. This post documents what I learned and the challenges that I faced on day 5 and 6. The start of my journey with the Remarkable Sidekick is <a href="https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa">here</a>.</p><h3>My Lesson</h3><p>There is a lot of hidden work in the error handling and the non-happy paths.</p><p>The adage of focusing on the smallest set of features as possible starts to make a clearer picture. The feature is the relatively easy part, but providing a solid experience around it means handling all the scenarios in which it doesn’t work correctly.</p><h3>Auth0</h3><p>While the GCP API Gateway supports authentication, it hooks into an external identity provider like Okta or Auth0. This sent me down the path of exploring Auth0 which I’ve been wanting to use for a while. The experience has been great, so far as they provide a ton of out of the box examples and code.</p><p>However, given that I’m planning to use it the basis for account management, I spent a bit more time understanding exactly how it integrates into the broader platform. As a result, I move back to focusing on wrapping up the free features and ensuring that I can package up the application.</p><h3>Thumbnails</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hNj3eRBVktko4-eoJRyhVw.png" /></figure><p>I utilize the NodeJS Sharp library to create thumbnails for each image based on the aspect ratio (4:3) of the Remarkable 2. This allowed me to fix the sizing issue with the image tags. There were some issues leveraging this library as they don’t currently provide an Arm64 version of the library so I had to ensure the proper dependencies where in place for NPM to compile it during the install.</p><h3>Bundling</h3><p>This is where my current focus is at, and where I’ve been having the most trouble recently. Between Webpack, React, and Electron there are a lot of components to this build process. Couple that with a surprising lack of documentation around electron-build I am struggling to get a publishable binary.</p><p>If you have any experience leveraging Webpack with Electron, I would love to chat.</p><h3>Edge Cases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKIW-YVq-nVxHgLFHlwSfg.png" /></figure><p>The last major update was around the Home Screen. As you can see, I spent some time building out a better looking disconnected screen along with providing guidance on how to connect a Remarkable. The good part, is that this will also form a basis for the new user onboarding process.</p><p>To make this work properly, I had to handle errors from the NodeSSH library and configure connection timeouts. This allowed me to make the connection process more responsive and detect that status of the connection in the background.</p><h3>Conclusion</h3><p>Overall, I’ve made good progress on the offline features, and slightly stalled out around the account management. Hopefully, I can finalize the bundling process today and finish reviewing the Mac and Windows App Store submission process.</p><p><a href="https://remarkablesidekick.com/">Remarkable Sidekick</a> | <a href="https://twitter.com/peytoncasper">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e019c82452" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps: Day 4]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-day-4-75a93f0dfceb?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a93f0dfceb</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Fri, 13 Aug 2021 12:06:45 GMT</pubDate>
            <atom:updated>2021-08-13T12:09:10.342Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_B9SzrHmaCeZFeAvlsFd6w.png" /></figure><p>On Monday, August 9th I started a challenge for myself to bootstrap a business from the group up during my 7 day vacation. This post documents what I learned and the challenges that I faced on day 4. The start of my journey with the Remarkable Sidekick is <a href="https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa">here</a>.</p><h3>Lesson of The Day</h3><p>Move on quickly, when you hit a roadblock.</p><p>I ran into an issue when trying to pass images from the front-end to the back-end components of the Remarkable Sidekick. Unfortunately, the IPC interaction works great in an asynchronous mode, but gets a little bit clunky when expecting a response back in a synchronous fashion.</p><p>I ended up spending a few hours trying a few different approaches, but ultimately moved on. After returning later, I ended up with a satisfactory approach by centralizing the error handling. Such that no individual request will handle their own errors, rather error notifications will be emitted by the IPCConsumer process.</p><p>Moving onto other problems, and returning later a bit sooner likely would have saved me some time in the long run.</p><h3>Early Morning</h3><p>I spent most of the morning working on implementing the ability to add images locally. This involved base64 encoding the images, passing them to the Electron back-end via IPC and then persisting them to a local directory. In addition to that, I implemented a simple scan of that images directory so that the Remarkable Sidekick is able to populate a 4x4 image grid showcasing the available images that can be set as the lockscreen image.</p><p>I still have an open item to define the image height and widths based on the 4:3 aspect ratio of the Remarkable. I played around with this a little, but I think I’m going to have to resize the images to a fixed size, as setting the width and height dynamically isn’t providing to best UX.</p><h3>Afternoon</h3><p>The afternoon was focused on implementing the first serverless function to handle uploading images to a centralized GCS bucket. In addition to that, I started exploring GCP’s API gateway as it offers a few amazing capabilities out of the box. Specifically, it provides authentication, rate limiting, routing and the ability to natively integrate with GCP Cloud functions.</p><p>As someone who has worked built out at least two reverse-proxy API gateways, these features can not only be tedious to build, but also challenging to get right. I’ve been wanting to try out one of the managed API Gateways, so this has turned out to be a perfect chance.</p><p>I have not seen this <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md">Open API</a> format before, but its a pretty interesting way to define the relative API paths and metadata. Standards can be nice, especially for providing cross platform compatibility, and it does look like AWS and Azure support the same configuration approach based on Open API.</p><pre>swagger: &#39;2.0&#39;<br>info:<br>  title: API_ID optional-string<br>  description: Remarkable API with Cloud Functions backend<br>  version: 0.0.1<br>schemes:<br>  - https<br>produces:<br>  - application/json<br>paths:<br>  /image/upload:<br>    post:<br>      summary: Allows a user to upload a lockscreen image<br>      operationId: hello<br>      x-google-backend:<br>        address: https://us-east1-remarkable-sidekick.cloudfunctions.net/upload-image<br>      responses:<br>        &#39;200&#39;:<br>          description: A successful response<br>          schema:<br>            type: string</pre><h3>Progress</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*cVlOB08Yi9s1VppxbzDm4w.png" /></figure><h3>Conclusion</h3><p>We’re starting to get into the home stretch and I’ll admit that I still have a decent amount of work to do. That being said, I’m almost finish with the initial set of offline features. This should allow me to start identifying the process for submitting this application to both the Mac App Store and the Windows App Store.</p><p>I also still have a decent amount of work to do on the API side of things, namely around creating accounts and handling payment information via Stripe.</p><p><a href="https://remarkablesidekick.com/">Remarkable Sidekick</a> | <a href="https://twitter.com/peytoncasper">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a93f0dfceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps: Day 3]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-day-3-a6b935863333?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6b935863333</guid>
            <category><![CDATA[indiehackers]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Thu, 12 Aug 2021 11:53:48 GMT</pubDate>
            <atom:updated>2021-08-12T11:53:48.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eHnwM8WzDAjynT6HqMymyg.png" /></figure><p>On Monday, August 9th I started a challenge for myself to bootstrap a business from the group up during my 7 day vacation. This post documents what I learned and the challenges that I faced on day 3. The start of my journey with the Remarkable Sidekick is <a href="https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa">here</a>.</p><h3>Lesson of the Day</h3><p>I learned about an interesting quirk with Electron where the backend has to communicate to the front-end via the BrowserWindow. This is in contrast to how the front-end is able to utilize an importable ipcRenderer object which can be pre-loaded.</p><p>This leads to an interesting issue in which the window has to either be injected into the objects that need to communicate or it has to be persisted as a global object. I’m not a terribly large fan of this design choice as the ipcRenderer method clearly provides the most flexibility. I’m not sure if this is due to an early design decision, but I’m hoping to do some research into this in the coming days, and understand why this choice was made.</p><h3>Early Morning</h3><p>I got off to a quick start by adding support for establishing the SSH connection between the Remarkable and the Remarkable Sidekick. This was a building block for the next major milestone which was dynamically pulling the current lockscreen PNG at startup. In the screenshot above, the Remarkable Model on screen is actually fully dynamic. This work also laid the groundwork for uploading new lockscreen images which will be the primary focus for tomorrow.</p><h3>Mid Day</h3><p>Towards the middle of the day, I began working on pulling storage stats from the Remarkable. This was a rather interesting task, as I essentially needed to run df using the SSH connection and then parse the stdout output that is returned.</p><p>This resulted in a pretty fun block of code that I am decently proud of. Essentially, we break each line out by newlines, split those lines by spaces and then filter out pure spaces from our result. Once we had our array of arrays that represents the content on each line, I was able to iterate through the each line and pull the used and available space for each path on the device.</p><p>After that was done, all that was left was to hook this data up via IPC and send it to the frontend.</p><pre><em>const </em>output = result.split(&#39;\n&#39;).map((line) =&gt; {<br>    <em>return </em>line.split(&quot; &quot;).filter((word) =&gt; {<br>        <em>if</em>(word != &#39; &#39;)<br>            <em>return </em>word<br>    })<br>})<br><br><em>let </em>paths: <em>Path</em>[] = []<br><br><em>let </em>usedSpace = 0<br><em>let </em>availableSpace = 0<br><br><em>for </em>(<em>let </em>i = 1; i &lt; output.length; i++) {<br>    <em>const </em>o = output[i]<br>    <em>const </em>pathUsed = <em>parseFloat</em>(o[2])<br>    <em>const </em>pathAvailable = <em>parseFloat</em>(o[3])<br><br>    usedSpace += pathUsed<br>    availableSpace += pathAvailable<br><br>    paths.push({<br>        used:       pathUsed,<br>        available:  pathAvailable,<br>        path:       o[5],<br><br>    })<br>}</pre><h3>Afternoon</h3><p>Once I had all of the storage data available in the frontend, I was able to quickly wire this up to a progress bar and show the available amount of space left on the device.</p><p>To wrap up the day, I was able to get the navigation in place for the Local and Gallery lockscreen management screen. This was an exciting milestone as tomorrow I should be finished with all of the offline capabilities of the MVP. Ideally, I’ll be able to get a head start on designing account management and the Gallery feature which will allow users to shared black and white lockscreen images as paying customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*aDTHMrHBpU-8Z09NsVn0Xg.png" /></figure><h3>Progress</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*l1pdFmJDUIuZ9MMEevCJvA.png" /></figure><h3>Wrap Up</h3><p>Overall, the day went by rather quick, but the pace at which I was able to add new features was much faster than Monday and Tuesday. This was a good sign that signals the framework that was put into place is starting to payoff. Here is to getting the first paying feature working tomorrow!</p><p><a href="https://remarkablesidekick.com/">Remarkable Sidekick</a> | <a href="https://twitter.com/peytoncasper">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6b935863333" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps: Day 2]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-day-2-78efd7f7022a?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/78efd7f7022a</guid>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[remarkable]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Wed, 11 Aug 2021 11:42:36 GMT</pubDate>
            <atom:updated>2021-08-11T11:42:36.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*q3d9eKP8SRpVXNKpahdkxA.png" /></figure><p>On Monday, August 9th I started a challenge for myself to bootstrap a business from the group up during my 7 day vacation. I’ll be documenting what I learned and the challenges that I faced on day 2. The start of my journey with the Remarkable Sidekick is <a href="https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa">here</a>.</p><h3>Lesson of the Day</h3><p>Today was filled with a ton of technical work. The largest learning I made today was around how Electron works compared to a typical React application. I was running into a really odd issue on Monday where Event Listeners and components were not unmounting correctly. If bump into this post at a later date with the error message below.</p><pre>Warning: Can&#39;t perform a React state update on an unmounted component.</pre><p>You’re likely adding your loading your React application twice. Typically, a React app requires the bundled JS file to be loaded via a script tag inside of your index.html file. Electron handles this for you automatically and by also including it manually, it causes multiple instances of components to exist and affects how event listeners and mount/unmount actions work.</p><h3>Early Morning</h3><p>I spent most of the morning working on understanding how IPC communication works between the NodeJS backend and Javascript based frontend. This is a rather interesting aspect of Electron, in that it contains both a server backend and client-side front-end compiled into a single binary. Where as traditionally, you would leverage a library like axios to communicate with a backend that hosts your client-side JS, Electron actually has a messaging library built in.</p><p>However, there are some additional factors around security to keep in mind. When you’re just getting started, you’re likely to run across examples in which ipcRenderer is imported directly into your front-end application. The problem is that this requires nodeIntegration to be set to true which opens up a security vulnerability, because any NodeJS library can be called via any front-end code.</p><p>To resolve this security hole, Electron utilizes a preload.js file which essentially compiles down these NodeJS functions and attaches them to the window context in the browser.</p><h4>Mid Day</h4><p>After building out a skeleton for communication back and forth, I moved onto loading and saving settings for the application. Each OS obviously has a different preferred location for storing local files, and Electron provides a nice helper function for grabbing this directory that is generic to the underlying OS.</p><pre>const userDataPath = electron.app.getPath(&#39;userData&#39;);</pre><p>Once I created simple functions for loading and saving a JSON file from disk, I was then able to wrap up this interaction into a settings module.</p><h4>Typescript Side Note</h4><p>Typescript’s ability to not only create a union of types but also create new types on the fly is incredibly powerful. In the example below, I get extremely granular type checking on the what type of value a string will support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*uZ9SxP5H3o66BVVL_6ffUQ.png" /></figure><h3>Afternoon</h3><p>Towards the end of the day, I shifted my focus towards combining the previous concepts together. This involved adding two new message types get_settings and save_settings which allow me to pass settings objects back and forth between the front-end and back-end components.</p><p>I now have access to persistent connection settings and allowed me to build out the UI screenshot that is shown below. This also sets me up nicely to get a running start on the NodeSSH integration which will allow me to start pulling information about the device such as the current lock screen, used disk space and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uZ5B29H-fMNo-SQBrXCWiw.png" /></figure><h3>Progress</h3><p>It was a heads down day, with some additional skeleton building that I had to do around page navigation and IPC communication. That being said, I’m in a great position to get lockscreen management in place by the end of the day.</p><p><a href="https://remarkablesidekick.com/">RemarkableSidekick</a> | <a href="https://twitter.com/peytoncasper">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78efd7f7022a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps: Day 1]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-day-1-59986beee51c?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/59986beee51c</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[bootstrapping]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[business]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 12:31:09 GMT</pubDate>
            <atom:updated>2021-08-10T12:31:09.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-OcqLGNSFPsLBbhLOpsSg.png" /></figure><p>On Monday, August 9th I started a challenge for myself to bootstrap a business during my 7 day vacation. The reasons why and more details on the Remarkable Sidekick can be found <a href="https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa">here</a>.</p><h3>Lesson of the Day</h3><p>I refactored too early… The developer says with a grimace on their face.</p><p>While helpful for development, I lost a decent amount of time towards the end of the day.</p><h3>Early Morning</h3><h4>Skeletons</h4><p>I accomplished my goal for the morning which was to get a barebones skeleton in place leveraging Tailwind assets. This proved to be pretty straightforward and using Tailwind CSS brought me back to the days of Bootstrap components.</p><p>There is something rather powerful in having a massive library of CSS classes to quickly iterate on style ideas. That is without even getting into the catalog of UI examples to pull from. Overall, my experience with <a href="https://tailwindui.com/">Tailwind UI</a> has been good. Does it beat having a team of designers building out a custom UI library? Not at all, but for rapid prototyping its worked great.</p><h4>MailChimp</h4><p>Alright, so technically this came up on Sunday when I was putting together the Marketing site, but I thought this was rather interesting. The CAN-SPAM Act in the US is what requires all email subscriptions to come with an unsubscribe link and forces a company to provide a reachable physical address.</p><p>As a consumer, this is pretty awesome. As a solo-dev, the last part kind of sucks.</p><h4>The Logo</h4><p>I got the logo towards the end of the morning, overall not bad for $30 and a rush job on Fiverr. Linking to the <a href="https://www.fiverr.com/artrends/design-unique-modern-minimalist-logo-design?context_referrer=user_page&amp;ref_ctx_id=67e3f0d31c3937f88c3ebf43212e9b72&amp;pckg_id=1&amp;pos=1">seller</a> as they did a pretty good job on short notice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yx0zBIGgUp0jUQr6OnacJw.jpeg" /></figure><h3>Mid Day</h3><h4>FontAwesome + Styled Components + Tailwind</h4><p>I started out my afternoon by integrating FontAwesome into the project so that I would have access to a library of Glyphicons. I initially started out by inlining the icon tags with the appropriate classNames but I settled on a pretty nice abstraction that I picked up from the Tailwind library.</p><p>The snippet below wraps a simple Icon styled-component in a React FunctionComponent and uses a simple utility function that merges passed in classNames with the appropriate FontAwesome className. This provides a composable Icon component and isolates the integration with FontAwesome to one place.</p><pre><em>function </em>fontAwesomeLookup(name: <em>string</em>): <em>string </em>{<br>    <em>switch</em>(name) {<br>        <em>case </em>&quot;home&quot;:<br>            <em>return </em>&quot;fa-home&quot;<br>        <em>case </em>&quot;search&quot;:<br>            <em>return </em>&quot;fa-search&quot;<br>        <em>case </em>&quot;exchange&quot;:<br>            <em>return </em>&quot;fa-exchange&quot;<br>        <em>case </em>&quot;random&quot;:<br>            <em>return </em>&quot;fa-random&quot;<br>        <em>default</em>:<br>            <em>return </em>&quot;fa-home&quot;<br>    }<br>}</pre><pre><em>export const SolidIcon </em>: <em>React</em>.<em>FunctionComponent</em>&lt;<em>IconComponentProps</em>&gt; = (props) =&gt; {<br>    <em>let </em>className = <em>mergeClassNames</em>(&quot;fas&quot;, fontAwesomeLookup(props.name))<br><br>    <em>if </em>(props.className) {<br>        className = <em>mergeClassNames</em>(props.className, className)<br>    }<br><br>    <em>return </em>(<br>        &lt;Icon <em>className</em>={className} <em>fontSize</em>={props.fontSize}/&gt;<br>    )<br>}</pre><h4>Interact-able Remarkable Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sK1yeL-mlSb2qZWrfo7Kag.png" /></figure><p>Towards the later part of the day, I started on the interaction model for uploading a local lock screen image. This took a little longer than expected due to some issues with the way that Electron handles onMouseOver events and my initial attempt at just leveraging CSS.</p><p>I’m still running into a memory leak error, despite removing the event listeners during the unmount. So if you have any ideas, I would love to hear them. The error is below, and you can find the relevant code <a href="https://github.com/peytoncasper/remarkable-sidekick/blob/main/electron/src/renderer/components/RemarkableModel/index.tsx#L54">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*pezGYqMEvhyfMeG-h6yHjA.png" /></figure><h4>The Dreaded Refactor</h4><p>At some point in the afternoon, I stumbled upon electron-webpack and thought it would be the answer to all my ailments around the lack of hot reloading. At the time, I was testing everything in a Chrome browser and then bundling it up before I started the Electron app.</p><p>Electron Webpack introduced me to the proper project structure for Electron apps, namely the renderer and main folders. After I made those initial changes, I got sent down a rabbit hole trying to get React, Electron, Typescript and Webpack to play nicely with each other.</p><p>After a couple of hours wasted, I finally stumbled upon a decent <a href="https://github.com/Devtography/electron-react-typescript-webpack-boilerplate">boilerplate</a> setup that I finished migrating to towards the end of the day.</p><h3>Progress</h3><p>Overall, it was a rather productive day, with the bulk of the gruntwork taken care of today. I’m hoping to crank out my first offline features tomorrow and ideally have a downloadable copy of the Remarkable Sidekick to start playing around with outside of the IDE.</p><p>Heres to hoping I don’t get sidetracked by another refactor. 😄</p><p><a href="https://remarkablesidekick.com/">RemarkableSidekick</a> | <a href="https://twitter.com/peytoncasper">Twitter</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*BZSRYzNf-5eSdbDB_6BNtg.png" /></figure><p><a href="https://github.com/peytoncasper/remarkable-sidekick">GitHub - peytoncasper/remarkable-sidekick</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59986beee51c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Days of Bootstraps]]></title>
            <link>https://medium.com/@peytoncasper/7-days-of-bootstraps-f85f691c3fa?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/f85f691c3fa</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Mon, 09 Aug 2021 12:02:20 GMT</pubDate>
            <atom:updated>2021-08-09T12:02:20.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uy0wdjg01B0v5ubAzsc1HA.png" /></figure><p>On Monday, August 9th, I start a weeklong vacation! But, this is not going to be a typical vacation. I will spend the next seven days building an application called the Remarkable Sidekick, bootstrapping a small business around it, and chronicling the journey.</p><h3>Why</h3><p>It is odd to me, having grown up utilizing incredible devices that allow us to create infinite possibilities, which require of us the confidence to explore every possibility. That I struggle to have confidence in things that I create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*xoCKGnqLkM9_akY9Bjdqhw.png" /></figure><p><a href="https://www.youtube.com/watch?v=8-JXOnFOXQk">Brené Brown’s</a> <a href="https://www.youtube.com/watch?v=iCvmsMzlF7o">incredible</a> <a href="https://www.youtube.com/watch?v=psN1DORYYV0">talks</a> introduced me to the “Man in the Arena” speech from Theodore Roosevelt. If you haven’t seen her talks or read this quote before, I urge you to take a moment.</p><p>I admire people who create in public, whether it’s 100 days of code, 12 products in 12 months, open-source maintainers, writers, speakers, researchers, or anyone else who takes the time to showcase what they do and open themselves up to the critic. It is certainly not an easy path, and it’s a trait/skill/belief that I want to improve in myself.</p><p>I’ve recently been reading Zero to Sold by <a href="https://twitter.com/arvidkahl">Arvid Kahl</a>, Doing Content Right by <a href="https://twitter.com/stephsmithio">Steph Smith</a>, and learning how to write better from <a href="https://twitter.com/david_perell">David Perell</a>. I want to put these ideas to practice by bootstrapping a small business over seven days and consistently writing about the process every day.</p><h3>The What</h3><p>I purchased the Remarkable 2 around 7 months ago, and it was largely driven by a wish to be able to read longer-form writing like academic papers and technical PDFs on a larger E-ink screen. I’ve since started using it to take notes, draw small diagrams and perform the bulk of my reading.</p><p>Overall, the experience has been great, but I wish it had a few additional capabilities, which form the basis for this project. So I figured, let’s build something, do it in public, see what happens and learn a lot along the way.</p><h3>The Audience</h3><p>It&#39;s probably obvious, that this is a small audience. Not only are we talking about E-readers, but 10.3&quot; E-Ink tablets at that. But honestly, it might be just the right size for a 7 day challenge.</p><p>Let’s take a look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81R9HzSl6HnhAOqi4b7qFA.png" /><figcaption>Google Trends charts showing the vast difference in interest between the Kindle and E-Ink tablets like the Remarkable.</figcaption></figure><p>The two images above show the drastic difference in market size between e-readers like the Kindle and e-ink tablets such as the Remarkable. The Kindle is a generalized device that excels at allowing users to consume traditional books that aren’t image-heavy and don’t have rich content like code blocks, charts, graphics, and more.</p><p>When doing my research before buying the Remarkable 2, I noticed that its users seemed to break down into two main categories.</p><ol><li>Handwritten Notetakers — This is the Remarkables primary audience and who Remarkable the company seems to advertise to directly. They accomplish this by providing a distraction-free UI and an incredible writing experience for notes, diagrams, and sketches.</li><li>E-Reader for Research and Technical Papers — I did not fit into the first segment. I’ve certainly used it more for freehanding diagrams over time, but generally, I like the ability to view a paper-sized PDF on a 10.3&quot; screen with all the benefits that E-Ink screens provide related to eye strain. Additionally, Remarkable seems to be branching more into this space. They have recently added smart highlighting that auto-detects text and adapts your highlights to the words rather than just being a drawing on top.</li></ol><p>Now that we have narrowed our search down to just E-Ink tablets, I ran a search for the Remarkable, Remarkable 2, Boox, and Supernote, which are the major competitors in this space.</p><p>I was initially shocked to see how large of a gap the original Remarkable seemed to have even over its successor. However, after looking at the related queries, I think that is primarily driven by Remarkable 2 owners searching for content and shortening their search to “The Remarkable.” We can see that generally, the Remarkable seems to be a leader in this market within the US.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOhZndKic8qcm3livv-vkg.png" /><figcaption>Comparison of the trend results for the remarkable, remarkable 2, boox, and supernote keywords.</figcaption></figure><h4>Going Global!</h4><p>If we zoom out, we can see some hotspots where Boox seems to have an advantage, such as Russia. Baidu has a similar <a href="https://index.baidu.com/">tool</a> to Google Trend Analytics, but I couldn’t seem to use it without a Baidu account. I imagine, like Russia, it is dominated by Boox which Onyx, a China based company, manufactures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*NY625fNwXcqaw7a-T-S39A.png" /></figure><h4>SubredditStats</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*K3h4bJs6ozhaAbGTF_tpRQ.png" /></figure><p>Lastly, I wanted to look at the <a href="https://subredditstats.com/">SubredditStats</a> for each of these devices and get an idea of how strong the community is. Overall, I think it’s probably fair to estimate the Remarkable Audience around 20k to 30k strong. Not all Remarkable users are on Reddit and aren’t represented by these stats, but similarly, there is likely overlap from users that look for similar content but own a Boox or Supernote device.</p><h3>Problems</h3><p>I am a user, which gives me an advantage and biases me towards issues that I personally want to solve. As a result, I’m breaking this section down into features that I personally wanted and insights I gained from looking at our audience data.</p><h4>Personal Problems</h4><ol><li><strong>Ecosystem Integration</strong> is my largest problem with the Remarkable 2. As I mentioned above, they have recently introduced a new feature that adds smart highlighting, which wraps the digital highlighter marks to the text. However, I want these highlights to be extracted automatically sent to my Notion so that I can track these highlights centrally rather than having to dig through old PDFs or manually save these off.</li><li><strong>Sending Articles and Newsletters</strong> to my Remarkable is possible via a Chrome browser extension. However, this depends on me manually visiting each web page, converting the page, and then sending it to my device. I wish I could automate this process so that it would convert articles based on links in Asana, which represent articles I want to read that day.</li></ol><h4>Audience Problems</h4><ol><li><strong>Custom Lockscreens, </strong>as with most devices, seems to be an area of interest for owners.<strong> </strong>However, there isn’t a native way to do this and instead requires a user to SSH into their device and place the image into a specific directory</li><li><strong>Custom Templates </strong>are similar to Lockscreens in that there isn’t a native way to upload them, and they also require the user to bundle them correctly.</li></ol><h3>Solutions</h3><p>Now that we have outlined a few problems that we can solve, let’s define the solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqKHMlIjy68O4VwMpPIWxA.png" /></figure><h4>Barebones</h4><ol><li>The user should be able to upload a custom lock screen image or template with a single click</li><li>The application should be multi-platform</li><li>The application should be able to work offline over a USB C connection</li></ol><h4>Core</h4><ol><li>A gallery that allows users to share and find awesome lock screen images and templates easily</li><li>The user should be able to upload a lock screen image or template from the gallery with a single click</li><li>Marketing website</li><li>Ability to handle payments</li></ol><h4>Killer Feature</h4><ol><li>Leverage the Remarkable Cloud API to scan for document changes, extract highlighted text sections</li><li>Emit those highlights to a Zapier integration which can then be used to forward them onto Notion</li></ol><h4>Stretch Goal</h4><ol><li>A customizable newsletter capability that allows a user to send their newsletters to a designated email address that compiles them into a daily PDF that is sent to their device</li></ol><h3>Technology</h3><p>This is a bit fluid, as I will likely encounter more challenges once we get started, but these are roughly the tools I am looking to use.</p><ol><li>Electron — Provides us with native multi-platform support and allows me to leverage my existing Javascript/React skill set.</li><li>Tailwind UI — I’ve wanted to experiment with this for a while, and this provides me an excellent opportunity to learn more about it and leverage off-the-shelf components.</li><li>Go — There will be some back-end components I will be writing in Go, but with an eye towards Serverless functions and Google App Run to limit operations.</li><li>Zapier Integration — I’ve never built a Zapier integration before, but the tradeoff is that I can write one integration and gain access to a larger universe of integrations.</li><li>Stripe Integration — Similarly to Zapier, I’ve never built or integrated a payment management system before, but this should do most of the heavy lifting for me.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4uzu0ghA2BTtqaZ1QXToFw.png" /></figure><h3>Some Initial Mockups</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3MpJb1kXYtAVg751VxtJw.png" /></figure><h3>Let’s Build!</h3><p>I’ll admit, this isn’t a typical vacation, but hopefully, I’ve done a good job of explaining why I’m doing this. I’m super excited for this week; if you’re interested in following along, drop by my <a href="https://twitter.com/peytoncasper">Twitter</a> or subscribe for email updates.</p><p>Lastly, the goal of this is to make it as open as possible, so the public GitHub repo is below. You can find the initial landing page that I put together last night <a href="https://remarkablesidekick.com/">here</a>.</p><blockquote>Failure and success share one thing in common, they both require you to step into the Arena.</blockquote><p><a href="https://github.com/peytoncasper/remarkable-sidekick">GitHub - peytoncasper/remarkable-sidekick</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f85f691c3fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Use Cases for the Terraform CDK]]></title>
            <link>https://medium.com/codex/4-use-cases-for-the-terraform-cdk-5864630d147e?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/5864630d147e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[cdk]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Wed, 21 Jul 2021 17:00:38 GMT</pubDate>
            <atom:updated>2021-07-24T17:27:52.221Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50TrBaPNc_ov6-8Az23VeQ.png" /></figure><p>As someone who has written my fair share of TF, I’m a bit biased towards a declarative approach to IaC. A declarative approach shifts the maintenance burden onto the provider maintainers and enables practitioners who don’t know how to code to get started quicker.</p><p>That being said, I think most reasonable people would agree that not everything should be or can be defined in a static, declarative way. Terraform’s dynamic resource blocks, and for_each support can quickly leave you wanting for more. Let’s dive into the CDK and see some areas where it can help.</p><h3>What is the Terraform CDK?</h3><p>In 2019 AWS released their Cloud Development Kit (CDK), built upon the <a href="https://docs.aws.amazon.com/cdk/latest/guide/constructs.html">Construct</a> library. The Construct library allows developers to define Javascript or Typescript-based classes that can be used to generate classes in any language that implements the JSii interface.</p><p>The Terraform CDK (TF CDK) is built on the same Construct and JSii libraries by automatically creating Constructs for Terraform Providers, Resources, and Data Sources. This allows a practitioner to leverage languages like Python, Typescript, Go, and more to develop language-native representations of Terraform resources.</p><p>The TF CDK is then responsible for taking the code written in one of these other languages and synthesizing it into a TF configuration in a JSON format. This is then handed off to the Terraform binary to be planned and applied.</p><p>You can think of the TF CDK as a language library for providers and its resources, as well as a pre-process step that turns any language into TF configuration.</p><h3>Use Cases</h3><h4>Dynamic Resource Attributes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLZ4vtBkpJpbCW96_OEnNg.png" /><figcaption>Code example show casing the issue with trying to use nested dynamic blocks with AWS’s WAF v2 Rule Group Statements which can be recursively nested</figcaption></figure><p>At some point, you’re going to want to base the attributes of your resources on a dynamic set of data. In the most straightforward cases, for_eachand dynamic{} blocks allow you to capture this relationship between data and your resources.</p><p>However, some resources, such as the AWS WAFv2 rule group, have more complex data structures, given their ability to support recursive statements. An example of this relationship is shown above on the right-hand side. Supporting this type of relationship with Terraform’s dynamicblocks results in convoluted code. It might not capture the entire data structure in the case of an unbounded recursion depth.</p><p>Contrast this to the <a href="https://github.com/peytoncasper/tf-cdk-examples/tree/master/dynamic-resource-attributes">Dynamic Resource Attributes Example</a> on the left-hand side, which allows us to leverage Python’s native JSON parsing and convert these nested statements directly into the appropriate CDK classes.</p><h4>Dynamic Module Composition</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0KHzqTSI14W3nRKbxQjwpQ.png" /><figcaption>Hierarchical diagram showing how the App A module leverages children modules as building blocks</figcaption></figure><p>Terraform does not provide the ability to source Provider and Module versions dynamically as this information has to be known before initialization. In general, this is not an issue. Still, it usually means that you end up with a hierarchical structure to your modules where your outermost module represents a “release” or a specific configuration of all of its children modules.</p><p>This release concept is ideal as it provides us with point-in-time snapshots of module configurations that interact well with each other. However, what if you’re running a PaaS service and have one hundred customers with varying release versions. It might be beneficial to externalize the set of module versions a customer is running on. This allows us to support capabilities like feature flags without having to modify any TF code manually.</p><p>The CDK provides us with this ability because it acts as a TF code generation layer; we can easily pull our release information from any external system like a Database, REST API, Consul, or even from a file on disk.</p><p>The <a href="https://github.com/peytoncasper/tf-cdk-examples/tree/master/dynamic-module-composition">Dynamic Module Composition Example</a> showcases and example of reading a set of module versions from a JSON file on disk. It then passes this information into the CDK library to generate the final TF code.</p><h4>External Configuration Integration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2hgszmYhQdNqbZ_eKfPIw.png" /><figcaption>Diagram that shows a Python process making a GET request to the BoredApi and using that response as input to the CDK.</figcaption></figure><p>Terraform has access to hundreds of providers which have varying degrees of data sources from which we can pull information. But, what if we wanted to base some of our TF configuration on data from Kafka, a REST API, or even a service that doesn’t have a provider?</p><p>Unfortunately, that isn’t possible without an external process pulling that data and translating it into TF variables before we run terraform apply. This is another example where the TF CDK acts as that external process that provides us with two possibilities.</p><ol><li>Automatically reacting to events received, generating new TF code, and then executing it.</li><li>Pulling data from an external source and using it to dynamically generate our TF code.</li></ol><p>The <a href="https://github.com/peytoncasper/tf-cdk-examples/tree/master/external-configuration-integration">External Configuration Integration Example</a> leverages scenario two by making a GET request to the <a href="https://www.boredapi.com/">BoredApi</a> and then using that response to define the name of an AWS Compute Instance.</p><h4>Post Provision Steps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mWaf-WhBjBgJpR0f8gf-pA.png" /><figcaption>Flow diagram showing a Python process, adding a resource to a CDK Stack, generating TF code, applying it adding a commit stage and repeating</figcaption></figure><p>I’ve only ever run into this issue once with Terraform, and it’s specifically related to how the Terraform Palo Alto provider works. Unfortunately, the Palo Alto provider cannot execute a commit at the end of an apply. As a result, all of the changes that have been updated in your Statefile are staged. This means that you need to have some process that can execute the commit against the Palo Alto API at the end of your terraform apply. It also means that if for some reason, the commit step fails, our TF state and the Palo Alto provider are essentially out of sync.</p><p>The <a href="https://github.com/peytoncasper/tf-cdk-examples/tree/master/post-provision-steps">Post Provision Steps Example</a> leverages the ability for the TF CDK to generate TF code on demand and the ability to control the Terraform lifecycle by injecting a commit step after each resource is added.</p><h3>Cons</h3><p>I’m going to omit the pros section as the 4 use cases represent most of them already. Most of the cons relate to the maturity of the project, but I do want to call them out as they are important to understanding whether or not your team can support the CDK in its current state.</p><ol><li>The CDK fetches modules, providers, and their JSii classes using the cdktf get command. It takes long enough to get a cup of coffee and, unfortunately, doesn’t seem to perform a diff before running; instead, it re-downloads everything each time. You probably won’t run it too much, but terraform init is an extremely quick operation that is functionally equivalent.</li><li>Import syntax highlighting and Intellisense are non-existent when it comes to the Python implementation of the CDK. I suspect this is because the CDK downloads the JSii classes into a non-standard import folder, but it compounds with the next issue.</li><li>No docs on the names of classes or their implementation mean that in the case of AWS, you’re going hunting through a 40MB Python file with no syntax highlighting using the find command to search for their implementation.</li><li>Class names are auto-generated and result in some interesting names. In the case of our recursive WAF Rule Statements from above, this is an example.Wafv2RuleGroupRuleStatementOrStatementStatementGeoMatchStatementForwardedIpConfig</li><li>As with all new projects, the error messages can get quite verbose and the CDK is no different. In the case below, I was passing in the wrong type of object when creating a TerraformHclModule</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02a2958eda7f7093b2c5fca1c1e653db/href">https://medium.com/media/02a2958eda7f7093b2c5fca1c1e653db/href</a></iframe><h3>Conclusion</h3><p>The TF CDK is a great tool to add to your belt, but I would caution against switching over to it wholesale. While it can feel comfortable to use a language that you already know, declarative code has many unseen benefits when it comes to maintainability. Because we are simply declaring what type of resources we want to exist, the underlying implementation can easily be upgraded as long as it provides the same inputs and outputs. While the same could be said of the auto-generated JSii classes, you’re also dealing with two additional layers of abstraction that can change at any time.</p><p>Leverage the CDK for what it’s best at, a thin layer that sits on top of Terraform, allowing you to dynamically grab information and then use that to generate the underlying TF code. More specifically, I think there is a sweet spot where ninety-five percent of your TF is declarative HCL, and the remaining five percent is some variation of CDK code loading data and utilizing the existing TF modules. This allows teams to maintain a shared set of modules while still allowing each team to maintain a light customization layer on top.</p><p>I enjoyed exploring the TF CDK, and I’m excited to see how it changes as the project continues to iterate. Hopefully, you learned something from this post, however, I’m also curious what your experience has been or if you have any other ideas on how to leverage the CDK. Reach out to me on <a href="https://twitter.com/peytoncasper">Twitter</a>; I would love to continue the conversation.</p><p><a href="https://github.com/peytoncasper/tf-cdk-examples">GitHub - peytoncasper/tf-cdk-examples</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5864630d147e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/4-use-cases-for-the-terraform-cdk-5864630d147e">4 Use Cases for the Terraform CDK</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tic Tac Consul — Multi-Cloud, Serverless Networking]]></title>
            <link>https://medium.com/hashicorp-engineering/tic-tac-consul-multi-cloud-serverless-networking-b030111a2af3?source=rss-74eb46e29419------2</link>
            <guid isPermaLink="false">https://medium.com/p/b030111a2af3</guid>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[consul]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[multi-cloud]]></category>
            <category><![CDATA[hashicorp-consul]]></category>
            <dc:creator><![CDATA[Peyton Casper]]></dc:creator>
            <pubDate>Fri, 05 Mar 2021 17:33:54 GMT</pubDate>
            <atom:updated>2021-03-05T17:33:54.918Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tic Tac Consul — Multi-Cloud, Serverless Networking</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iif-pJIo0X-5jSjWMMbrDw.png" /></figure><p>Tic Tac Consul pits serverless functions from GCP, AWS, and Azure in an epic match of Tic Tac Toe! No, but seriously, Tic Tac Consul is focused on exploring the challenges of networking across environments and integrating serverless functions with the rest of your application stack.</p><p>As more and more workloads move to the cloud, many organizations are faced with the challenges of mapping their traditional skill sets and on-premise data center resources to the constructs of one cloud provider. But the reality is that most organizations already are or will leverage multiple cloud providers to take advantage of best-of-breed solutions.</p><p>So how does this all map back to serverless functions playing Tic Tac Toe with each other? Well, I pose a question for you, how would you handle network connectivity between multiple environments securely while allowing any application, whether it’s deployed on a VM, in K8s, on a mainframe, or even a serverless function, to find and connect to each other?</p><p>It turns out it’s rather challenging, and that’s what we’re going to explore today.</p><h3>Consul Overview</h3><p>I want to start with a quick overview of what <a href="https://www.consul.io/">Consul</a> is and a general idea of why you would utilize it. At a fundamental level, Consul is an agent-based solution for registering services and routing requests between services. As services come online, they register themselves with Consul, and agents perform localized health checks to track healthy and unhealthy applications.</p><p>These agents allow Consul to load balance requests across services, define which applications are allowed to talk to each other with intentions, and securely proxy requests between environments.</p><h3>Connecting Environments</h3><p>So before we deep dive into Tic-Tac-Consul, let’s go through a brief overview of the common ways that Cloud Providers currently connect environments between each other and traditional on-premise environments.</p><h4>VPN</h4><p>VPNs are probably the simplest way of connecting two different environments across the public internet. At their most basic level, VPNs are responsible for encrypting your traffic as it travels over the public internet to a connected environment. You’ve likely heard ads for VPNs that provide an exit node in another country and encrypt your traffic so that it can’t be “immediately” tracked.</p><p>All the major cloud providers have a VPN offering for connecting your local environment with their VPCs and Virtual Networks in a secure way. VPNs provide a cheap and easy way to begin securing your traffic between two environments. Still, they don’t offer any guarantees on latency as you’re at the mercy of your ISP and how quickly your requests can get routed to the cloud provider’s network.</p><p><em>Examples: GCP Cloud VPN, AWS VPN, and Azure VPN Gateway</em></p><h4>Peering</h4><p>Peering isn’t entirely different from a VPN but rather a way to provide a shorter route for your requests to go from a local environment to a remote environment. With two networks peered together, you might still be communicating over the public internet, but at least you have a defined route from your Datacenter to the cloud provider.</p><p>A VPN would still be responsible for encrypting your traffic, but peering provides higher availability and lower latency via the dedicated route mentioned above. The tradeoff, of course, happens to be the cost in comparison to a traditional VPN.</p><p><em>Examples: GCP Direct/Carrier Peering, Azure Peering Service</em></p><h4>Interconnect</h4><p>Aside from running all of your workloads directly in a cloud provider’s environment, interconnects are the lowest latency and highest availability that you’re going to achieve. Interconnects provide a direct, physical route from your environment to the cloud provider’s network. Interconnects remove unnecessary network hops for your traffic and send traffic over your private interconnect instead of the public internet.</p><p>It’s been interesting to watch this industry pop up, and we’re even starting to see interconnects between cloud providers from companies like Equinix. All that being said, interconnects are far from the cheapest option available. However, if you’re relying on this connection for mission-critical services or need the absolute lowest latency possible, interconnects are necessary.</p><p><em>Examples: GCP Direct Connect, AWS Direct Connect, Azure ExpressRoute, Equinix</em></p><h3>Serverless Function Challenges</h3><p>All right, so we have plenty of options for handling network connectivity. The question becomes, how do we find services, load balance across them, handle multi-dc failover, and quite frankly integrate more complex environments like serverless functions, K8s, and the OG serverless functions, mainframes.</p><p>For this discussion, I will focus on the challenges that Serverless Functions face. The solutions we explore will provide us with a framework that can be used across any environment.</p><h4>Dynamic IP Addresses</h4><p>Dynamic IP Addresses aren’t unique to serverless functions; in fact, Kubernetes embraces this concept by dynamically assigning IP addresses to pods every time they come up. And, I’m sure some of you who have used serverless functions are probably wondering why I’m even talking about IP Addresses. Most serverless functions are exposed with a DNS entry that can be utilized across the public internet.</p><p>What if we wanted to do this only over private networks? Easy enough, we can peer two networks together and be done with it. What about connecting that function across a private network to another cloud and making it accessible via DNS?</p><h4>Authorization</h4><p>Authorization is typically accomplished utilizing the cloud provider’s native IAM permissions. Once again, this is great if you are operating solely in a single environment, but using a GCP Service Account in an AWS Lambda function or managing API Keys so that your on-premise applications can talk to an Azure function can quickly become a bit cumbersome.</p><h4>Firewalls</h4><p>Firewalls aren’t likely to apply to everyone, but high-security environments are likely to have firewalls surrounding their perimeter that control not only ingress traffic but also egress traffic. Now you have these serverless functions that are liable to be running on any number of machines needing to be called and talk outbound across environments. This results in firewall rules that need to be kept up to date continually.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYpz1_q1yFlUVy6S31zkbQ.png" /></figure><h4><strong>Mesh Gateways</strong></h4><p>At this point, you’re probably nodding in agreement that multi-cloud and multi-environment connectivity is challenging. This is not exactly a new idea. Consul combines two critical components that help us solve these challenges.</p><p>Mesh Gateways are a relatively new feature of Consul that encrypts traffic and proxy information between environments. Combining this with Consul’s built-in DNS server, ability to perform distributed health checks, and load balancing, we have something that is a bit like VPN+. The best part is that all of this works across the public internet, with or without a VPN, Peering, or even a dedicated Interconnect.</p><p>Here is where things get even more interesting. As I mentioned above, Consul is an agent-based architecture, so how can we integrate a Service Mesh with serverless functions and other managed services that we don’t control?</p><h4>Terminating and Ingress Gateways</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oNNIRqdqf5Kwa8AuAHG2eQ.png" /></figure><p>Terminating and Ingress Gateways are endpoints deployed in various environments that allow traffic to exit and enter the Consul service mesh. In the architecture above, you can see how Tic Tac Consul deploys a terminating and ingress gateway within AWS, Azure, and GCP networks peered with a serverless function deployed in each environment.</p><p>Combining this with the Mesh Gateways that we talked about above, we’re able to securely transit requests across environments while also using Consul’s global DNS to call these functions from any environment.</p><p>We gain the other benefit that mesh, terminating, and ingress gateways all provide relatively static ingress/egress points for our traffic. This means that traditional firewalls only have to worry about our gateways. Also, leveraging <a href="https://www.hashicorp.com/blog/announcing-consul-terraform-sync-tech-preview">Consul Terraform Sync</a> would allow you to easily automate those firewalls and load balancers based on services that get registered with Consul.</p><h4>Consul Intentions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6_Ws_bE1XrP8aoAwyFaFw.png" /></figure><p>If you remember, we have one final challenge: authorization between functions and, more specifically, across environments. Intentions allow us to easily create “allow” and “deny” policies between services. In Tic Tac Consul’s case, we could easily allow traffic from our GCP function to our AWS function, but not in return.</p><p>Compared to managing API keys or keeping IAM credentials synchronized across Cloud providers, intentions provide a much simpler mode of authorizing traffic.</p><h3>Conclusion</h3><p>We covered many different topics in this post, including connecting multiple environments securely, some of the challenges with serverless functions, and ultimately what Consul does. Multi-cloud is not easy, and frankly, something that most organizations might never find valuable. However, in the same vein, most organizations have some existing infrastructure, presenting all the same challenges if not more as they start to connect multiple cloud environments.</p><p>I hope this was valuable, and you can find a link to the GitHub repo for Tic Tac Consul below if you’d like to try deploying this yourself. Drop a comment below or send me a message on <a href="https://twitter.com/peytoncasper">Twitter</a>, and I’ll gladly offer any help that I can.</p><p><a href="https://github.com/peytoncasper/tic-tac-consul">peytoncasper/tic-tac-consul</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b030111a2af3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hashicorp-engineering/tic-tac-consul-multi-cloud-serverless-networking-b030111a2af3">Tic Tac Consul — Multi-Cloud, Serverless Networking</a> was originally published in <a href="https://medium.com/hashicorp-engineering">HashiCorp Solutions Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>