Hop pipenv
This commit is contained in:
parent
c8cdf31d8f
commit
482e1d473d
47
Makefile
47
Makefile
|
@ -4,26 +4,14 @@ PELICANOPTS=
|
|||
|
||||
BASEDIR=$(CURDIR)
|
||||
INPUTDIR=$(BASEDIR)/content
|
||||
OUTPUTDIR=$(BASEDIR)/../mdk/
|
||||
OUTPUTDIR=$(BASEDIR)/output/
|
||||
CONFFILE=$(BASEDIR)/pelicanconf.py
|
||||
PUBLISHCONF=$(BASEDIR)/publishconf.py
|
||||
|
||||
FTP_HOST=localhost
|
||||
FTP_USER=anonymous
|
||||
FTP_TARGET_DIR=/
|
||||
|
||||
SSH_HOST=localhost
|
||||
SSH_HOST=mdk.fr
|
||||
SSH_PORT=22
|
||||
SSH_USER=root
|
||||
SSH_TARGET_DIR=/var/www
|
||||
|
||||
S3_BUCKET=my_s3_bucket
|
||||
|
||||
CLOUDFILES_USERNAME=my_rackspace_username
|
||||
CLOUDFILES_API_KEY=my_rackspace_api_key
|
||||
CLOUDFILES_CONTAINER=my_cloudfiles_container
|
||||
|
||||
DROPBOX_DIR=~/Dropbox/Public/
|
||||
SSH_USER=mdk
|
||||
SSH_TARGET_DIR=/var/www/mdk/
|
||||
|
||||
GITHUB_PAGES_BRANCH=gh-pages
|
||||
|
||||
|
@ -54,10 +42,6 @@ help:
|
|||
@echo ' make stopserver stop local server '
|
||||
@echo ' make ssh_upload upload the web site via SSH '
|
||||
@echo ' make rsync_upload upload the web site via rsync+ssh '
|
||||
@echo ' make dropbox_upload upload the web site via Dropbox '
|
||||
@echo ' make ftp_upload upload the web site via FTP '
|
||||
@echo ' make s3_upload upload the web site via S3 '
|
||||
@echo ' make cf_upload upload the web site via Cloud Files'
|
||||
@echo ' make github upload the web site via gh-pages '
|
||||
@echo ' '
|
||||
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
|
||||
|
@ -99,26 +83,7 @@ stopserver:
|
|||
publish:
|
||||
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
|
||||
|
||||
ssh_upload: publish
|
||||
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
|
||||
|
||||
rsync_upload: publish
|
||||
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
|
||||
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
|
||||
|
||||
dropbox_upload: publish
|
||||
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
|
||||
|
||||
ftp_upload: publish
|
||||
lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
|
||||
|
||||
s3_upload: publish
|
||||
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
|
||||
|
||||
cf_upload: publish
|
||||
cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .
|
||||
|
||||
github: publish
|
||||
ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
|
||||
git push origin $(GITHUB_PAGES_BRANCH)
|
||||
|
||||
.PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github rsync
|
||||
.PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload rsync
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
[[source]]
|
||||
|
||||
url = "https://pypi.python.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
|
||||
[packages]
|
||||
|
||||
pelican = "*"
|
||||
markdown = "*"
|
||||
|
||||
|
||||
[dev-packages]
|
||||
|
||||
|
||||
|
||||
[requires]
|
||||
|
||||
python_version = "3.6"
|
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "471476732d86a666832ac901e7d9cbb09ce01a96ce623f2c1aeb5d7be998a9da"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.6"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.python.org/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {
|
||||
"blinker": {
|
||||
"hashes": [
|
||||
"sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"
|
||||
],
|
||||
"version": "==1.4"
|
||||
},
|
||||
"docutils": {
|
||||
"hashes": [
|
||||
"sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
|
||||
"sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274",
|
||||
"sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"
|
||||
],
|
||||
"version": "==0.14"
|
||||
},
|
||||
"feedgenerator": {
|
||||
"hashes": [
|
||||
"sha256:5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"
|
||||
],
|
||||
"version": "==1.9"
|
||||
},
|
||||
"jinja2": {
|
||||
"hashes": [
|
||||
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
|
||||
"sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
|
||||
],
|
||||
"version": "==2.10"
|
||||
},
|
||||
"markdown": {
|
||||
"hashes": [
|
||||
"sha256:9ba587db9daee7ec761cfc656272be6aabe2ed300fece21208e4aab2e457bc8f",
|
||||
"sha256:a856869c7ff079ad84a3e19cd87a64998350c2b94e9e08e44270faef33400f81"
|
||||
],
|
||||
"version": "==2.6.11"
|
||||
},
|
||||
"markupsafe": {
|
||||
"hashes": [
|
||||
"sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
|
||||
],
|
||||
"version": "==1.0"
|
||||
},
|
||||
"pelican": {
|
||||
"hashes": [
|
||||
"sha256:2a5347fe47464ee743bff99b6e81d1b5823f2e70e7be5bd6ed66a5bdd5f3578b",
|
||||
"sha256:f1456c163a963d498abd741ea7c6f47984365ecd8bbd6e118c44e247815cb7ef"
|
||||
],
|
||||
"version": "==3.7.1"
|
||||
},
|
||||
"pygments": {
|
||||
"hashes": [
|
||||
"sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d",
|
||||
"sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
|
||||
],
|
||||
"version": "==2.2.0"
|
||||
},
|
||||
"python-dateutil": {
|
||||
"hashes": [
|
||||
"sha256:891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca",
|
||||
"sha256:95511bae634d69bc7329ba55e646499a842bc4ec342ad54a8cdb65645a0aad3c"
|
||||
],
|
||||
"version": "==2.6.1"
|
||||
},
|
||||
"pytz": {
|
||||
"hashes": [
|
||||
"sha256:07edfc3d4d2705a20a6e99d97f0c4b61c800b8232dc1c04d87e8554f130148dd",
|
||||
"sha256:410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0"
|
||||
],
|
||||
"version": "==2018.3"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
|
||||
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
|
||||
],
|
||||
"version": "==1.11.0"
|
||||
},
|
||||
"unidecode": {
|
||||
"hashes": [
|
||||
"sha256:72f49d3729f3d8f5799f710b97c1451c5163102e76d64d20e170aedbbd923582",
|
||||
"sha256:8c33dd588e0c9bc22a76eaa0c715a5434851f726131bd44a6c26471746efabf5"
|
||||
],
|
||||
"version": "==1.0.22"
|
||||
}
|
||||
},
|
||||
"develop": {}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
status: hidden
|
||||
title: Python — Uncipher
|
||||
slug: aena5lohSh5ri8-uncipher
|
||||
robots: noindex
|
||||
|
||||
# Break a substitution cipher
|
||||
|
||||
## Introduction
|
||||
|
||||
The project name is: uncipher
|
||||
You'll give back your project using this protocol: https://mdk.fr/pages/obiree2uaza2sh-rendu.html
|
||||
|
||||
|
||||
## Project
|
||||
|
||||
Make a program taking a dictionary file and a string, like:
|
||||
|
||||
python3 subst_break.py /usr/share/dict/french 'Cpokpvs mft hfot'
|
||||
|
||||
Your program should try every possible alphabetic substitution (in the alphabetic or ASCII range, maybe try different alphabets if needed), rank them by probability of being a real clear text (by counting the words being in the dictionary, doing frequency analysis on the letters, whatever...).
|
||||
|
||||
Your program should then print the most probable one (should easily be the right one in your tests).
|
||||
|
||||
You can write your own implementation of a substitution cipher for tests purpose in the ASCII range like this:
|
||||
|
||||
''.join([chr(ord(x) + 1) for x in "Bonjour les gens"])
|
||||
|
||||
(beware, I miss a modulo 255, correct implementation left as an exercise).
|
||||
|
||||
Or in a given alphabet like this:
|
||||
|
||||
import string
|
||||
|
||||
alphabet = string.ascii_lowercase * 2
|
||||
for shift in range(1, 10):
|
||||
print(''.join([alphabet[alphabet.index(x) + shift] if x in alphabet else x for x in "bonjour les gens"]))
|
|
@ -0,0 +1,42 @@
|
|||
status: hidden
|
||||
title: Cybersécurité — Bullet Proof
|
||||
slug: fa4eet9Meengae-bulletproof
|
||||
robots: noindex
|
||||
|
||||
# Bullet Proof
|
||||
|
||||
Le nom du projet est `bulletproof`, en minuscule (c'est important pour
|
||||
le [rendu](https://mdk.fr/pages/obiree2uaza2sh-rendu.html)).
|
||||
|
||||
Le but du projet est de créer une "message board", avec un seul fil de
|
||||
discussion.
|
||||
|
||||
Specs :
|
||||
|
||||
- On doit pouvoir s'inscrire avec un nickname et un mot de passe.
|
||||
- On doit pouvoir se connecter avec un nickname et un mot de passe.
|
||||
- On doit pouvoir se déconnecter.
|
||||
- On doit pouvoir se désinscrire.
|
||||
- Un utilisateur non-connecté **ne peut pas** poster de message.
|
||||
- Un utilisateur non-connecté **peut** lire les messages.
|
||||
- Un utilisateur connecté **peut** poster un message.
|
||||
- Un utilisateur connecté **peut** lire les messages.
|
||||
- Un message posté n'apparait pas forcément automatiquement chez les
|
||||
autres (ce n'est pas un chat).
|
||||
|
||||
Specs pour le rendu :
|
||||
|
||||
- Faites au plus simple.
|
||||
- Aucune faille de sécurité.
|
||||
- Un seul fichier est peut être un peu léger si vous voulez présentez
|
||||
correctement l'interface graphique, j'en accepterai plusieurs si le
|
||||
résultat en valait le coup.
|
||||
- Pas de framework.
|
||||
- Code propre et facilement prouvable (on ne joue pas à [The
|
||||
Underhanded C Contest](http://www.underhanded-c.org/)).
|
||||
- Je veux le tout dans une archive tel que le [rendu
|
||||
l'impose](https://mdk.fr/pages/obiree2uaza2sh-rendu.html).
|
||||
- Je veux le dossier `.git/` dans l'archive du rendu, avec tout
|
||||
l'historique de votre travail, de l'initial commit à un projet
|
||||
terminé, n'hésitez donc pas à faire des plus petits commits que
|
||||
d'habitude vu que le projet est très court.
|
|
@ -10,7 +10,7 @@ import sys
|
|||
sys.path.append(os.curdir)
|
||||
from pelicanconf import *
|
||||
|
||||
SITEURL = ''
|
||||
SITEURL = 'https://mdk.fr'
|
||||
RELATIVE_URLS = False
|
||||
|
||||
FEED_ALL_ATOM = 'feeds/all.atom.xml'
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
blinker==1.4
|
||||
docutils==0.13.1
|
||||
feedgenerator==1.9
|
||||
Jinja2==2.9.6
|
||||
Markdown==2.6.8
|
||||
MarkupSafe==1.0
|
||||
pelican==3.7.1
|
||||
pkg-resources==0.0.0
|
||||
Pygments==2.2.0
|
||||
python-dateutil==2.6.0
|
||||
pytz==2017.2
|
||||
six==1.10.0
|
||||
Unidecode==0.4.20
|
Loading…
Reference in New Issue