Skip to content

Instantly share code, notes, and snippets.

@lutostag
lutostag / pre-commit
Created January 13, 2021 22:23
python basci pre-commit
#!/bin/sh
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
@lutostag
lutostag / django-template-traceback.txt
Created June 24, 2020 22:33
Django Template error traceback
Template error:
In template /usr/local/lib/python3.7/site-packages/django/contrib/admin/templates/admin/base.html, error at line 0
Reverse for 'trader_unitset_change' with arguments '('',)' not found. 1 pattern(s) tried: ['admin/trader/unitset/(?P<object_id>.+)/change/$']
1 : {% load i18n static %}<!DOCTYPE html>
2 : {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
3 : <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
4 : <head>
5 : <title>{% block title %}{% endblock %}</title>
6 : <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}">
7 : {% block extrastyle %}{% endblock %}
@lutostag
lutostag / rpi-setup.sh
Last active August 31, 2017 20:07
Setup script for rpi2/3 router with ubuntu core
#!/bin/bash
# first do a reboot, to let some of the snaps refresh
# (in particular the wifi wont work as an AP until a new core + kernel snap is installed)
# this will happen by itself via a timer, but if not, just give it a kick.
# sudo reboot
# setup our hostname
sudo hostnamectl set-hostname fbi
@lutostag
lutostag / keybase.md
Created December 21, 2016 03:17
My keybase.io verification for github

Keybase proof

I hereby claim:

  • I am lutostag on github.
  • I am lutostag (https://keybase.io/lutostag) on keybase.
  • I have a public key whose fingerprint is 10CC 0B52 F40B A45F C4CF B412 DF17 9B77 1F3E B44A

To claim this, I am signing this object:

@lutostag
lutostag / spacexec
Last active December 21, 2016 03:06
A shebang space interpreter
#!/usr/bin/perl
exec(split(/ /, shift(@ARGV)), @ARGV)