<?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 Dane Fetterman on Medium]]></title>
        <description><![CDATA[Stories by Dane Fetterman on Medium]]></description>
        <link>https://medium.com/@danefetterman?source=rss-9e453e3a3c54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*MD9s8Mj8o3p0C08b_SFBxw.png</url>
            <title>Stories by Dane Fetterman on Medium</title>
            <link>https://medium.com/@danefetterman?source=rss-9e453e3a3c54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:11:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danefetterman/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[Solved — Zappa won’t package main project directory]]></title>
            <link>https://python.plainenglish.io/solved-zappa-wont-package-main-project-directory-3c8f21a48a33?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c8f21a48a33</guid>
            <category><![CDATA[zappa]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Wed, 13 Nov 2024 03:54:41 GMT</pubDate>
            <atom:updated>2024-11-14T02:53:29.849Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solved — Zappa won’t package main project directory</h3><p>I was running into an issue where I would run ‘zappa deploy dev’ and see errors like this in the Cloudwatch logs after the deploy ran:</p><pre>[ERROR] ModuleNotFoundError: No module named &#39;my_project&#39;<br>Traceback (most recent call last):<br>  File &quot;/var/task/handler_custom.py&quot;, line 674, in lambda_handler<br>    return LambdaHandler.lambda_handler(event, context)<br>  File &quot;/var/task/handler_custom.py&quot;, line 258, in lambda_handler<br>    handler = global_handler or cls()<br>  File &quot;/var/task/handler_custom.py&quot;, line 155, in __init__<br>    self.app_module = importlib.import_module(self.settings.APP_MODULE)<br>  File &quot;/var/lang/lib/python3.10/importlib/__init__.py&quot;, line 126, in import_module<br>    return _bootstrap._gcd_import(name[level:], package, level)<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 992, in _find_and_load_unlocked<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241, in _call_with_frames_removed<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load<br>  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1004, in _find_and_load_unlocked</pre><p>Here is my directory structure:</p><p>my_project_root/<br> ├── my_project/ ← Main Django project<br> │ ├── __init__.py<br> │ ├── settings.py<br> │ ├── wsgi.py ← WSGI entry point for the project<br> ├── my_project_app/ ← Django app<br> ├── my_project_app2/ ← Django app<br> ├── manage.py<br> ├── requirements.txt<br> ├── zappa_settings.json</p><p>I made every adjustment to my zappa_settings.json file that you could imagine but the my_project directory was not being included in the package.</p><p>The issue was that my python virtual environment was named my_project which matches the my_project directory name. There was no error message indicating this was causing a conflict, the directory was just not being included in the package. I changed the virtual environment name to not match the project name and the my_project directory was then included in the package.</p><p>I’m writing this so it hopefully appears in google results and it helps someone else avoid this issue.</p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a></li><li><a href="https://differ.blog/"><strong>Create a free AI-powered blog on Differ.</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c8f21a48a33" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/solved-zappa-wont-package-main-project-directory-3c8f21a48a33">Solved — Zappa won’t package main project directory</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Bedrock Knowledge base Minimum Cost — Beware!]]></title>
            <link>https://faun.pub/aws-bedrock-knowledge-base-minimum-cost-beware-f2a2dac383d0?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2a2dac383d0</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[bedrock]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 20:31:58 GMT</pubDate>
            <atom:updated>2024-03-06T13:03:48.905Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Bedrock Knowledge base Minimum Cost — Beware!</h3><figure><img alt="Stable Diffusion Generated Nonsense — SDXL 0.8, Prompt: Diagram, Retrieval Augmented Generation" src="https://cdn-images-1.medium.com/max/512/1*u3f1iNgtE7ysC33t93hACg.png" /><figcaption>Stable Diffusion Generated Nonsense — SDXL 0.8, Prompt: Diagram, Retrieval Augmented Generation</figcaption></figure><p>Knowledge bases for Amazon Bedrock was released in late November 2023. It allows you to aggregate different data sources into a centralized repository of information. This knowledge base can then be used to augment responses from foundation models through a popular technique called retrieval augmented generation (RAG).</p><p>If you’re unfamiliar with <a href="https://aws.amazon.com/what-is/retrieval-augmented-generation/">RAG</a>, read more about it <a href="https://aws.amazon.com/what-is/retrieval-augmented-generation/">here</a>.</p><p>When creating a new Knowledge base, you’re presented with a few options:</p><ul><li>DATA SOURCE<br>Accepts a single S3 bucket as a data source. UI hints at future improvements in this area.</li><li>EMBEDDINGS MODEL<br>Currently limited to a specific embeddings model, Titan Embeddings G1 — Text v1.2.</li><li>VECTOR DATABASE<br>Choose an existing vector database, including external providers, or have a vector database created for you<strong>. </strong>If you choose to have one created for you, <strong>Vector engine for Amazon OpenSearch Serverless</strong> will be used.</li></ul><p>When I hear serverless, I think On Demand and expect the billing to match. I basically assume the Lambda pricing model. This is not the case with Vector engine for Amazon OpenSearch Serverless.</p><p><strong>When you create a new Knowledge base in AWS Bedrock and allow a vector database to be created for you, a new collection is created and OCUs are allocated to support that.</strong></p><p>There is a <strong>minimum of 4 OpenSearch Compute Units (OCUs) allocated </strong>when creating a collection with redundant active replicas enabled. With redundant active replicas disabled, the minimum is 2 OCUs for the first collection. Additional collections can share OCUs. As of January 2024, <strong>OCUs cost 0.24 USD per hour</strong>.</p><p>Minimum Knowledge bases for Amazon Bedrock costs due to OpenSearch:</p><p>With Redundant Active Replicas enabled: <strong>$720 per month</strong><br>Without Redundant Active Replicas enabled: <strong>$360 per month</strong></p><p>As <strong>an</strong> <strong>alternative to OpenSearch</strong>, you can use a 3rd party, <a href="https://www.pinecone.io/">Pinecone</a>, which easily integrates with Bedrock Knowledge bases and has reasonable consumption based pricing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CWNoWBICGehf-lZ4.png" /></figure><h4>👋 If you find this helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀<a href="http://from.faun.to/r/8zxxd">Join FAUN Developer Community &amp; Get Similar Stories in your Inbox Each Week</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2a2dac383d0" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/aws-bedrock-knowledge-base-minimum-cost-beware-f2a2dac383d0">AWS Bedrock Knowledge base Minimum Cost — Beware!</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating AWS Guard Duty Enrollment]]></title>
            <link>https://faun.pub/automating-aws-guard-duty-enrollment-ef10a28857d5?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef10a28857d5</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Fri, 13 Sep 2019 16:36:36 GMT</pubDate>
            <atom:updated>2022-04-30T11:31:27.607Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jb7qj-9BBdPbFHTp7qUZcw.jpeg" /></figure><p><strong>2022 Update: This functionality is now part of AWS Organizations and this post is out of date. I’m leaving it up for reference purposes. Thanks, Dane</strong></p><p>Large enterprises with decentralized IT often contend with AWS account sprawl with InfoSec teams having limited or no insight into many of the accounts. In order to aggregate data across multiple accounts, Amazon released AWS GuardDuty.</p><p>Amazon describes GuardDuty as “a threat detection service that continuously monitors for malicious activity and unauthorized behavior to protect your AWS accounts and workloads. GuardDuty can be enabled with no software or hardware to deploy or maintain.”<br><a href="https://aws.amazon.com/guardduty/">https://aws.amazon.com/guardduty/</a></p><p>Unfortunately, AWS doesn’t offer a feature (as of September 2019) to automatically enable GuardDuty on a member account and associate it with a master account.</p><p>As a workaround to this, I wrote <a href="https://github.com/dfetterman/guard-duty-signup">GuardDuty Signup</a>, a handful of easily deployed python scripts to enroll a member account in <a href="https://aws.amazon.com/guardduty/">AWS Guard Duty</a> on a master account. The scripts run as Lambda functions, kicked off by a Step Function that lives behind API Gateway. So, with a single API command, you can enroll a new member AWS account into Guard Duty on a master account.</p><p>I expected the GuardDuty enrollment to be very complicated, however, it’s only the standard level of AWS complicated.</p><p>To write <a href="https://github.com/dfetterman/guard-duty-signup">GuardDuty Signup</a>, I started by reading through Amazon’s documentation on how enrollment is supposed to work. I found <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html">Managing AWS Accounts in Amazon GuardDuty</a> to be the most helpful for understanding what the process is.</p><p>Once I had an understanding of the enrollment process, I took a look at the <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/guardduty.html">GuardDuty Boto</a> documentation to see what I had to work with in terms of the Python SDK. I mapped out each step of the enrollment process to an available method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlMllbj8zhXqpxGHLNqsRQ.jpeg" /><figcaption>Process Sketch</figcaption></figure><p>This is the first POC project where I’ve used <a href="https://aws.amazon.com/step-functions/">Amazon Step Functions</a>. The Step Functions kick off standard <a href="https://aws.amazon.com/lambda/">Lambda Functions</a> based on the status of the previous step. I used step functions because I expected there to be a delay between each step and I’m cost-sensitive to long-running Lambda functions. In hindsight, there wasn’t a delay so this could have been one monolithic Lambda function.</p><p>The enrollment process that I had previously mapped out looks like the following diagram once you convert it into a Step Function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWaRyzGeaprYiaPtGVa87w.png" /><figcaption>AWS Generated Step Function Diagram</figcaption></figure><p>I used <a href="https://serverless.com/">Serverless Framework</a> to simplify the deploy and create all of the necessary resources in AWS with a single command. This is tested with Serverless Framework Core: 1.51.0, Plugin: 1.3.11, SDK: 2.1.0.</p><p>The resources are defined in a serverless.yml file:</p><pre>service: guarddutysignup <br>custom:  <br>  stage: ${opt:stage, self:provider.stage}  <br>  memberRoleName: CrossAccountManageGuardDutyRole #The name of the role that will be assumed in member accounts </pre><pre>provider:  <br>  name: aws  <br>  runtime: python3.6  <br>  stage: dev #default stage  <br>  environment:    <br>    env: ${self:custom.stage}    <br>    memberRoleName: ${self:custom.memberRoleName}    <br>    MasterId:      Ref: AWS::AccountId  region: us-east-1<br>.....(MORE BELOW)....</pre><p>The resources that are created by the Serverless Framework and how they relate to each other can be seen in the following architecture diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-trnRKfDxbUHVD70ffGbA.jpeg" /><figcaption>GuardDuty Signup Architecture Diagram, Dane Fetterman Loves Diagrams</figcaption></figure><h4>Installation</h4><p>With Serverless Framework installed, AWS CLI configured and using credentials for the master account you can deploy from a workstation using the following command:</p><pre>serverless deploy --stage dev</pre><p>This will create all of the resources shown in the above diagram on your AWS master account necessary for GuardDuty Signup.</p><h4>Usage</h4><p>Once you deploy the resources, you’ll be provided with some service information.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5815ef1d2feea653fc1dad6d870c7b68/href">https://medium.com/media/5815ef1d2feea653fc1dad6d870c7b68/href</a></iframe><p>Within service information, it’s important to make note of the API key and the endpoint:</p><pre>api keys:<br>  mykey6: OGyJrKhQHUHNOWAYNOTSHARINGITdEpUc</pre><pre>endpoints:  <br>  GET -https://1lj82agbb.execute-api.us-east-1.amazonaws.com/dev/mystepfunction/MasterDetectorId/{MasterDetectorId}/MemberId/{MemberId}/Email/{Email}</pre><p>MasterDetectorId — The Guard Duty DetectorId on your Master Account<br>MemberId — The AWS account number of the member account<br>Email — The E-mail address associated with the AWS account number of the member account.</p><p>If you were to hit the API from a command line, it would look something like this:</p><pre>curl -H &quot;x-api-key: OGyJrKhQHUHNOWAYNOTSHARINGITdEpUc&quot; <a href="https://1lj82agbb.execute-api.us-east-1.amazonaws.com/dev/guarddutysignup/MasterDetectorId/bab350a4691f29910b874fb1f33459c9/MemberId/123456789123/Email/bob@bobsmith.com">https://1lj82agbb.execute-api.us-east-1.amazonaws.com/dev/guarddutysignup/MasterDetectorId/bab350a4691f29910b874fb1f33459c9/MemberId/123456789123/Email/bob@bobsmith.com</a></pre><h3>Super Important!</h3><p>Before you can manipulate a member account, the member account needs to have a cross-account role configured. An example for configuring this is provided in the git repo. It’s not something that I’m focussing on because in my use case, I already have the ability to create cross-account roles in accounts with limited permissions.</p><h4>Some Thoughts for Expanding on This</h4><p>By creating an API for enrolling in GuardDuty, you could build a UI to permit self-service enrollment.</p><h3>I’m ready to see the code and get started:</h3><p>To get started, head on over to the Github repo at <a href="https://github.com/dfetterman/guard-duty-signup">https://github.com/dfetterman/guard-duty-signup</a></p><p>Keep in mind that this is a POC, some of the Python scripts handle errors well, other don’t, and some of it is just ugly but it met the technical requirements, time requirements, and it works. Feel free to submit pull requests.</p><p>About: Dane Fetterman is an IT Cloud Architect in Philadelphia. He’s a fan of DevOps, Philadelphia, his family, two dogs, and two cats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef10a28857d5" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/automating-aws-guard-duty-enrollment-ef10a28857d5">Automating AWS Guard Duty Enrollment</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use an off-brand battery in an old PowerWheels™]]></title>
            <link>https://medium.com/@danefetterman/how-to-use-an-off-brand-battery-in-an-old-powerwheels-41176dd3cbaa?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/41176dd3cbaa</guid>
            <category><![CDATA[repair]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[parenting]]></category>
            <category><![CDATA[toys]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Mon, 17 Jun 2019 22:27:41 GMT</pubDate>
            <atom:updated>2019-06-18T02:12:18.810Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using an off-brand battery in an old PowerWheels™</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TorqkaV2QnZ4_rYcJpp1qw.jpeg" /></figure><p>I was able to use a $12 battery instead of the official $35 battery, here’s how:</p><p>My aunt was nice enough to give me a hand me down PowerWheels™ quad. It’s intended for toddlers and my son is finally getting big enough to ride it so I pulled it out of the closet and threw it on the charger.</p><p>After a couple of hours, I took it off the charger and hoped it was ready for a test ride. It lasted for about 5 minutes. The battery no longer holds a charge.</p><p>I previously wrote a blurb (<a href="https://medium.com/@danefetterman/lessons-learned-fix-vs-replace-e0b73db2ef42">Lessons Learned — Fix vs. Replace</a>) about how sometimes I sink a lot of time and money trying to fix things that should just be replaced. It’s just in my nature, I really just want to fix everything. This one falls into the category of things worth “fixing”.</p><p>The <a href="https://www.target.com/p/fisher-price-power-wheels-kawasaki-lil-quad/-/A-14189834">Fisher-Price Power Wheels Kawasaki Lil’ Quad</a> costs about $95 new at Target. An official 6-volt <a href="https://www.amazon.com/Power-Wheels-Toddler-Rechargeable-Replacement/dp/B002IPGW4S">PowerWheels™ replacement battery</a> is about $35. An <a href="https://www.amazon.com/gp/product/B002QGVW3K/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&amp;psc=1">off-brand 6-volt sealed lead acid battery</a> is $13.</p><p>No way am I buying a new quad at $95 and I don’t see what’s so special about the official battery. $13 off-brand is the direction I’m going.</p><p>Disclaimer: I spent zero time researching this so please feel free to tell me why it’s a bad idea in the comments.</p><p>Requirements:<br>- <a href="https://www.target.com/p/fisher-price-power-wheels-kawasaki-lil-quad/-/A-14189834">Fisher-Price Power Wheels Kawasaki Lil’ Quad</a> $95 or free<br>- <a href="https://www.amazon.com/gp/product/B002QGVW3K/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&amp;psc=1">6-volt sealed lead acid battery</a> $12.99 at Amazon<br>- <a href="https://www.harborfreight.com/8-in-four-way-wire-crimperstripper-tool-63307.html">Wire Stripper</a> $4.49 at Harbor Freight</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZoQ-X6x2oxthr_maUQ3Ig.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PfLHk_wo5q6M4X4PWe66UQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0TnfvYlZWkOmTJMvuJXCA.jpeg" /></figure><p><strong>Let’s get started!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmiqTVMJ8GNb6e5ZT6oFXA.jpeg" /></figure><p>Remove the battery from the quad</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7RRR0dsL8jubFlNvfcr0BQ.jpeg" /></figure><p>Cut the positive and negative wires in order to remove the adapter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ykd8_fDluZzIGA5CvnOcYg.jpeg" /></figure><p>Sweet, now you have an adapter!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*egEt4mDGUBqBs2odniKmXg.jpeg" /></figure><p>Strip the the black and white wires. Careful not to cut yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQc7yS-QnCJiIrwNYA9Y9Q.jpeg" /></figure><p>Insert the wires into the connector that comes with the wire stripper/crimper tool, twist it a bunch, then crimp the hell out of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVdEEefcE3l-724qlDKH8w.jpeg" /></figure><p>The connectors should look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cb6NdXTk_RlhCYpnC_-o7w.jpeg" /></figure><p>Insert the connectors into the battery, it will look something like the above photo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNpUvAq-qmvyHoaD9NRBkQ.jpeg" /></figure><p>Insert the new battery with the attached adapter into the quad. The new battery was a little shorter than the origin, so I jammed a wooden shim in there to keep it in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*hYbEjZgL5eO7qgs5Vu0vuw.gif" /></figure><p>He got a little brave and really went for it on his second try. The good news is that the battery has been holding a charge for two days now.</p><p>Like I mentioned earlier, I spent zero time researching this so please feel free to tell me why not using the official battery is a bad idea in the comments.</p><p>I plan to keep an eye on the battery with a digital multimeter. I’m concerned that I can run into some issues if I let the power get too low or if I overcharge it.</p><p>About: Dane Fetterman is an IT Cloud Architect in Philadelphia. He’s a fan of DevOps, Philadelphia, his family, two dogs and two cats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41176dd3cbaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parsing a JSON file from a S3 Bucket — Dane Fetterman]]></title>
            <link>https://faun.pub/parsing-a-json-file-from-a-s3-bucket-dane-fetterman-a0e0566d5c32?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0e0566d5c32</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Tue, 11 Jun 2019 19:27:24 GMT</pubDate>
            <atom:updated>2019-07-21T11:26:31.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>Parsing a JSON file from a S3 Bucket — Dane Fetterman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*AYjWTXLy9Eb7GYNKXv87ug.jpeg" /></figure><p>My buddy was recently running into issues parsing a json file that he stored in AWS S3.</p><p>He sent me over the python script and an example of the data that he was trying to load. I dropped mydata.json into an s3 bucket in my AWS account called dane-fetterman-bucket.</p><p>It’s good to remember that:</p><ul><li>json.loads take a string as input and returns a dictionary as output.</li><li>json.dumps take a dictionary as input and returns a string as output.</li></ul><p>I took a look at his script. He was running json.dumps then json.loads against the same data before attempting to work with it.</p><p>To demonstrate how this mucks up the data, I added a bunch of print statements to help him see what the data looked like with json.loads vs json.dumps. After confirming that was the issue, I pulled out the json.dumps, a few other things and handed it back to him. Below is an example of the cleaned up script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73722a2524881136b5eaac32332d650a/href">https://medium.com/media/73722a2524881136b5eaac32332d650a/href</a></iframe><p>Disclaimer: I’m not a python developer and json.loads vs json.dumps has nailed me so many times in the past.</p><p>About: Dane Fetterman is an IT Cloud Architect in Philadelphia. He’s a fan of DevOps, Philadelphia, his family, two dogs and two cats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0e0566d5c32" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/parsing-a-json-file-from-a-s3-bucket-dane-fetterman-a0e0566d5c32">Parsing a JSON file from a S3 Bucket — Dane Fetterman</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attach Network VMC w/ Ansible — Dane Fetterman]]></title>
            <link>https://medium.com/@danefetterman/attach-network-vmc-w-ansible-dane-fetterman-4493ca2daafb?source=rss-9e453e3a3c54------2</link>
            <guid isPermaLink="false">https://medium.com/p/4493ca2daafb</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[vmware]]></category>
            <dc:creator><![CDATA[Dane Fetterman]]></dc:creator>
            <pubDate>Mon, 10 Jun 2019 18:32:18 GMT</pubDate>
            <atom:updated>2022-05-02T13:15:41.820Z</atom:updated>
            <content:encoded><![CDATA[<h3>Attaching Network VMC w/ Ansible issue — Dane Fetterman</h3><p>We’re looking at options for a lift and shift of an on-premises VMWare environment to the cloud. VMware Cloud (VMC) on AWS has a nice migration path, but I’m also interested in automation around creating and configuring new Linux hosts on VMC using Ansible. I’m running Ansible 2.5.1, as of June 10th, 2019, it’s a few minor releases behind.</p><p>Below is a network issue I ran into when provisioning hosts on VMC using Ansible.</p><p>I have a RHEL7 template called “RHEL7-rootpwwasreset”. <strong>It’s important to mention that when this template was created, a nic was created and attached to the “Host Segment 1 DHCP” network.</strong></p><p>I am creating the new host using the following Ansible playbook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4687f706dc0aa96511e2b1cf0bd20941/href">https://medium.com/media/4687f706dc0aa96511e2b1cf0bd20941/href</a></iframe><p>Here’s what it looks like in the VSphere console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZeNnpMPbZS1DCLHvbDakw.png" /></figure><p>Notice that the host is powered on and running, VMware Tools is installed, and the host didn’t grab an IP address. I’ve highlighted that Network adapter 1’s current status is disconnected so the OS would show that the interface is down.</p><p>Taking a look at the “edit settings” menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDH40gFz2B3pLjvI1ZPPkA.png" /></figure><p>In the edit settings menu, “Connected” is not checked for Network adapter 1. That’s weird, because in the ansible playbook, we’re definitely declaring that it should be connected.</p><p>If I attempt to connect the interface, the VSphere console throws the following error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*_K8DPvvHmRzy7svvHbuu5A.png" /><figcaption>Failed to connect virtual device ‘ethernet0’.</figcaption></figure><p>Well, the “Failed to connect virtual device ‘ethernet0’.” error message isn’t super helpful for troubleshooting purposes.</p><p>The host is currently running. How about I shut it down then try this again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YEToNmIyPkQBOnuR1ILBA.png" /></figure><p>So, now that I’ve powered off the host, if I go back to “edit settings”, let’s see if I can connect the interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UoSHVltry7Z8GT_GmGgBTQ.png" /><figcaption>“Connected” is already checked when I view “edit settings” with the host powered off</figcaption></figure><p>Well, that’s interesting. “Connected is already checked when I view “edit settings” with the host powered off.</p><p>If I just power it back on, I’m right back to where I started with issues connecting the network interface and it throwing the “Failed to connect virtual device ‘ethernet0’.” error message if I attempt to check off “Connect” from the “edit settings” menu.</p><p>However, I discovered that with the host powered on, if I go back to the “edit settings” menu, I can then choose my “Host Segment 1 DHCP” network from the dropdown (WHICH IS THE NETWORK THAT IT’S ALREADY CONFIGURED TO USE!!), check off “Connect”, hit okay, and the OS will detect the interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoPTTzULJuyarMrdpvxbow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*q3W8_uwxICFyfwS4ek6IWw.png" /></figure><p>Well, that’s just great. I found a terrible workaround. <br>I’m trying to use Ansible to dynamically spin up 40+ hosts in VMC. It won’t make sense to run the Ansible playbook then log into the VSphere console and manually go and select a network from a dropdown box for each host.</p><p>This got me thinking. It feels like the network section from Ansible wasn’t being properly applied. I did the standard googling and tried a handful of things before I realized what the issue is. I didn’t RTFM on this one before starting.</p><p>My theory is that you can:<br><strong>A.</strong> Assign a nic and a network to a template and don’t configure networking via ansible<br><strong>B.</strong> Don’t assign a nic in the template and configure networking via ansible</p><p><strong>You can’t do both, I was trying to do both</strong></p><p>Maybe this is in the docs somewhere very obvious making this whole post worthless, I’m not sure.</p><p>With that theory, I commented out the “networks” block of the Ansible playbook and created a new host</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39c3a6482a802eae6263ddb27a8a12f4/href">https://medium.com/media/39c3a6482a802eae6263ddb27a8a12f4/href</a></iframe><p>After running the playbook w/ “networks” commented out, the new host comes up with the network connected, the OS is able to grab an IP and VMware tools picks it up. Success!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ue0UOsTxBC5IwtEZ_du5SQ.png" /></figure><p>About Dane Fetterman: Dane is an IT Cloud Architect in Philadelphia. He’s a fan of DevOps, Philadelphia, and his family, two dogs and two cats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4493ca2daafb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>