Skip to content

Instantly share code, notes, and snippets.

--- old/cmake/Modules/GetVersionInfo.cmake 2015-11-25 14:12:22.000000000 -0500
+++ new/cmake/Modules/GetVersionInfo.cmake 2015-12-07 17:48:36.550139947 -0500
@@ -22,12 +22,6 @@
STRING(REPLACE "-" "_" LCB_VERSION "${LCB_VERSION}")
MESSAGE(STATUS "Sanitized VERSION=${LCB_VERSION}")
RUNGIT(LCB_VERSION_CHANGESET rev-parse HEAD)
-
- EXECUTE_PROCESS(
- COMMAND echo ${LCB_VERSION}
- COMMAND awk -F. "{printf \"0x%0.2d%0.2d%0.2d\", $1, $2, $3}"
@nvllsvm
nvllsvm / example.py
Last active August 11, 2016 17:39
AWeber rate limit handling
subscribers = aweber_list.subscribers.find(status='subscribed')
for i in range(0, subscribers.total_size):
try:
print(subscribers[i].id)
except aweber_api.base.APIException:
if str(e).startswith('ForbiddenError: Rate limit exceeded'):
# Wait 60 seconds
import argparse
import os
import requests
MAX_RFC = 8056
def download_rfc(rfc_num, output_dir):
print(f'Downloading {rfc_num}')
@nvllsvm
nvllsvm / docker-compose.yml
Created August 21, 2017 22:49
Docker self-hosted
nginx:
image: nginx
restart: always
links:
- nextcloud
- transmission
- airsonic
- emby
volumes:
- /home/docker/nginx.conf:/etc/nginx/nginx.conf
#!/bin/sh
python_version=$1
packages=`pip$python_version list --outdated --format=freeze`
if [[ ! -z $packages ]]; then
echo $packages | grep -v '^\-e' | cut -d = -f 1 | xargs pip$python_version install --upgrade
else
echo All Python $python_version packages up-to-date.
fi
@nvllsvm
nvllsvm / electron
Created February 16, 2018 05:23
Wrapper around electron which launches with an appropriate scale factor
#!/bin/sh
dpi=$(xdpyinfo | grep resolution | awk '{print $2}')
if [[ $dpi == '192x192' ]]; then
factor=2
else
factor=1
fi
/usr/bin/electron --force-device-scale-factor=$factor "$@"
@nvllsvm
nvllsvm / docker-compose.yaml
Created February 26, 2018 06:39
self-hosted
version: '3.5'
services:
nginx:
image: nginx:mainline-alpine
volumes:
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs/live/sol.nullsum.net/privkey.pem:/ssl/privkey.pem:ro
- ./certs/live/sol.nullsum.net/fullchain.pem:/ssl/fullchain.pem:ro
- ./certs/dhparam.pem:/ssl/dhparam.pem:ro
@nvllsvm
nvllsvm / dusk_score_restore.py
Last active March 12, 2019 17:22
Unlock all levels with all achievements in the game DUSK
import collections
import pathlib
import struct
import argparse
LEVELS = {
'E1M1': 'level3',
'E1M2': 'level4',
'E1M3': 'level5',
#!/usr/bin/env sh
decode_audio() {
openssl base64 -d << EOF
T2dnUwACAAAAAAAAAACszaAOAAAAAAUPz3gBE09wdXNIZWFkAQE4AUSsAAAAAABPZ2dTAAAAAAAA
AAAAAKzNoA4BAAAAqDEz8wP///5PcHVzVGFncx0AAABsaWJvcHVzIDEuMywgbGlib3B1c2VuYyAw
LjIuMQIAAAAjAAAARU5DT0RFUj1vcHVzZW5jIGZyb20gb3B1cy10b29scyAwLjI6AAAARU5DT0RF
Ul9PUFRJT05TPS0tZnJhbWVzaXplIDYwIC0tYml0cmF0ZSAxNiAtLWRvd25taXgtbW9ubwAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
#!/usr/bin/env python3
import argparse
import concurrent.futures
import json
import logging
import subprocess
LOGGER = logging.getLogger('docker-healthchecker')