Skip to content

Instantly share code, notes, and snippets.

View progressify's full-sized avatar
🇮🇹

Antonio Porcelli progressify

🇮🇹
View GitHub Profile
@emanuellopes
emanuellopes / gmk87-manual.md
Last active September 8, 2025 07:01 — forked from Joao-Peterson/gmk67-manual.md
GMK67 manual (English)
// From https://github.com/WebBluetoothCG/demos/blob/gh-pages/bluetooth-printer/index.html
var SERVICE = '000018f0-0000-1000-8000-00805f9b34fb';
var WRITE = '00002af1-0000-1000-8000-00805f9b34fb';
var DATA = ''
+ '\x1B' + '\x61' + '\x31' // center align
+ '\x1D' + '\x21' + '\x11' + 'Hello\nBluetooth!\n\n' // double font size
+ '\x1D' + '\x21' + '\x00' + '... from your friends\nat https://qz.io' // normal font size
+ '\n\n\n\n\n\n\n'; // feed paper
@althonos
althonos / setup.cfg
Last active August 12, 2025 17:32
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@abiosoft
abiosoft / Caddyfile
Created September 18, 2016 16:16
Caddy wordpress docker-compose
:80
root /usr/src/wordpress
gzip
fastcgi / wordpress:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
log stdout
errors stderr
@Iman
Iman / clean.sh
Last active September 12, 2025 01:49
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/usr/bin/env bash
# Ubuntu Server or VM Cleaner. Safe by default; aggressive when asked.
# Example safe: sudo ./clean.sh
# Example aggressive: sudo JOURNAL_DAYS=3 AGGRESSIVE=1 ./clean.sh
# Enable Docker image prune (images only): sudo ./clean.sh --docker-images
# Tested on Ubuntu 20.04, 22.04, 24.04 (server/VM images).
set -Eeuo pipefail
trap 'rc=$?; echo "Error on line $LINENO: $BASH_COMMAND (exit $rc)"; exit $rc' ERR
IFS=$'\n\t'
@gesquive
gesquive / self-update-script.py
Last active November 3, 2024 09:35
Stick this in a python script to self update the script from an online source
def update(dl_url, force_update=False):
"""
Attempts to download the update url in order to find if an update is needed.
If an update is needed, the current script is backed up and the update is
saved in its place.
"""
import urllib
import re
from subprocess import call
def compare_versions(vA, vB):
@carlohamalainen
carlohamalainen / joomla_password.py
Created May 6, 2013 03:40
Create a Joomla password hash/salt entry using Python
import getpass
import hashlib
import random
import string
password = getpass.getpass('password (not echoed): ')
salt = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(32))
password_hash = hashlib.md5(password + salt).hexdigest()
print "update CHANGEME_users set password='" + password_hash + ':' + salt + "' where id = ...;"