I hereby claim:
- I am boneyard93501 on github.
- I am boneyard93501 (https://keybase.io/boneyard93501) on keybase.
- I have a public key ASD4uwBCNxzbsY3tbwLBLbcnynptZy4PBAGWEMJ6evDsNwo
To claim this, I am signing this object:
import os, pwd, grp | |
def dropPrivileges(n_uid=None, n_gid=None, new_mask=077, critical=True, target_dir='.'): | |
''' | |
drop privileges without forking | |
e.g.: | |
http://www.charleshooper.net/blog/dropping-privileges-in-python-for-tornado-apps/ | |
http://antonym.org/2005/12/dropping-privileges-in-python.html | |
note to self: toggle ec2 instance by one of two instance types using boto3 | |
!/usr/bin/env python3 | |
# -*- coding: utf8 -*- | |
import os, sys | |
import datetime | |
import boto3 |
#!/usr/bin/env python3 | |
# -*- coding: utf8 -*- | |
import sys | |
import time | |
import json | |
# import signal | |
import threading | |
from collections import deque | |
extern crate rusoto_core; | |
extern crate rusoto_credential; | |
extern crate rusoto_s3; | |
use rusoto_core::Region; | |
use rusoto_credential::StaticProvider; | |
use rusoto_core::reactor::RequestDispatcher; | |
use rusoto_s3::{S3, S3Client, ListObjectsV2Request}; |
# note to self | |
import requests | |
from eth_account.messages import defunct_hash_message | |
from hexbytes import HexBytes | |
from pymongo import MongoClient | |
from web3 import Web3 | |
def personal_sign(w3, tx_hash: HexBytes, acct_addr: str, password: str) -> str: | |
''' |
I hereby claim:
To claim this, I am signing this object:
fn mean<'a, T>(data: impl ExactSizeIterator<Item = &'a T>) -> Result<f64, &'static str> | |
where | |
T: 'a + std::iter::Sum<&'a T> + Into<f64>, | |
{ | |
let len = data.len() as f64; | |
if len < 1 { | |
return Err("Invalid divisor"); | |
} | |
Ok((data.sum::<T>()).into() / len) | |
} |