Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" install pdftoppm first (use your package manager) """
import os
def main(start="."):
for dirpath, dirnames, filenames in os.walk(start):
for filename in filenames:
if filename.endswith('pdf') and not filename.startswith('.') and f'{filename}.jpg' not in filenames:
os.system(f'pdftoppm -jpeg -f 1 -l 1 "{dirpath}/{filename}" > "{dirpath}/{filename}.jpg"')
@erral
erral / index.md
Last active October 13, 2022 04:22
How to deploy Volto sites automatically in non-docker scenarios
@erral
erral / jabetza-pribatutik-ezagutza-kolektibora.md
Last active September 28, 2022 07:50
Jabetza pribatutik ezagutza kolektibora: lizentziei buruzko mahaingurua
@erral
erral / docker-compose.yml
Last active January 9, 2023 11:03
mysql eta adminer interfazea martxan jartzeko docker-compose.yml fitxategia
# copy this file to a folder and name it docker-compose.yml
# run the services with the following command:
#
# $ docker compose up
#
# You will have a mysql server running on 3306 and an adminer interface con 8081
#
# It will create a default databse called mydb and a username called mydb_user with password mydb_pass
# with permissions to manage the database
@erral
erral / Mailhog Bash Script (systemd)
Last active January 16, 2023 07:44 — forked from bouassaba/Mailhog Bash Script (systemd)
Mailhog setup with systemd. Copy and paste this to a terminal in your computer. It will start a MailHog server listening on port 25 and a web based interface listening on port 8025
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
sudo wget --quiet -O /usr/local/bin/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
# Make it executable
sudo chmod +x /usr/local/bin/mailhog
@erral
erral / tg.py
Last active July 6, 2021 21:56 — forked from juananpe/tg.py
Telegram notifier
# Twutter: https://twitter.com/juanan/status/1363860121676353537
# pip install python-telegram-bot
# Haria desagertzen bada ere, hemen azalpena:
# 1) Si no lo has creado aún, crea tu bot usando @BotFather en Telegram y copia tu APITOKEN
# 2) Obtén un webhook de usar y tirar aquí: https://webhook.site Te asignará una URL aleatoria, guárdala
# 3) Asigna el webhook a tu bot (la URL de http://webhook.site) https://api.telegram.org/botAPITOKEN/setWebhook?url=https://webhook.site...
# 4) Copia este mini script python a tu home directory https://gist.github.com/juananpe/edee47d41ed16c0a00eb820e0135bed3
@erral
erral / update_jitsi_meet_translation_json.py
Last active June 21, 2021 07:09
Update jitsi-meet translation files with the new messages
# -*- coding: utf-8 -*-
"""
This script takes the main.json file, compares it with the json file provided
as a parameter and adds the missing keys to the provided file.
This way the language files can be updated without losing the existing translations.
The result of the script is a new file, this way the original file is left untouch.
"""
#!/usr/bin/python3.7
from git import Actor
from git import Repo
import datetime
import os
import time
import json
import requests
@erral
erral / buildout.cfg
Last active April 27, 2018 11:40
collective.documentviewer with celery and redis on Plone 5
[buildout]
projectname = plone5
extensions =
mr.developer
show-picked-versions = true
parts +=
instance
@erral
erral / buildout.cfg
Last active April 27, 2018 11:40
collective.documentviewer with celery and redis on Plone 4
[buildout]
projectname = plone4
extensions =
mr.developer
show-picked-versions = true
parts +=
instance