Skip to content

Instantly share code, notes, and snippets.

@contemno
contemno / kobo-n416.md
Created August 20, 2019 01:30 — forked from RandomInsano/kobo-n416.md
Hacking notes on the very first Kobo (that I bought for $10)
@contemno
contemno / orgchartBuilder.py
Created January 7, 2019 16:15 — forked from rjnienaber/orgchartBuilder.py
Script to build an organizational chart from Active Directory
'''
Copyright (c) 2011, Richard Nienaber
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
The name of 'Richard Nienaber' may not be used to endorse or promote products derived from this software without specific prior written permission.
@contemno
contemno / netbox_cookie_uri.diff
Created May 25, 2018 14:01
Allow multiple Netbox (Django?) applications to coexist on the same FQDN.
@contemno
contemno / fix_mod_wsgi_netbox.diff
Created May 25, 2018 13:13
Facilitate mod_wsgi in Apache to use WSGIScriptAlias to run Netbox, instead of using ProxyPass
diff --git a/netbox/netbox/wsgi.py b/netbox/netbox/wsgi.py
index ecfd81d..cf3a5b1 100644
--- a/netbox/netbox/wsgi.py
+++ b/netbox/netbox/wsgi.py
@@ -1,8 +1,26 @@
-import os
+"""
+WSGI config for do_ipam project.
-from django.core.wsgi import get_wsgi_application
@contemno
contemno / netbox_disable_newly_created.diff
Created May 25, 2018 13:09
External authentication in Netbox automatically creates ``User`` objects for usernames that don't already exist in the database. This backend subclass disables the newly created remote ``User`` objects.
diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py
index 557477c..54e74aa 100644
--- a/netbox/netbox/settings.py
+++ b/netbox/netbox/settings.py
@@ -135,6 +135,10 @@ INSTALLED_APPS = (
'utilities',
'virtualization',
)
+AUTHENTICATION_BACKENDS = [
+ 'utilities.backends.ConfigureRemoteUserBackend',
@contemno
contemno / netbox_named_activity.diff
Created May 25, 2018 13:06
Add the user's name to recent activity list on the Netbox home page.
diff --git a/netbox/templates/home.html b/netbox/templates/home.html
index beb157f..6ec58ba 100644
--- a/netbox/templates/home.html
+++ b/netbox/templates/home.html
@@ -158,7 +158,7 @@
{% for a in recent_activity %}
<div class="list-group-item">
{{ a.icon }} {{ a.message|safe }}<br />
- <small class="text-muted">{{ a.user }} - {{ a.time|date:'SHORT_DATETIME_FORMAT' }}</small>
+ <small class="text-muted">{{ a.user.first_name }} {{ a.user.last_name }} ({{ a.user }}) - {{ a.time|date:'SHORT_DATETIME_FORMAT' }}</small>
wireshark -k -i <(ssh root@dumphost.example.org tcpdump -U -w - host somehost.example.org and port 80)