Skip to content

Instantly share code, notes, and snippets.

@stzsch
stzsch / main.go
Created May 2, 2023 18:18
mullvad ping windows
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os/exec"
"sort"
"strconv"
@stzsch
stzsch / ffmpeg_split_audio.sh
Created April 11, 2023 14:14
Split audio extracted with ytdlp using youtube timestamps saved as csv
#!/bin/bash
# Function to sanitize a string by removing invalid characters
sanitize_filename() {
local filename="$1"
# Replace invalid characters with underscore
filename="${filename//[^a-zA-Z0-9_.-]/_}"
echo "$filename"
}
@stzsch
stzsch / Dockerfile
Last active May 7, 2024 15:41
stable-diffusion-webui
# https://gist.github.com/stzsch/2abfecdacc2aa0ef94584d2241b59adc
FROM alpine AS xformers-downloader
RUN apk add parallel aria2
RUN aria2c -x 5 --dir / --out wheel.whl 'https://files.pythonhosted.org/packages/bb/6b/3f65a46b9d25e7fbcc3385f8b8e69e940b3b547697f74e07ab9c1656640a/xformers-0.0.17.dev466-cp310-cp310-manylinux2014_x86_64.whl'
# Download stable-diffusion repository on alpine/git image
FROM alpine/git AS stable-diffusion-downloader
ENV STABLE_DIFFUSION_COMMIT_HASH=47b6b607fdd31875c9279cd2f4f16b92e4ea958e
WORKDIR /
RUN git clone https://github.com/Stability-AI/stablediffusion.git \
@stzsch
stzsch / Dockerfile
Last active March 12, 2023 19:54
text-generation-webui-docker
FROM python:3.10-slim
# set bash as current shell
RUN chsh -s /bin/bash
SHELL ["/bin/bash", "-c"]
# Install necessary packages
RUN apt-get update && \
apt-get install -y wget git
@stzsch
stzsch / magzdb-dl.py
Created November 4, 2019 21:12
magzdb.org download
# Must have wget installed on system
# Instructions: login on magzdb.org and export your cookies to a cookies.txt file on the same directory as the gist, then run it
import requests
from bs4 import BeautifulSoup
url = 'http://magzdb.org'
# TODO: make mag a cmd parameter
mag = '/j/1341' # 2600 Hackers Quarterly
r = requests.get(url+mag)
@stzsch
stzsch / fbfeed2csv.py
Created December 6, 2017 16:21 — forked from yuzawa-san/fbfeed2csv.py
fbfeed2csv: a tool to download all posts from a user/group/page's facebook feed to a csv file
"""
fbfeed2csv: a tool to download all posts from a user/group/page's facebook feed to a csv file
yuzawa-san
https://github.com/yuzawa-san
"""
import json
import urllib2
import time
import csv