This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; The Expression Problem and my sources: | |
; http://stackoverflow.com/questions/3596366/what-is-the-expression-problem | |
; http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/ | |
; http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/ | |
; http://www.ibm.com/developerworks/library/j-clojure-protocols/ | |
; To begin demonstrating the problem, we first need some | |
; "legacy code" with datastructures and functionality: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import call | |
OLD_URLS = [ | |
'[email protected]:someone/some-project.git' | |
] | |
NEW_URLS = [ | |
'[email protected]:someone/some-project.git' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from OpenSSL import SSL | |
import sys, os, select, socket | |
def parse_name(name): | |
return { | |
'common_name': name.commonName | |
} | |
def verify_cb(conn, cert, errnum, depth, ok): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up python logging is a pain in the but | |
# ...until you found this gist. | |
import logging | |
from logging.config import dictConfig as LOGGING_CONFIG | |
LOG_LEVEL = logging.INFO | |
LOGGING_CONFIG({ | |
'version': 1, | |
'formatters': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import io | |
import sys | |
from django.core.files.uploadedfile import InMemoryUploadedFile | |
from django.core.exceptions import SuspiciousOperation | |
# WARNING: quick and dirty, should be used for reference only. | |
def to_file(file_from_POST): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ElasticSearch | |
# | |
docker run -d \ | |
-v "$PWD/esdata":/usr/share/elasticsearch/data \ | |
-p 127.0.0.1:9200:9200 \ | |
-p 127.0.0.1:9300:9300 \ | |
--name essi \ | |
--restart always \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# RECEIVE DATA: | |
# | |
nc -lp <PORT> > data_from_someone | |
# gzipped, monitor with pv | |
nc -lp 6666 | gzip -d | pv > data_from_someone | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: server | |
become: yes | |
become_method: sudo | |
user: root | |
vars: | |
- APP_NAME: app | |
- CERTBOT_EMAIL: [email protected] | |
- DOMAIN_NAME: www.emblica.fi | |
- OTHER_DOMAINS: ['emblica.fi'] # fed to certbot |
OlderNewer