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
# Translates Markdown syntax to Slack, replaces: | |
# | |
# - hyphened lists with bullet symbols | |
# - double bold marker asterisks `**` with single asterisk `*` | |
# - headers `#` with bold marker asterisks `*` | |
# | |
# Run with | |
# | |
# python markdown-to-slack.py filename.md | |
# |
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
""" | |
A small utility that creates OCSP responses for testing for the web-eid-authtoken-validation-java library. | |
Run it as follows: | |
python -m venv venv | |
. venv/bin/activate | |
pip install asn1crypto | |
python ocsp.py |
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 hmac | |
import datetime | |
import json | |
from base64 import b64encode | |
from urllib.parse import urlencode | |
import requests | |
API_KEY = b'...' | |
API_ID = '...' |
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 django.contrib.admin import widgets | |
from django import forms | |
from django.contrib import admin | |
# create wrappers for overriding the queryset | |
class ToWrapper(object): | |
def __init__(self, to, manager): | |
self.to = to | |
self._default_manager = manager |
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
cat << 'EOF' > gitlab-mvn-settings.xml | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> | |
<servers> | |
<server> | |
<id>gitlab</id> | |
<configuration> | |
<httpHeaders> | |
<property> | |
<name>Deploy-Token</name> |
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
""" | |
Thread-safe Django cache backend for pylibmc. | |
Tested on Python 2.6, should work on 2.5 as well. | |
Use it by setting CACHE_BACKEND in settings.py, e.g.: | |
CACHE_BACKEND = 'projdir.utils.pylibmcd://127.0.0.1:11211/' | |
And here's how to properly install pylibmcd in Ubuntu for mod_wsgi: |
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
<script setup lang="ts"> | |
import { $ref } from "vue/macros"; | |
import { onMounted, onUnmounted } from "vue"; | |
import { SLIDE_TEXTS } from "./assets/slides/slideTexts"; | |
import PresentationSlide from "./components/PresentationSlide.vue"; | |
// Width of the slide images in pixels, change this if the images are of different width | |
const IMAGE_WIDTH_PX = 1024; | |
const MAX_INDEX = Object.keys(SLIDE_TEXTS).length; |
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
""" | |
This fabfile automates deployment of and moving data between Django apps | |
in development (devel), staging (stage), and production (live) | |
environments. | |
Use it as: | |
fab -H user@host:port deploy:stage | |
Requirements |
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 boto3 | |
ENDPOINT_URL = 'https://fra1.digitaloceanspaces.com' | |
SPACE = "space-name" | |
REGION = "FRA1" | |
ACCESS_KEY_ID = "..." | |
SECRET_ACCESS_KEY = "..." | |
def main(): | |
session = boto3.session.Session() |
NewerOlder