Skip to content

Instantly share code, notes, and snippets.

View ricjcosme's full-sized avatar

Ricardo Cosme ricjcosme

View GitHub Profile
npearce /
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See:

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
denji /
Last active March 8, 2024 04:15 — forked from mamonu/
convert a qcow2 vm to a VirtualBox vm format

VirtualBox command-line interface (VBoxManage) provides an easy way to convert raw disk image to the VDI/VMDK format and otherwise.

Let's assume that we have raw image of the sdb device:

$ sudo dd if=/dev/sdb of=./sdb.raw

To use it with VirtualBox we need to convert it to the VDI format:

$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active March 19, 2024 17:24 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

tryvin / tumbler-gist-insert.html
Created November 1, 2015 14:52
Tumblr gist insert
<script src=""></script>
<script type="text/javascript">
$(function() {
function(index, element) {
if ( $(element).attr('href').indexOf('') > 0 ) {
var divElement = $('<div></div>');
writeCapture.html(divElement, '<script src="'+$(element).attr('href')+'.js"></'+'script>');
mderazon /
Last active November 3, 2022 16:18
Export all of Mongodb collections as csv without the need to specify fields
# fill in your details here
# first get all collections in the database
marcelog / generic_proxy.erl
Last active October 1, 2023 16:15
Quick and small tcp proxy written in erlang. Opens a socket and listens for incoming connections. For every new incoming connection, it will open a connection to the proxied host, and send whatever it gets from either side to the other.
-define(PORT_FROM, 63790).
-define(PORT_TO, 6379).
-define(BACKLOG, 10000).
run() ->
{ok, Socket} = gen_tcp:listen(0, [