This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
def encode(key, clear): | |
enc = [] | |
for i in range(len(clear)): | |
key_c = key[i % len(key)] | |
enc_c = chr((ord(clear[i]) + ord(key_c)) % 256) | |
enc.append(enc_c) | |
return base64.urlsafe_b64encode("".join(enc).encode()).decode() | |
def decode(key, enc): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
# maps p8080.example.com -> localhost:8080 | |
server_name ~^p(?<port>[^.]+)\.example\.com$; | |
location / { | |
proxy_pass http://localhost:$port; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed
ssh-add github_private_key
- Remove the lib cache
rm -rf ~/.cache/matplotlib
- Done!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo fallocate -l 4G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
# Verification | |
sudo swapon -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013 Georgios Gousios | |
# MIT-licensed | |
# Edited to handle two new tables: postLinks and tags that are present in the 2014 dataset | |
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
use stackoverflow; | |
create table badges ( | |
Id INT NOT NULL PRIMARY KEY, |
NewerOlder