This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os/exec" | |
"sort" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |