Skip to content

Instantly share code, notes, and snippets.

@timrprobocom
timrprobocom / AveryLabels.py
Last active March 13, 2024 18:18
A class to manage printing on Avery labels with ReportLab
import os
from collections.abc import Iterator
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER, landscape
from reportlab.lib.units import inch
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# Usage:
# label = AveryLabels.AveryLabel(5160)
@zeegin
zeegin / maintenance.bat
Created April 2, 2019 22:58
1c postgres maintenance and backup for windows
@echo off
chcp 65001 > nul
set E1C_RAS=localhost:3545
set E1C_RAC=C:\Program Files\1cv8\current\bin\rac.exe
set DB_SERVER=localhost:3541
set DB_NAME=1C_DATABASE
set DB_USER=1C_ADMINISTRATOR
set DB_PWD=1C_PASSWORD
set PGUSER=PG_ADMINISTRATOR
@lgaetz
lgaetz / lgaetz-didloopback.php
Last active July 28, 2022 16:25
Asterisk AGI file for a FreePBX system that examines outbound dialed digits against inbound DIDs specified in inbound routes. With Asterisk dial plan, it can be used to redirect outbound calls back in for local DIDs.
#!/usr/bin/php -q
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*
* Latest Version: https://gist.github.com/lgaetz/8633920
*
* Description:
*
* Script lgaetz-didloopback.php is used on a FreePBX server, with custom dialplan that calls
@jasny
jasny / mysql_splitdump.sh
Last active February 15, 2024 16:13
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit