Skip to content

Instantly share code, notes, and snippets.

@JarbasAl
JarbasAl / llama_intents.py
Created October 6, 2023 20:51
a intent parser using llama.cpp and mistral-7b
import json
from typing import List
from llama_cpp import ChatCompletionMessage, Llama, LlamaGrammar
TRAINING_INTENTS = [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
@mberman84
mberman84 / gist:d40d3e5c0e649d26dcd3dd0163e9d8d0
Created August 15, 2023 14:42
Generative Agents Installation
# must have conda installed
git clone https://github.com/joonspk-research/generative_agents.git
cd generative_agents
# open visual studio code, open gen agents folder
# within vscode, go to reverie/backend_server
# create new file utils.py
# copy/paste contents from github (below)
###
# Copy and paste your OpenAI API Key

Loki is a complex, unfriendly service that can sometimes store your logs. It does this via multiple services to handle the overhead of working with unstructured text inherent to working with logs. Its a massive set of microservices with the operational complexity inherent to the larger k8s ecosystem (read: upstream answers all questions in terms of kubernetes), but with some effort it can be made to run on Nomad.

{
"cniVersion": "0.4.0",
"name": "macvlan-plex",
"plugins": [
{
"type": "macvlan",
"master": "enp3s0f0v1",
"ipam": {
"type": "dhcp"
}
@sgtoj
sgtoj / aws_sso.py
Last active February 13, 2024 18:58
AWS SSO Credentials File Updater for AWS SDKs
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@tkalus
tkalus / delete_iam_user.py
Last active September 17, 2023 08:17
Delete an IAM User from an AWS Account
#!/usr/bin/env python3
"""
Delete an IAM User from an AWS Account.
Copyright (c) 2019 TKalus <tkalus@users.noreply.github.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
@ruanbekker
ruanbekker / golang_array_random.go
Created April 3, 2019 09:37
Golang: Select random string from array
// https://www.socketloop.com/tutorials/golang-randomly-pick-an-item-from-a-slice-array-example
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
@jtroberts83
jtroberts83 / CreateAllBadTagPolicies.py
Created March 19, 2019 21:02
Python Script to create all policies to find bad tags for cloud custodian
AWSServicesArray = ["account","acm-certificate","alarm","ami","app-elb","app-elb-target-group","asg","backup-plan","batch-compute","batch-definition","cache-cluster","cache-snapshot","cache-subnet-group","cfn","cloud-directory","cloudhsm-cluster","cloudsearch","cloudtrail","codebuild","codecommit","codepipeline","config-rule","customer-gateway","datapipeline","dax","directconnect","directory","distribution","dlm-policy","dms-endpoint","dms-instance","dynamodb-backup","dynamodb-stream","dynamodb-table","ebs","ebs-snapshot","ec2","ec2-reserved","ecr","ecs","ecs-container-instance","ecs-service","ecs-task","ecs-task-definition","efs","efs-mount-target","eks","elasticbeanstalk","elasticbeanstalk-environment","elasticsearch","elb","emr","eni","event-rule","event-rule-target","firehose","fsx","fsx-backup","gamelift-build","gamelift-fleet","glacier","glue-connection","glue-dev-endpoint","health-event","healthcheck","hostedzone","hsm","hsm-client","hsm-hapg","iam-certificate","iam-group","iam-policy","iam-profile","
@Chandler
Chandler / slack_history.py
Last active March 26, 2024 14:35
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages