Skip to content

Instantly share code, notes, and snippets.

View mattixpet's full-sized avatar
🇵🇸
<3

Matthias mattixpet

🇵🇸
<3
View GitHub Profile
@SeanPesce
SeanPesce / https_server.py
Last active November 3, 2024 19:03
Simple Python 3 HTTPS Server (SSL/TLS)
#!/usr/bin/env python3
# Author: Sean Pesce
# References:
# https://stackoverflow.com/questions/19705785/python-3-simple-https-server
# https://docs.python.org/3/library/ssl.html
# https://docs.python.org/3/library/http.server.html
# Shell command to create a self-signed TLS certificate and private key:
# openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out cert.crt -keyout private.key
@raprasad
raprasad / change_password.md
Last active August 14, 2024 20:22
django user; change password from shell

update django password

general changes

To use in dev environments

  • after python manage.py shell
from django.contrib.auth.models import User
@orip
orip / temp_chdir.py
Created July 22, 2012 19:22
temp_chdir
import os, contextlib
@contextlib.contextmanager
def temp_chdir(path):
"""
Usage:
>>> with temp_chdir(gitrepo_path):
... subprocess.call('git status')
"""
starting_directory = os.getcwd()