Skip to content

Instantly share code, notes, and snippets.

@tomoconnor
tomoconnor / dhcp-event
Created April 20, 2011 17:09
Thingy for updating powerdns backend when stuff changes
#!/usr/bin/env python
import MySQLdb
import os, sys
import pprint
pp = pprint.PrettyPrinter()
mysql_host = "localhost"
mysql_user = "dbusername"
mysql_pass = "dbpassword"
@Wollw
Wollw / pcint_example.c
Created May 5, 2012 00:48
ATMega328P PCINT example
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/atomic.h>
#include <util/delay.h>
#include <stdbool.h>
/*
* A global flag used to communicate between the Interrupt Service Routine
* and the main program. It has to be declared volatile or the compiler
* might optimize it out.
@jasonm23
jasonm23 / xterm-256color.svg
Last active October 31, 2024 01:15
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thales17
thales17 / DisableWifiPowerSave.md
Created September 19, 2017 15:10
Disable Wifi Power Save on Raspbian

Disable WIFI Power Save on Raspbian Jessie

  • Use iw wlan0 get power_save to see if the wifi power save feature is enabled or not
  • If you want to permantently disable it add this to the /etc/network/interfaces after the iface wlan0 line wireless-power off
  • Reboot and if you run iw wlan0 get power_save you should see that is off.
@oddstr13
oddstr13 / arp_responder.py
Last active January 27, 2021 20:37 — forked from SupraJames/arp_responder.py
ARP responder using Python / scapy
#!/usr/bin/env python3
#
# Spoof ARP responses for list of IP Addresses / Networks
# Listens for ARP and responds with own MAC if the target is in list
#
# Allows routing of IP Addresses / subnets to a bridged VM network
# without access to the router config.
#
# Requires scapy (python3-scapy)
# https://scapy.readthedocs.io/en/latest/installation.html
@nielsvanvelzen
nielsvanvelzen / jf-dev-auth.md
Last active November 8, 2024 12:50
Jellyfin API Authorization

Jellyfin API Authorization

To start using the Jellyfin API, authorization is probably the first thing you'll need to do. Jellyfin's authorization options can be a bit confusing because there are a lot of deprecated options.

Generally there are three ways to authenticate: no authorization, user authorization with an access token or authorization with an API key. The first way is easy, just do nothing. But most often you'll need to use either the access token or API key.

Sending authorization values

There are multiple methods for transmitting authorization values, however, some are outdated and scheduled to be removed. It's recommend to use the Authorization header. If header auth isn't an option, the token may be sent through the ApiKey query parameter. Sending secure data in a query parameter is unsafe as the changes of it leaking (via logs, copy-paste actions or by other means) are high. Only use this method as a last resort.