Skip to content

Instantly share code, notes, and snippets.

@jpawlowski
jpawlowski / install_cups+airprint_centos7.md
Last active November 18, 2023 13:17
Install and configure CUPS 2.1.2 on CentOS 7 (LXC running on Proxmox VE) host including AirPrint

Basic setup, e.g. enable ssh

yum -y install epel-release
yum -y upgrade
yum -y install openssh-server net-tools iputils psmisc less which man mc bash-completion bash-completion-extras bash-argsparse bind-utils traceroute htop mtr
echo "export HISTTIMEFORMAT='%F %T  '" > /etc/profile.d/history.sh
echo "export HISTIGNORE='ls -l:pwd:date:'" >> /etc/profile.d/history.sh
echo "export HISTCONTROL=ignoredups" >> /etc/profile.d/history.sh
systemctl enable sshd
systemctl start sshd
@blaylockbk
blaylockbk / multipro_template.py
Last active May 20, 2024 16:39
Template for Python multiprocessing and multithreading
import multiprocessing
from multiprocessing.dummy import Pool as ThreadPool
import numpy as np
def my_multipro(items, func, max_cpus=12):
"""Do an embarrassingly parallel task using multiprocessing.
Use this for CPU bound tasks.
@brizandrew
brizandrew / server.py
Last active December 19, 2023 10:16
Simple Flask Webhook Example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, request
from urllib import unquote_plus
import json
import re
app = Flask(__name__)
@henriquebastos
henriquebastos / python-guide.sh
Last active March 27, 2023 19:23
The definitive guide to setup my Python workspace
# The definitive guide to setup my Python workspace
# Author: Henrique Bastos <henrique@bastos.net>
# Updated: 2022-07-14 for reference.
PY3=3.10.4
PY3TOOLS="youtube-dl s3cmd fabric pytest poetry requests"
VENVS=~/.ve
PROJS=~/workspace