Skip to content

Instantly share code, notes, and snippets.

View ivictbor's full-sized avatar

Ivan Borshchov ivictbor

View GitHub Profile
andrewn /
Last active June 1, 2024 12:41
Testing SSL (LetsEncrypt certificate and loopback domain)

Testing SSL (LetsEncrypt certificate and loopback domain)

General approach

This sets up a publically-available domain that loops back to localhost IP address For example, this address could be if we controlled the domain. This relies on having a public domain name whose DNS records you can control. We can then generate LetsEncrypt certificates for this domain.

Our HTTP server runs on localhost:80 (default HTTP port). This lets us visit in a web browser and see the server running on localhost:80.

We then run an HTTPS proxy server on localhost:443 (default HTTPS port) that uses the LetsEncrypt certificates we generated for Visiting hits the proxy, which returns the correct certificates meaning the browser displays the "Secure" message. The proxy then passes the request through to the HTTP server.

FantomJAC / edison-force-spidev.patch
Created February 3, 2016 21:21
Enable SPI CS0 (spidev5.0) on Intel Edison
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 82b8dca..e1a4789 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -457,6 +457,9 @@ config X86_INTEL_MID
nor standard legacy replacement devices/features. e.g. It does not
contain i8259, i8254, HPET, legacy BIOS, most of the io ports.
+ bool "Force spidev"
cgabard /
Created October 2, 2014 09:38
#! /usr/bin/env python
import markdown
class PreprocessBlockExtension(markdown.extensions.Extension):
"""This extension will change the default behaviour of python-markdown and allow to use
pre-processing extensions inside block"""
def __init__(self, configs={}):
maraujop /
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()