Skip to content

Instantly share code, notes, and snippets.

View joelhans's full-sized avatar

Joel Hans joelhans

View GitHub Profile
$ sky launch -c mixtral ./azure_serve.yaml
Task from YAML spec: ./azure_serve.yaml
I 03-20 09:31:10 optimizer.py:691] == Optimizer ==
I 03-20 09:31:10 optimizer.py:702] Target: minimizing cost
I 03-20 09:31:10 optimizer.py:714] Estimated cost: $7.3 / hour
I 03-20 09:31:10 optimizer.py:714]
I 03-20 09:31:10 optimizer.py:837] Considered resources (1 node):
I 03-20 09:31:10 optimizer.py:907] --------------------------------------------------------------------------------------------------------
resources:
cloud: azure
accelerators: {A100-80GB:2, A100-80GB:4, A100:8, A100-80GB:8}
ports: 8000
setup: |
conda activate mixtral
if [ $? -ne 0 ]; then
conda create -n mixtral -y python=3.10
conda activate mixtral
@joelhans
joelhans / docker-compose.yml
Last active November 13, 2018 21:25
My self-hosting `docker-compose.yml` file. To use, 1) set up your DNS, 2) replace domain/email fields, 3) execute `docker-compose up -d`. Should work.
version: '2'
services:
portainer:
image: portainer/portainer
container_name: portainer
restart: always
environment:
- VIRTUAL_HOST=docker.DOMAIN.TLD
#
# provision_server.yaml
# Author: Joel Hans, for SSD Nodes
#
# This script aims to accomplish a few simple tasks:
# * Create a new user with `sudo` access
# * Enable SSH key-based authentication
# * Harden SSH with some simple-but-logical options
# * Install a few packages for convenience
#
@joelhans
joelhans / gist:4745894
Last active December 12, 2015 08:39
Looping over types of pages in Middleman with sitemap + regex.

Middleman doesn't yet support multiple blogs, so on my portfolio, I needed a way to loop through my "work" items in a reliable way. I didn't want to have to mess with a bunch of code just when I was adding a new project to the mix. Thanks to Middleman's sitemap feature, and a little Googling, I figured out a way. In Haml:

- sitemap.resources.each do |page|
  - if page.url =~ /^(\/work\/)/
    =link_to page.data.title, page.url

Basically, this loops through every page in the sitemap and filters out everything that doesn't contain the string in the regex. The string I'm looking for here is "/work/". Edit accordingly, and remember that forward slashes (these guys: /) must be escaped with a backslash (one of these: ).