Skip to content

Instantly share code, notes, and snippets.

View sholtomaud's full-sized avatar
💭
Research

Sholto Maud sholtomaud

💭
Research
  • Sydney
View GitHub Profile
@sholtomaud
sholtomaud / llm-browser.py
Created July 10, 2024 01:11 — forked from jart/llm-browser.py
Using an LLM as an HTTP proxy with LLaMAfile
#!/usr/bin/env python
import socket
import threading
import subprocess
def handle_client(client_socket):
request = client_socket.recv(8192).decode('utf-8', errors='ignore')
first_line = request.split('\n')[0]
#!/usr/bin/env python
import boto3
import argparse
from operator import itemgetter
from collections import defaultdict
def nested_defaultdict():
return defaultdict(nested_defaultdict)
@sholtomaud
sholtomaud / gist:385a04b9b6eabc5e7374e514eb6a05eb
Created June 5, 2024 14:34 — forked from danilop/gist:6d49e2b6507f748a00a9
Amazon EC2 - user data to automatically mount an Amazon EFS file system at boot (Linux)
#cloud-config
package_upgrade: true
packages:
- nfs-utils
- httpd
- php
runcmd:
- echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).FILE_SYSTEM_ID.efs.us-west-2.amazonaws.com:/ /var/www/html/efs nfs4 defaults" >> /etc/fstab
- mkdir /var/www/html/efs
- mount -a
#!/bin/bash
usage() {
echo "Usage: $0 [-v <Ruth|Matthew|Amy>]" 1>&2
echo "Ruth : Female English (US) - Default" 1>&2
echo "Matthew : Male English (US)" 1>&2
echo "Amy : Female English (British)" 1>&2
exit
}
@sholtomaud
sholtomaud / code-stack.ts
Created August 3, 2022 15:54 — forked from sebsto/code-stack.ts
CDK Create EC2 instace in private subnet. Install Nginx.
import ec2 = require('@aws-cdk/aws-ec2');
import cdk = require('@aws-cdk/core');
import { Fn, Tag, Resource } from '@aws-cdk/core';
import { AmazonLinuxImage, UserData, InstanceType } from '@aws-cdk/aws-ec2';
import { Role, ServicePrincipal, ManagedPolicy, CfnInstanceProfile } from '@aws-cdk/aws-iam'
/**
* Create my own Ec2 resource and Ec2 props as these are not yet defined in CDK
* These classes abstract low level details from CloudFormation
@sholtomaud
sholtomaud / animated_svg.html
Created September 29, 2019 04:56 — forked from tylerneylon/animated_svg.html
Example of an animated geometric figure
<!DOCTYPE HTML>
<html>
<body>
<svg width="600" height="600" vertion="1.1"
id="svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="angleClip">
<polygon id="atriangle" />
</clipPath>
@sholtomaud
sholtomaud / animated_svg.html
Created September 29, 2019 04:56 — forked from tylerneylon/animated_svg.html
Example of an animated geometric figure
<!DOCTYPE HTML>
<html>
<body>
<svg width="600" height="600" vertion="1.1"
id="svg" xmlns="http://www.w3.org/2000/svg">
<defs>
<clipPath id="angleClip">
<polygon id="atriangle" />
</clipPath>
function update(account, id, schemaData, callback){
schemaData.companyId = account.companyId;
kgo
({
account: account,
id: id,
data: schemaData
})
node_modules
function update(account, id, schemaData, callback){
schemaData.companyId = account.companyId;
kgo
({
account: account,
id: id,
data: schemaData
})