I hereby claim:
- I am mrbitsdcf on github.
- I am mrbits (https://keybase.io/mrbits) on keybase.
- I have a public key ASClI9nLRabD3Vmd99qw_iXzNglgtv1jYsuV_U06_TVnSgo
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'base64' | |
public_key_file = '/path/to/key.pem'; | |
string = 'Hello World!'; | |
public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file)) | |
encrypted_string = Base64.encode64(public_key.public_encrypt(string)) |
function counter(name) { | |
return db.counters.findAndModify( | |
{query:{_id:name}, | |
update:{$inc : {next:1}}, | |
new:true, | |
upsert:true} | |
).next; | |
} |
I hereby claim:
To claim this, I am signing this object:
import paramiko | |
import StringIO | |
rsakey_string = 'Put your RSA Private Key string here' | |
''' alternative method: | |
rsakey_string = open('/path/to/rsa_private_key_file').read() | |
''' | |
keyfile = StringIO.StringIO(rsakey_string) | |
mykey = paramiko.RSAKey.from_private_key(keyfile) |
import random | |
def gera_cpf_valido(mask=False): | |
n = [random.randrange(10) for i in xrange(9)] | |
# calcula digito 1 e acrescenta ao numero | |
s = sum(x * y for x, y in zip(n, range(10, 1, -1))) | |
d1 = 11 - s % 11 |
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
# | |
# implements simple one-way encryption pipe using rsa and keccak-based | |
# spongewrap | |
# | |
# useful at least in the following use-case: you have an untrusted | |
# host on which plaintext data arrives, which you want to encrypt | |
# before it is forwarded in a hostile environment to the final | |
# recipient holding a private key in a safe location. In this one-way |
#!/usr/bin/env python | |
import os | |
u = open('users.txt', 'r') | |
for user in u.readlines(): | |
user = user[:-1] | |
path = '/data/users/{0}/'.format(user) | |
tmp = os.path.isdir(path) |
FROM node:boron-alpine | |
RUN mkdir -p /app | |
WORKDIR /app | |
COPY package.json /app/ | |
RUN npm install | |
COPY . /app |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Distances on Globe and Flat Earth | |
# Instructions: | |
# - Input each information as asked; | |
# - Input coordinates in degrees (23.1234); | |
# - If coordinates are at South or West, use negative numbers (-23.1234); | |
# - North Pole to Equator based on a Flat Earth with 40.075km equatorial perimeter. | |
# Earth radius = 6371km rounded, so little diferences are expected if you're considering WGS84 geoid. |
# CONSTANTES | |
G = 6.67408 * 10**(-11) # Constante Universal de Gravitação | |
M = 5.972 * 10**(24) # Massa da Terra | |
# ---------------------------------------------------------------------------------------------------------------------------- | |
# VARIÁVEIS |