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
#!/bin/bash | |
encryptedIndicator="$ANSIBLE_VAULT" | |
encryptedFilename="encrypted.yml" | |
sbe=`find $PWD -name $encryptedFilename | sort -u` | |
encrypted=`find $PWD -name $encryptedFilename -exec grep "$encryptedIndicator" {} -l \;| sort -u` | |
shouldbe=`comm -3 <(printf '%s\n' "${sbe[@]}") <(printf '%s\n' "${encrypted[@]}")` |
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
#include <stdio.h> | |
#include <xmmintrin.h> | |
#include <stdint.h> | |
/** | |
* Converts a string from a format where bit 7 of 8 characters form the first | |
* byte in a uint64_t, bit 6 of 8 characters form the second byte and so on | |
* in a simple attempt to obsfucate strings encoded as integers. | |
* | |
* @param data The string to destripe |
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
#!/usr/bin/env python | |
#pip install piecash requests pandas_market_calendars MySQL | |
import argparse | |
import piecash | |
import requests | |
import datetime | |
import decimal | |
import pandas_market_calendars as mcal | |
import numpy as np |
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 argparse | |
import getpass | |
def password_proxy(value): | |
password_proxy.prompt = 'Default password prompt:' | |
class _password_proxy(str): | |
def __new__(cls, value): | |
obj = str.__new__(cls, value) | |
obj._context = password_proxy |
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
#!/bin/bash | |
# http://www.nongnu.org/avr-libc/user-manual/install_tools.html | |
# For optimum compile time this should generally be set to the number of CPU cores your machine has | |
JOBCOUNT=4 | |
# Build Linux toolchain | |
# A Linux AVR-GCC toolchain is required to build a Windows toolchain | |
# If the Linux toolchain has already been built then you can set this to 0 |
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
# Needed for defining the finder | |
import importlib.machinery | |
# Needed to add our hook to the meta_path hook list | |
import sys | |
# To debug with pdb.set_trace() be sure to import the following before adding the meta_path | |
import pdb | |
import readline |
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
#include <pybind11/pybind11.h> | |
namespace py = pybind11; | |
template<typename T> | |
T get_argument(const char* name, int& index, const py::args& args, const py::kwargs& kwargs) | |
{ | |
if(kwargs.contains(name)) | |
{ | |
return kwargs[name].cast<T>(); |
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
""" | |
I often find myself parsing buffers that contain typed buffers of data. | |
Python enumerations are great. I love to use them to map symantic names | |
onto a collection of values. However they often are lacking in performing | |
actions based on the enumerant. Typically I have to do something like | |
the following | |
class foo(enum.Enum): | |
a = 1 | |
b = 2 |
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 mono:6.12.0 AS build | |
ENV PYTHONNET_VER=2.5.2 | |
# Install all the things necessary to build pythonnet | |
RUN apt update && apt install python3.7 python3-pip python3.7-dev clang g++ gcc -y | |
# Setup the python environment | |
RUN python3 -m pip install -U pip setuptools wheel pycparser | |
# Build the pythonnet wheel | |
RUN python3 -m pip wheel pythonnet==$PYTHONNET_VER |
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 asyncio | |
from contextlib import closing | |
from typing import Iterator, Dict, Set, AsyncIterator, Iterable, Mapping, Container | |
from urllib.parse import urlparse, urlunparse | |
from collections import defaultdict | |
from pprint import pprint | |
import aiohttp | |
from packaging.requirements import Requirement |
OlderNewer