You can copy-paste the code in this document and simply replace the UPPERCASE vairables with your configurations.
This file contains hidden or 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
# You can change the base image if you don't need FastAPI or Uvicorn | |
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim | |
WORKDIR /app | |
RUN apt update | |
RUN apt install -y libpq-dev build-essential wget | |
ENV CONDA_DIR /opt/conda |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Created by: ZappaBoy | |
# Usage: ./check-host "your.domain" | |
# This simple script call the check-host.net API to check host status through ping, http, tcp and dns checks. | |
base_url='https://check-host.net' | |
headers="Accept: application/json" | |
sleep_time=10 |
This file contains hidden or 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
import argparse | |
import os | |
from typing import List | |
import openai | |
secret_key = os.environ.get("OPENAI_SECRET_KEY") | |
if not secret_key: | |
raise ValueError("Please set the OPENAI_SECRET_KEY environment variable") |
This file contains hidden or 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
song = [ | |
# Add here your song as tuples of (frequency, duration) or better (Hz, seconds) | |
# Check both: | |
# - Song example - https://gist.github.com/ZappaBoy/563533bb4d9a9cbc2709a75b84bc37fb | |
# - Output example - https://gist.github.com/ZappaBoy/701bbab166b0573b71be7e889f0af575 | |
] | |
def convert_song(notes): | |
lines = [] | |
for note in notes: |
This file contains hidden or 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
; Play Never Gonna Give You Up | |
; Add the following lines to your slicer software to play the songs. | |
M300 S494 P250 | |
M300 S554 P250 | |
M300 S587 P250 | |
M300 S494 P250 | |
M300 S0 P250 | |
M300 S659 P250 | |
M300 S740 P250 | |
M300 S659 P750 |
This file contains hidden or 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
# First of all install pysine: `python -m pip install pysine` | |
from pysine import sine | |
from song import song | |
def play_song(notes): | |
for note in notes: | |
frequency = note[0] | |
duration = note[1] / 1000 | |
sine(frequency=frequency, duration=duration) |
This file contains hidden or 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
# Run in background aliases | |
TMP_PID_PATH=/tmp/background.pid | |
function background(){ | |
echo "Running in background: $@" | |
nohup "$@" > /dev/null 2>&1 & echo $! > $TMP_PID_PATH | |
disown -a | |
} | |
alias background="background" | |
alias background-pid="cat \$TMP_PID_PATH" | |
alias background-kill="pkill -F \$TMP_PID_PATH" |
This file contains hidden or 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
# This is a really simple script that work with mangodl | |
# Please check and support it: https://github.com/Gyro7/mangodl | |
# Afted downloaded mangodl set a default directory if you prefer: | |
# mangodl --directory "$HOME/Documents/manga" | |
# Usages: | |
# | |
# Download only first chapter | |
# mangodlpdf "Chainsaw Man" |
This file contains hidden or 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
# This script convert pdf to a gif | |
# First parameter is the .pdf file and the second (optional) parameter is the delay between the images | |
# Hint: | |
# instead of copy the script simply add the pdf-to-gif function to your ~/.bash_aliases | |
# and add the line: alias pdf2gif="pdf-to-gif" | |
# Example: | |
# | |
# function pdf-to-gif(){ | |
# mkdir -p /tmp/pdf2gif/ |
NewerOlder