Skip to content

Instantly share code, notes, and snippets.

View ricrogz's full-sized avatar

Ricardo Rodriguez ricrogz

View GitHub Profile
@ricrogz
ricrogz / OpenSSL RSA encryption sample
Created October 27, 2019 05:19 — forked from superwills/OpenSSL RSA encryption sample
Base64 encoding and RSA encryption sample
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <openssl/rsa.h>
#include <openssl/engine.h>
#include <openssl/pem.h>
// I'm not using BIO for base64 encoding/decoding. It is difficult to use.
// Using superwills' Nibble And A Half instead
@ricrogz
ricrogz / py_real_obj_size.py
Last active October 14, 2017 23:14 — forked from bosswissam/pysize.py
Get Real size of objects in python
import sys
def get_size(obj, seen=None):
"""Recursively finds size of objects"""
size = sys.getsizeof(obj)
if seen is None:
seen = set()
obj_id = id(obj)
if obj_id in seen:
return 0
@ricrogz
ricrogz / gist:2bc12679b7e881a457aaae216ef6d66e
Created April 19, 2016 07:50
Find the mean, min and max values in a column using awk
$ awk '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1< min) {min=$1}; total+=$1; count+=1} END {print total/count, min, max}' FILE.DAT