Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@angelospanag
angelospanag / index.html
Last active April 3, 2023 22:31
FastAPI with HTMX partials
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://unpkg.com/htmx.org@1.8.6"></script>
<style>
body {
background-color: #222;
color: #fff;
font-family: Arial, sans-serif;
@angelospanag
angelospanag / main.py
Last active February 21, 2023 23:04
Screenshot a window on Windows and OCR using Python and Tesseract
"""
Requires installation of Tesseract for Windows: https://github.com/UB-Mannheim/tesseract/wiki
"""
import pyautogui
import pytesseract
import win32gui
# Get the handle of the window you want to capture
window_handle = win32gui.FindWindow(None, "Task Manager")
@angelospanag
angelospanag / books.html
Created February 20, 2023 21:58
HTMX trigger examples
<div>
<ul>
{%for element in elements %}
<li>{{element}}</li>
{% endfor %}
</ul>
</div>
@angelospanag
angelospanag / install-protonmail-bridge-deb.sh
Created February 22, 2021 16:17
Script to install Protonmail on Ubuntu/Debian using a deb file
#!/bin/sh
# Script to install Protonmail on Ubuntu/Debian using a deb file
# Also seen on https://protonmail.com/support/knowledge-base/installing-bridge-linux-deb-file/
# deb filename
DEB_FILENAME="protonmail-bridge_1.6.3-1_amd64.deb"
# Download Protonmail Bridge deb
wget https://protonmail.com/download/bridge/${DEB_FILENAME}
@angelospanag
angelospanag / add_user_disabled_password_ssh_access.sh
Created March 19, 2019 11:47
Add a custom user to Ubuntu with sudo privileges, disabled password and SSH access
# Create user with disabled password
sudo adduser angelospanag --disabled-password
# Switch to the new custom user (example angelospanag)
sudo su - angelospanag
# Create .ssh folder
cd
mkdir .ssh
chmod 700 .ssh
@angelospanag
angelospanag / install_docker_ubuntu.sh
Last active March 19, 2019 11:50
Install latest stable Docker daemon to an Ubuntu instance
#!/bin/bash
# Also seen here:
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# https://docs.docker.com/install/linux/linux-postinstall/
sudo apt-get update
sudo apt-get -y install \
apt-transport-https \