Skip to content

Instantly share code, notes, and snippets.

@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
@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__)
@blaylockbk
blaylockbk / multipro_template.py
Last active April 18, 2024 04:28
Template for Python multiprocessing and multithreading
import multiprocessing #:)
def do_this(number):
print number
return number*2
# Create a list to iterate over.
# (Note: Multiprocessing only accepts one item at a time)
some_list = range(0,10)
@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