Skip to content

Instantly share code, notes, and snippets.

View gil-obradors's full-sized avatar

Gil Obradors gil-obradors

View GitHub Profile
@62mkv
62mkv / check-auth.py
Created October 11, 2016 05:01
Python script to calculate SIP REGISTER Digest authentication (in order to check password validity)
from md5 import md5
# header from 401 response on REGISTER
# Authorization: Digest username="883140776410950", realm="gw_youmagic", algorithm=MD5, uri="sip:GW_Youmagic", nonce="1476157437:0a1418a40f8ee1c9a55f1587ab931c14", response="3ff479ccc24874f66aae45dac889d099"
login = '883140776410950'
uri = 'sip:GW_Youmagic'
nonce = '1476157437:0a1418a40f8ee1c9a55f1587ab931c14'
realm = 'gw_youmagic'
password = '----------'
@cassus
cassus / admin.py
Last active July 23, 2024 04:43
Django admin action as row button
class MyAdmin(admin.ModelAdmin):
list_display = (..., 'actions_html')
def actions_html(self, obj):
return format_html('<button class="btn" type="button" onclick="activate_and_send_email({pk})">Activate and send email</button>', pk=obj.pk)
actions_html.allow_tags = True
actions_html.short_description = "Actions"
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a