Skip to content

Instantly share code, notes, and snippets.

View jeromecc's full-sized avatar
🤖
Building bots for my Riot / Matrix server

jeromecc jeromecc

🤖
Building bots for my Riot / Matrix server
View GitHub Profile
@jeromecc
jeromecc / multitask.py
Created December 6, 2020 22:18 — forked from kkirsanov/multitask.py
run multiple django managememnt commands simultaneously
# coding=utf8
import logging
import threading
import time
from django.core.management import call_command
from django.core.management.base import BaseCommand
logger = logging.getLogger('multirunner')
@jeromecc
jeromecc / views.py
Created September 11, 2019 17:13 — forked from alee/views.py
Django Discourse SSO endpoint adapted from https://meta.discourse.org/t/sso-example-for-django/14258 - depends on settings.py DISCOURSE_BASE_URL and DISCOURSE_SSO_SECRET
import base64
import hmac
import hashlib
from urllib import parse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.conf import settings
@login_required
@jeromecc
jeromecc / README.md
Created March 13, 2019 15:26 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

#!/usr/bin/python
import urllib2
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib2.urlopen('http://www.debian.org/mirror/list')
https = []