Skip to content

Instantly share code, notes, and snippets.

View spoutnik16's full-sized avatar
🦏
Focusing

Jérôme Hugon spoutnik16

🦏
Focusing
View GitHub Profile
@spoutnik16
spoutnik16 / compilemessages.py
Last active May 14, 2018 13:07
django-modeltranslation po file with makemessages and compilemessages
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import os
import django
import polib
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
@spoutnik16
spoutnik16 / french_grammar_tags.py
Last active May 14, 2018 13:07
django tempalte filter for french contraction for "à les", "à le", "à la"
from django import template
register = template.Library()
@register.filter(is_safe=False)
def à(value, upper=False, capitalize=False):
"""
French contraction for "à les", "à le", "à la"
@spoutnik16
spoutnik16 / pi_mount_usb.md
Last active August 7, 2018 11:02 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

sudo su root
apt update && apt upgrade -y
## open ssh server
apt install -y openssh-server
/etc/init.d/ssh start
systemctl start ssh
systemctl enable ssh
## apache2
@spoutnik16
spoutnik16 / artnet_middleware.py
Created June 26, 2020 10:11 — forked from alarrosa14/artnet_middleware.py
A Python ArtNet packet receiver that broadcasts its payload.
import sys
from socket import (socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR,
SO_BROADCAST)
from struct import pack, unpack
UDP_IP = "127.0.0.1"
UDP_PORT = 6454