Skip to content

Instantly share code, notes, and snippets.

@Kamik
Kamik / AveryLabels.py
Created February 16, 2024 11:53 — forked from timrprobocom/AveryLabels.py
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)
@Kamik
Kamik / cihan.py
Created February 22, 2023 10:28 — forked from bitnik/cihan.py
Scan pdfs and rename them according to data in barcodes they contain.
import tempfile
import glob
import argparse
# import xlrd
import pandas
from os.path import join, basename
from shutil import copyfile
from pdf2image import convert_from_path # , convert_from_bytes
from pyzbar.pyzbar import decode
# from PIL import Image
@Kamik
Kamik / clean-up-boot-partition-ubuntu.md
Created November 12, 2022 01:47 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@Kamik
Kamik / maintenance.bat
Created February 23, 2020 12:13 — forked from zeegin/maintenance.bat
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
@Kamik
Kamik / interfaces
Created July 10, 2019 22:38 — forked from hazanjon/interfaces
Hetnzer Network Interface settings for Proxmox and pfSense
### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0 ##Hetzner Interface
iface eth0 inet static
address <Main IP>
broadcast <Broadcast IP>
@Kamik
Kamik / prestashop.conf
Created August 10, 2017 12:11 — forked from julienbourdeau/prestashop.conf
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@Kamik
Kamik / mysql_splitdump.sh
Created May 27, 2016 06:32 — forked from jasny/mysql_splitdump.sh
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
@Kamik
Kamik / n98-magerun.yaml
Created April 11, 2016 09:49 — forked from paales/n98-magerun.yaml
Export a Magento database without the products or without the categories, place this file in app/etc/. Docs about creating a custom dump command: https://github.com/netz98/n98-magerun/wiki/Stripped-Database-Dumps
commands:
N98\Magento\Command\Database\DumpCommand:
table-groups:
- id: products
description: Skip all product tables.
tables: >
catalog_category_product*
catalog_compare_item
catalog_product_*
cataloginventory_stock_*
@Kamik
Kamik / shell_delete_unused_images
Created April 8, 2016 17:31 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
# use this inside lib/Zend to make the version of ZF usable with php 5.6
sed -i "s/'internal_encoding'/'default_charset'/g" ./XmlRpc/Client.php ./Service/Audioscrobbler.php ./Service/Technorati.php ./Locale/Format.php ./Validate/Hostname.php ./Validate/StringLength.php