Skip to content

Instantly share code, notes, and snippets.

View ivictbor's full-sized avatar
🇺🇦
#StandWithUkraine

Ivan Borshchov ivictbor

🇺🇦
#StandWithUkraine
View GitHub Profile
@andrewn
andrewn / instructions.md
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 127.0.0.1. For example, this address could be localhost.example.com if we controlled the example.com 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 http://localhost.example.com 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 localhost.example.com. Visiting https://localhost.example.com 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
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.
+config INTEL_MID_FORCE_SPIDEV
+ bool "Force spidev"
@cgabard
cgabard / preprocessblock.py
Created October 2, 2014 09:38
preprocessblock.py
#! /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={}):
markdown.extensions.Extension.__init__(self)
@maraujop
maraujop / forms.py
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()