Skip to content

Instantly share code, notes, and snippets.

View steren's full-sized avatar
🏃‍♀️

Steren steren

🏃‍♀️
View GitHub Profile
@steren
steren / browser.html
Created March 10, 2026 01:48
Web web browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CanvasSurf Browser</title>
<style>
/* Basic styling using vanilla CSS */
html, body {
height: 100%; /* Ensure html and body take full height */
@steren
steren / deploy.sh
Created November 11, 2025 05:15
Zip deploy
ACCESS_TOKEN=$(gcloud auth print-access-token)
PROJECT_ID="steren-serverless"
SERVICE_NAME="hello-zip-deploy-4"
REGION="us-central1"
GCS_BUCKET_NAME="steren-zip-deploy-test"
tar -czf app.tar.gz .
gcloud storage cp app.tar.gz gs://$GCS_BUCKET_NAME/app.tar.gz
@steren
steren / deploy-focus.sh
Last active June 30, 2024 18:05
Fooocus
docker pull ghcr.io/lllyasviel/fooocus:latest
docker tag ghcr.io/lllyasviel/fooocus:latest us-central1-docker.pkg.dev/steren-serverless/containers/fooocus:latest
docker push us-central1-docker.pkg.dev/steren-serverless/containers/fooocus:latest
gcloud alpha run deploy fooocus --image us-central1-docker.pkg.dev/steren-serverless/containers/fooocus --region us-central1 --gpu 1 --gpu-type nvidia-l4 --cpu 8 --memory 32Gi --no-cpu-throttling --max-instances 5 --set-env-vars CMDARGS=" --listen --port=8080" --allow-unauthenticated --execution-environment gen2
# Doesn't work with GCS mount:
# --add-volume name=gcs,type=cloud-storage,bucket=steren-fooocus --add-volume-mount volume=gcs,mount-path=/content/data
@steren
steren / Dockerfile
Last active July 4, 2024 18:25
llamafile container image
FROM ubuntu:22.04
RUN apt update -q && apt install -y ca-certificates wget
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
RUN dpkg -i cuda-keyring_1.1-1_all.deb
RUN apt-get update && apt-get -y install cuda
# Update this to the URL pointing at the llamafile you want to run.
# Find other models at https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#other-example-llamafiles
ENV LLAMAFILE_DOWNLOAD_URL="https://huggingface.co/jartine/Mistral-7B-Instruct-v0.2-llamafile/resolve/main/mistral-7b-instruct-v0.2.Q4_0.llamafile?download=true"
@steren
steren / Dockerfile
Last active June 18, 2024 14:04
TGI fast startup (WIP)
# Use official Huggingface TGI image (See https://huggingface.co/docs/text-generation-inference/en/quicktour)
FROM ghcr.io/huggingface/text-generation-inference:1.4
# Model to use. Customize with docker build --build-arg MODEL_HUB_ID=your model .
ARG MODEL_HUB_ID=tiiuae/falcon-7b-instruct
# Port to listen to
ARG PORT=8080
# Download model
RUN text-generation-server download-weights $MODEL_HUB_ID
@steren
steren / nginx.conf
Created November 3, 2022 23:59
nginx.conf with gzip enabled
server {
listen 8080;
server_name _;
gzip on;
location / {
proxy_pass http://127.0.0.1:8888;
}
}
@steren
steren / function.js
Created August 19, 2022 04:52
Firestore in Cloud Functions
const {Firestore} = require('@google-cloud/firestore');
const firestore = new Firestore();
exports.helloWorld = async (req, res) => {
const document = firestore.doc('users/steren');
const doc = await document.get();
console.log('Read the document');
res.status(200).send('Hey');
};
@steren
steren / enable-fb-hosting-cloud-run.sh
Last active March 26, 2022 19:14
Set up Firebase Hosting in front of a Cloud Run service
#!/bin/bash
# Set up Firebase Hosting in front of a Cloud Run service, without using the firebase CLI
# The following commands must be installed:
# - gcloud
# - curl
# - jq
# Update these variables
PROJECT_ID="enable-fb-hosting" # Make sure you have enabled Firebase on this Google Cloud project
@steren
steren / chunked.go
Created July 7, 2020 03:52
Transfer-Encoding: chunked
package main
import (
//"bytes"
//"io/ioutil"
"fmt"
"io"
"log"
"net/http"
"os"
@steren
steren / sterenfr.svg
Created May 6, 2020 20:47
steren.fr as SVG (printed as PDF then converted to SVG)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.