Skip to content

Instantly share code, notes, and snippets.

View drnic's full-sized avatar
🏆
Platinum Status Level

Dr Nic Williams drnic

🏆
Platinum Status Level
View GitHub Profile
# Must have conda installed
# It costs approximately $0.2 (in GPT-4 API fees) to generate one example with analysis and design, and around $2.0 for a full project.
conda create -n metagpt python=3.11.4
conda activate metagpt
npm --version # to check you have npm installed
# optional: install node if you don't have it
npm install -g @mermaid-js/mermaid-cli
git clone https://github.com/geekan/metagpt
cd metagpt
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@drnic
drnic / convert-to-credhub.sh
Last active December 20, 2017 11:09
Convert a ci/settings.yml with `(( vault "/secret/mything" ))` into concourse cred mgmt + a credhub import file
#!/bin/bash
cd ${1:?USAGE: convert-to-credhub.sh path/to/ci}
function indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";;
*) sed -u "$c";;
esac
@Amit-PivotalLabs
Amit-PivotalLabs / bosh-links-why-and-how.md
Last active August 20, 2024 07:31
BOSH Links: Why and How
require 'psych'
def tree o, options = {}
visitor = Psych::Visitors::YAMLTree.create options
visitor << o
visitor.tree
end
# create a YAML AST from a Ruby object
my_object = [ "(( foo ))" ]
@frodenas
frodenas / cf-170-openstack.yml
Last active August 29, 2015 14:01
Cloud Foundry v170 deployment manifest for OpenStack
<%
director_uuid = 'CHANGEME'
static_ip = 'CHANGEME'
root_domain = "#{static_ip}.xip.io"
deployment_name = 'cf'
cf_release = '170'
protocol = 'http'
common_password = 'c1oudc0wc1oudc0w'
%>
---
@frodenas
frodenas / cf.yml
Created May 5, 2014 18:29
CloudFoundry (small) deployment manifest for Google Compute Engine
<%
director_uuid = 'CHANGEME'
static_ip = 'CHANGEME'
root_domain = "#{static_ip}.xip.io"
deployment_name = 'cf'
cf_release = '170'
protocol = 'http'
common_password = 'c1oudc0wc1oudc0w'
%>
---
#!/bin/bash
aws cloudformation create-stack --stack-name test-vpc --template-body file://vpc.json
@anynines-gist
anynines-gist / bosh_sql_snippet
Last active August 15, 2024 15:15
Use Bosh to manually change the IP of your Cloud Foundry domains for a second deployment
# First insert the domains to the powerdns database used by bosh
insert into domains(name,type) values('a9s.eu','NATIVE');
insert into domains(name,type) values('a9sapp.eu','NATIVE');
# Then insert the required dns settings
# You need to replace the domain name and the domain_id. We're using *.de.a9s.eu as Cloud Foundry
# domain and *.de.a9sapp.eu as app domain.
insert into records(name,type,content,ttl,change_date,domain_id)
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key