Skip to content

Instantly share code, notes, and snippets.

@BigglesZX
BigglesZX / gifextract.py
Created November 5, 2012 10:31
Extract frames from an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -
@marselester
marselester / resize_animated_gif.py
Created July 18, 2013 14:06
Resize animated gif by Wand (ctypes-based simple ImageMagick binding for Python).
# http://docs.wand-py.org
from wand.image import Image
with Image(filename='original.gif') as img:
img.rotate(90)
img.resize(150, 150)
img.save(filename='converted.gif')
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
@cbcafiero
cbcafiero / replacements.py
Last active November 3, 2022 09:00
Easy multiple search and replace by tag and attribute with BeautifulSoup
"""
Sometimes you want to make several different replacements. Search by tag with
optional attributes. Replace with tag with optional attributes.
Thank you to Dan @ University of Exeter for bug fix
"""
from bs4 import BeautifulSoup
REPLACEMENTS = [('b', {}, 'strong', {}),
@AlexeySetevoi
AlexeySetevoi / build-nginx-geoip2-deb.sh
Last active April 17, 2020 11:33
nginx geoip2 debian
#!/bin/bash
nginxver=`apt show nginx-full |grep Version | awk '{print $2}' |awk -F '-' '{print $1}'`
nginxname=nginx-$nginxver.tar.gz
nginxdir=nginx-$nginxver
#apt -y install libmaxminddb0 libmaxminddb-dev mmdb-bin
if [ -f "$nginxname" ]
@victoraguilarc
victoraguilarc / prestashop-nginx.conf
Last active March 24, 2020 10:31
NGINX Configuration for Prestashop 1.7.3, its works fully
server {
charset utf-8;
#listen <YOUR_IP>:80;
server_name <YOUR_DOMAIN> www.<YOUR_DOMAIN>;
root /PATH/TO/YOUR/PRESTASHOP/INSTALLATION;
index index.php;
access_log /var/log/nginx/domains/<YOUT_DOMAIN>.log combined;
@sutlxwhx
sutlxwhx / README.md
Last active March 13, 2024 14:44
Enable RDP and access to the virtual machines for your Proxmox installation

Introduction

This tuturial will help you configure network for your fresh Proxmox istallation.
Be aware that Proxmox configuration was made using this tutorial.

Installation

Backup your current /etc/network/interfaces using this command:

cp /etc/network/interfaces /etc/network/interfaces.backup
@dimMaryanto93
dimMaryanto93 / 01-network-manager-all.dhcp.yml
Last active January 23, 2021 10:30
network settings for ubuntu 18.04 server with wifi and ethernet
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: yes
dhcp6: no
optional: false
@MikeeI
MikeeI / geekbench5.sh
Last active September 12, 2023 10:04
Script - Geekbench 5
#!/bin/bash
wget http://cdn.geekbench.com/Geekbench-5.4.5-Linux.tar.gz
tar -zxvf Geekbench-5.4.5-Linux.tar.gz
cd Geekbench-5.4.5-Linux
./geekbench_x86_64
echo END
@jianyun8023
jianyun8023 / book-convert.sh
Created April 21, 2022 10:36
ebook convert base on eCore
#!/bin/bash
workdir=$(pwd)
filepath=$1
format=$2
outdir=$3
book_convert(){
filepath=$1
format=$2
tmp_dir="$HOME/Downloads/eCoreCmdtmp/$(uuidgen)"
mkdir -p $tmp_dir