Skip to content

Instantly share code, notes, and snippets.

@atomicjets
atomicjets / basic_autogen_agent_llm.py
Created May 5, 2024 17:39 — forked from lestan/basic_autogen_agent_llm.py
AutoGen AI Agents with Local LLM served via Ollama
"""Author: https://github.com/lestan"""
"""Tested on AutoGen version 0.2.19"""
"""This is a basic working version of AutoGen that uses a local LLM served by Ollama"""
from autogen import AssistantAgent, UserProxyAgent, ConversableAgent
from autogen.coding import LocalCommandLineCodeExecutor, DockerCommandLineCodeExecutor
import os
from pathlib import Path
import pprint
#model = "mixtral:latest"
@atomicjets
atomicjets / .block
Created November 3, 2022 12:52 — forked from mbostock/.block
Zoomable Circle Packing
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@d3/d3-zoomable-circle-packing
@atomicjets
atomicjets / k3s_helm_install.sh
Created November 26, 2021 23:08 — forked from icebob/k3s_helm_install.sh
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
FROM: https://people.xiph.org/~greg/escrowexample.txt
2-of-2 escrow example
Carbide81 wants to pay carbide80 50tnbtc but prevent carebide80 from cheating him.
First each party creates a new address, and then shares them. Then uses the
resulting addresses to make a p2sh address (begins with '3' for bitcoin,
'2' for testnet) that requires both parties to sign to release:
@atomicjets
atomicjets / gist:e8d73c6e7bc0449aba0a
Created October 28, 2015 15:51 — forked from herrbuerger/gist:10961577
Rotating snapshots for Elasticsearch

Rotationg snapshots for Elasticsearch (poor-man's version)

This is a very basic method to do rotating snapshots for Elasticsearch. For this to work you will need to have jq installed (http://stedolan.github.io/jq/).

PLEASE, PLEASE, PLEASE don't put this blindly in your commandline and execute it :)

curl -s -S -XGET "localhost:9200/_snapshot/my_s3_repository/_all?pretty=true" | jq '.snapshots[] | .snapshot + " " + .end_time' | sed 's/^.\(.*\).$/\1/' | sort -k 2 -r | awk '{ if (NR > 1) { system("curl -XDELETE " "localhost:9200/_snapshot/my_s3_repository/"$1) } } END { system("curl -XPUT " "localhost:9200/_snapshot/my_s3_repository/`date +\%s`") }'

Details