Skip to content

Instantly share code, notes, and snippets.

View agu3rra's full-sized avatar
🧠
"Let chaos reign, then reign in chaos."

Andre Guerra agu3rra

🧠
"Let chaos reign, then reign in chaos."
View GitHub Profile
@agu3rra
agu3rra / caesarcipher.py
Created February 18, 2020 15:05
A simple snippet for a Caesar cipher in Python
message = 'Divide the army in two, advance and outflank them on the right. I will advance on the left flank from the woods getting them by surprise.'
message = message.replace(' ','')
message = message.replace(',','')
message = message.replace('.','')
shift_secret = 6
ciphered_message = ''
print(message)
for character in message:
if character.isupper():
ciphered_message += chr((ord(character) + shift_secret - 65) % 26 + 65)
@agu3rra
agu3rra / docker-mongo.sh
Created February 14, 2020 23:05
Docker commands for playing with MongoDB
# Run a container and expose port to host
docker run --name mongo-instance-01 -p 27017:27017 -d mongo:latest
# Access its terminal
docker ps
docker exec -it <container-id> bash
# Run the same mongo DB in the above example with persistence.
docker volume create mongo-volume-01
docker run \