Skip to content

Instantly share code, notes, and snippets.

Avatar
🦏
Focusing

Jérôme Hugon spoutnik16

🦏
Focusing
View GitHub Profile
@spoutnik16
spoutnik16 / artnet_middleware.py
Created Jun 26, 2020 — forked from alarrosa14/artnet_middleware.py
A Python ArtNet packet receiver that broadcasts its payload.
View artnet_middleware.py
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
View owncloud install on raspberry pi
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 / pi_mount_usb.md
Last active Aug 7, 2018 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi
View pi_mount_usb.md

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

@spoutnik16
spoutnik16 / french_grammar_tags.py
Last active May 14, 2018
django tempalte filter for french contraction for "à les", "à le", "à la"
View french_grammar_tags.py
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 / foo.py
Last active Jun 9, 2019 — forked from cdunklau/foo.py
ESCPOS printer driver
View foo.py
class Printer():
"""
Print thing with my ESCPOS printer
"""
def text(self, text):
with open('/dev/usb/lp0', 'wb') as lp0:
lp0.write(text.encode('cp437'))
lp0.write(b'\n')
def command(self, command):
with open('/dev/usb/lp0', 'wb') as lp0:
@spoutnik16
spoutnik16 / compilemessages.py
Last active May 14, 2018
django-modeltranslation po file with makemessages and compilemessages
View compilemessages.py
# -*- 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
You can’t perform that action at this time.