Keep secrets in python

Keeping Secrets Secret in Python Based on an article by originally published by Jason Goldberger but unfortunately the original is not online anymore so I have rewritten a short version, since this is something I have been looking for a while. Fernet has one classmethod called generate_key() and two instance methods encrypt(plaintext_binary) and decrypt(cipher_binary). Step 1 : Generate a key Generate a key and save it to the OS’s environment variables:...

November 14, 2021 · 1 min · YS

Python and combinatory

Problem Find all the combination of two in a team Solution 1 2 3 4 5 6 7 from itertools import combinations team = ["john", "joe", "bob", "al", "tony", "mark"] comb = combinations(team, 2) for i in list(comb): print(i) Result: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ('john', 'joe') ('john', 'bob') ('john', 'al') ('john', 'tony') ('john', 'mark') ('joe', 'bob') ('joe', 'al') ('joe', 'tony') ('joe', 'mark') ('bob', 'al') ('bob', 'tony') ('bob', 'mark') ('al', 'tony') ('al', 'mark') ('tony', 'mark') Let’s up the game now we want to arrange the combinations results in a way that none of these guys are on call twice in a row...

August 22, 2021 · 2 min · YS

Git good practices

Do you git it? Learn Git Interactively GitHub resources Free Code Camp - Git Git in 20 min (Video) Git bless you How to Write a Git Commit Message A successful Git branching model Using git-flow to automate your git branching workflow One flow Pull it together Better Pull Requests Great Pull Requests Code Review BP Tooling git GUI clients Gitflow AVH Magit (emacs) tig git for windows (if you have too…) Git Ops General resources GitOps GitLab view on GitOps

September 3, 2019 · 1 min · YS