Skip to content

Instantly share code, notes, and snippets.

View labeveryday's full-sized avatar
🎯
Focusing

Du'An Lightfoot labeveryday

🎯
Focusing
View GitHub Profile
@labeveryday
labeveryday / claude_2_1_example.py
Created March 28, 2024 00:45
Here is an example of sending a prompt to Claude 2.1 on Amazon Bedrock
# Docs https://docs.anthropic.com/claude/reference/messages_post
# Announcement: https://aws.amazon.com/blogs/machine-learning/unlocking-innovation-aws-and-anthropic-push-the-boundaries-of-generative-ai-together/
import boto3
import json
# Define bedrock
bedrock = boto3.client(
service_name="bedrock-runtime",
@labeveryday
labeveryday / lambda-layer.md
Created March 26, 2024 01:47
Here is a blog post on how to create a Lambda layer for LangChain

How to Create a Lambda Layer for LangChain

AWS Lambda layers allow you to package libraries and dependencies that can be shared across multiple Lambda functions. This can help reduce deployment package sizes and make it easier to manage common dependencies across your serverless applications. In this blog post, we'll walk through how to create a Lambda layer for the LangChain library, which can be used for building applications with large language models.

Step 1: Pull the AWS SAM Build Image

First, we'll need to pull the AWS SAM build image for Python 3.10 from the public Amazon ECR registry. Open your terminal and run:

sudo docker pull public.ecr.aws/sam/build-python3.10:1.110.0-20240222205900
@labeveryday
labeveryday / claude_3_example.py
Created March 4, 2024 19:53
Example of how to use python to access Claude 3 in Amazon Bedrock on AWS.
# Docs https://docs.anthropic.com/claude/reference/messages_post
# Announcement: https://aws.amazon.com/blogs/machine-learning/unlocking-innovation-aws-and-anthropic-push-the-boundaries-of-generative-ai-together/
import boto3
import json
# Define bedrock
bedrock = boto3.client(
service_name="bedrock-runtime",
@labeveryday
labeveryday / This is a script to update Godaddy name servers
Created February 15, 2024 13:45
update-go daddy-nameservers.py
"""
This script takes Terraform name server output and updates the nameservers for a domain in Godaddy to match the nameservers from AWS.
"""
import os
import json
import subprocess
import requests
import datetime
from dotenv import load_dotenv
@labeveryday
labeveryday / boto3_fix.py
Created September 7, 2023 21:42
To fix the PythonDeprecationWaarning in boto3
# To fix the PythonDeprecationWaarning
# /home/ec2-user/.local/lib/python3.7/site-packages/boto3/compat.py:82: PythonDeprecationWarning: Boto3 will no longer support Python 3.7 starting December 13, 2023.
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
@labeveryday
labeveryday / example_oop.py
Last active May 4, 2022 12:52
Example of Object Oriented Programming in Python
# Here is an example of OOP in Python
class Device:
"""First we define a class with attributes.
Self represents the class itself. We can use this to reference attributes
and methods from within the class"""
def __init__(self, name, ip):
self.name = name
self.ip = ip
def print_name(self):
@labeveryday
labeveryday / toronto-usergroup.md
Last active September 14, 2022 16:48
Same ec2 user data
#!/bin/bash
sudo yum update -y
sudo yum install -y httpd
sudo service httpd start
sudo chkconfig httpd on
sudo chmod o+w /var/www/html
public_ip=$(curl 'http://169.254.169.254/latest/meta-data/public-ipv4' -w "\n")
sudo echo "<h1>Welcome to Amazon VPC for DevNet Snack Minute. This is your EC2 instance and ip address is $public_ip.</h1>" > /var/www/html/index.html
sudo echo "AWS_DEFAULT_REGION=us-west-2"&gt;&gt;/etc/environment
@labeveryday
labeveryday / devcor-checklist.md
Last active November 20, 2021 20:03
DEVCOR lab checklist

Developing Applications using Cisco Core Platforms and APIs v1.0 (350-901) Checklist

This is a lab checklist to help you prepare for your DEVCOR exam.

If you have questions please feel free to contact me.

Exam topics and Labs

Link to the labs: DevCor Exam Topics and Labs

@labeveryday
labeveryday / AdvanceNetworkEngineer.md
Last active June 8, 2021 23:22
How to advance your network engineer career?

This is a gist of questions related to advancing your network engineer career.

  • Best items to build a home lab on a budget? - @thelaymansterms

  • I’d like to know what folks think of Azure monitoring tools. Networking is my weakest skill set, but I’m supporting more and more Azure based apps and environments and wanted to know folks real world experience with things like Azure Monitor or application insights. - @XDoesntCare

  • How do I jump into the field with limited hands on experience? Currently hold the Net+, Sec+ and will(speaking it into existence) get the CCNA later this summer. - @SS_Zoeboy

@labeveryday
labeveryday / DevAdvocates.md
Last active May 28, 2021 16:32
Cisco DevNet Developer Advocates