Skip to content

Instantly share code, notes, and snippets.

View sgomez's full-sized avatar
😴
Compiling...

Sergio Gómez sgomez

😴
Compiling...
View GitHub Profile
@sgomez
sgomez / decrypt_pdfs.sh
Created February 12, 2026 06:49
Shell script to decrypt pdf files
#!/usr/bin/env bash
set -euo pipefail
# Decrypt encrypted PDFs matched by a glob pattern.
# - If a file is not encrypted, it is left unchanged.
# - If a file is encrypted, it is decrypted using the provided password.
# The original is preserved as "<name>.orig.pdf" and the decrypted output
# replaces the original filename.
# ---- Dependency check (qpdf) ----
@sgomez
sgomez / main.ts
Last active September 22, 2024 10:28
Telegram bot with Vercel SDK AI and ollama provider
import dotenv from "dotenv";
import { Telegraf } from "telegraf";
import { message } from "telegraf/filters";
import process from "node:process";
import { ollama } from "ollama-ai-provider";
import { generateText, type CoreMessage, type StreamTextResult } from "ai";
dotenv.config();