Skip to content

Instantly share code, notes, and snippets.

# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@luskan
luskan / gist:c1e005c7194376cbdcf9ea080d213665
Last active October 2, 2019 17:19
Simple example for a throw trick in constexpr context
In "C++Now 2017: Ben Deane & Jason Turner "constexpr ALL the things!"", Jason Turner talks about
constexpr vector which has a push back method allowing to detect range errors at compile time:
https://youtu.be/HMB9oXFobJc?t=921
If you want to see how to reproduce this trick here is the code:
#include <stdexcept>
class vec {
public:
@luskan
luskan / rw_locking.cpp
Created August 6, 2019 09:23
Test/profile read/write locking against regular locking
#include <iostream>
#include <string>
#include <vector>
#include <shared_mutex>
#include <mutex>
#include <thread>
#include <map>
#include <chrono>
#include <future>
#include <cassert>
@luskan
luskan / er_pass_key.py
Last active May 30, 2023 19:46
grabs log times from easyreadmine and generates reports.
'''
er_pass_key.py :: various tools to analyze er with its rest api
- grabs log times from easyreadmine and generates reports.
- lists issues in which user had added any changes in last week
api documentation:
https://easyredmine.docs.apiary.io/
https://www.redmine.org/projects/redmine/wiki/Rest_api
info: requires python 3.7, you also must create er_pass_key_settings.py file with correct
@luskan
luskan / fogbugz_downloader.py
Created August 17, 2018 01:36
Uses fogbugz api to download cases with attachments to sqlite db, it also downloads wikis.
'''
fogbugs_downloader.py :: uses fogbugz api to download cases with attachments to sqlite db, it also
downloads wikis. Uses pycookiecheat to download attachments (see here https://stackoverflow.com/q/51498991/471160).
tbd: test under linux
tbd: download wiki attached files
'''
import sys
import time
import html