cd /tmp && \
mkdir auto-subtitle && cd auto-subtitle && \
python3 -mvenv venv && \
source venv/bin/activate && \
pip install git+https://github.com/m1guelpf/auto-subtitle.git && \
pip install ffmpeg-python && \
python3 auto_subtitle /path/to/video.mp4 -o subtitled/
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
wget \ | |
--mirror \ | |
--convert-links \ | |
--adjust-extension \ | |
--page-requisites \ | |
--no-parent --execute robots=off \ | |
--user-agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" \ | |
<url> |
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
//g++ main.cc -O3 -o test -lX11 && ./test | |
#include <chrono> | |
#include <iostream> | |
#include <string> | |
#include "CImg.h" | |
using namespace cimg_library; | |
int main(int argc,char **argv) { | |
const unsigned char white[] = { 255, 255, 255 }; |
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 | |
# reference: https://medium.com/@acrodriguez/one-liner-to-generate-a-markdown-toc-f5292112fd14 | |
function printusage { | |
echo "Usage: $0 <minimum-level> <maximum-level> <markdown-file.md>" | |
echo "" | |
echo "Example:" | |
echo " $0 2 5 README.md" | |
} |
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
# python3 -mvenv venv && source venv/bin/activate && pip install flask requests && python3 server.py | |
# open http://localhost:8080 | |
import flask | |
import requests | |
app = flask.Flask(__name__) | |
# To create a client ID/secret for Google oauth: | |
# 1. Go to the Google Cloud Console, | |
# 2. Create a project |
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
// https://rednafi.com/go/totp_client/ | |
// https://datatracker.ietf.org/doc/html/rfc6238 | |
use sha1::{Sha1}; | |
use hmac::{Hmac, Mac}; | |
use std::time::{SystemTime, UNIX_EPOCH}; | |
fn generate_totp(secret_key: &str, timestamp: u64) -> u32 { | |
// The base32 encoded secret key string is decoded to a byte slice |
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
/* From https://git.kernel.dk/cgit/liburing/tree/examples/list.h */ | |
#ifndef LIBURING_EX_LIST_H | |
#define LIBURING_EX_LIST_H | |
struct list_head { | |
struct list_head *prev, *next; | |
}; | |
#ifndef offsetof | |
#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) |
Ollama is a go utility to run LLM locally. Either in the terminal as a command line or through a REST API
Ollama : https://github.com/jmorganca/ollama
To use Mistral with Ollama:
Ollama + mistral : https://www.reddit.com/r/LangChain/comments/16vwilm/mistralai_llm_with_langchin/
Langchain is a python library to interface with various LLMs:
https://www.langchain.com/
Compile your zig library with:
zig build-lib -fPIE -fcompiler-rt -femit-h mylib.zig
-fcompiler-rt
: Needs to include a couple of implementation (especially true for debug)-femit-h
: generate a c header-fPIE
: gcc complains without it Compile your c program with"
cc -I/path/to/zig/lib/ -L. main.c -o test -lmylib