This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# Script to auto-detect file encoding and convert it to UTF-8. | |
# Uses cchardet which provides very good detection. | |
# | |
# Newest version can always be found at: | |
# https://gist.github.com/pawelszydlo/936d9f2cf15d04ab80a0705d1a1bef93 | |
import cchardet | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ip netns list | grep "vpnspace" > /dev/null; then | |
echo "Namespace already exists." | |
exit 1 | |
fi | |
# IP address of your external interface | |
INTERNET_IP=192.168.0.101 | |
# VPN configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for cleaning MacOS related trash (dot files and folders) | |
# from a removable disk and unmounting that disk. | |
# Script does sanity checks, should be safe, but use at your own risk! | |
# Newest version can always be found at https://gist.github.com/pawelszydlo/5eacd49d7e57bce71e96171e9fad1cd2 | |
# Display a dialog box. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for simultaneous streaming and saving output from Raspberry Pi camera. | |
# newest version at: https://gist.github.com/pawelszydlo/ee6d317b2d6f37e32a93f97a3d5615d0 | |
date=`date +%Y-%m-%d_%H-%M-%S`i | |
recordings_dir="/home/pi/recordings" | |
stream_dir="$recordings_dir/$date" | |
min_disk_space=200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Clears finished downloads from Transmission. | |
# Version: 1.1 | |
# | |
# Newest version can always be found at: | |
# https://gist.github.com/pawelszydlo/e2e1fc424f2c9d306f3a | |
# | |
# Server string is resolved in this order: | |
# 1. TRANSMISSION_SERVER environment variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Script for dumping Bluetooth pairings from OS X to a registry file, for Windows | |
import. This will allow you to have your Bluetooth devices paired with both | |
operating systems at the same time. | |
In case of problems with Windows registry entries: pair your device with Windows | |
first, then with OS X, and then do the dump and import. | |
Latest version can be found at: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import ImageField | |
from django.db.models import signals | |
from django.db.models.fields.files import ImageFieldFile | |
from PIL import Image | |
import os | |
def name_thumb(str): | |
""" Function for generating thumbnail name from original file. """ |