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
$ nodejs examples/default_config/default_config.js | |
http://localhost:3000/ | |
koa:sess=eyJ2aWV3cyI6MiwiX2V4cGlyZSI6MTU3Mjk2MjUyMzE4NCwiX21heEFnZSI6ODY0MDAwMDB9; koa:sess.sig=ngESdazh11CH6XAWLQejzuEGkOA | |
$ time python3 crack_koajs.py --min 2 --max 2 -c koa:sess=eyJ2aWV3cyI6MiwiX2V4cGlyZSI6MTU3Mjk2MjUyMzE4NCwiX21heEFnZSI6ODY0MDAwMDB9 -s ngESdazh11CH6XAWLQejzuEGkOA | |
Length tried: 2 | |
Found api-key: aa | |
real 0m0,078s |
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
app.keys = new Keygrip(['64bytes_long_string_1', '64bytes_long_string_2'], 'sha512', 'base64') |
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
get cookies() { | |
if (!this[COOKIES]) { | |
this[COOKIES] = new Cookies(this.req, this.res, { | |
keys: this.app.keys, | |
secure: this.request.secure | |
}); | |
} | |
return this[COOKIES]; | |
}, |
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
const session = require('koa-session'); | |
const Koa = require('koa'); | |
const app = new Koa(); | |
app.keys = ['some secret hurr']; | |
const CONFIG = { | |
key: 'koa:sess', /** (string) cookie key (default is koa:sess) */ | |
/** (number || 'session') maxAge in ms (default is 1 days) */ | |
/** 'session' will result in a cookie that expires when session/browser is closed */ |
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
#!/usr/bin/env python3 | |
#-*- coding: utf-8 -*- | |
""" Check scheduling on nebula for a service """ | |
# Standard library imports | |
from __future__ import print_function | |
from sys import argv | |
# Third party library imports | |
from pyone import OneServer |
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
$ check_scheduling.py prd my_service | |
-------------------- | |
-- CLUSTER : OK -- | |
-------------------- | |
Number of Cluster : 2 | |
---------------- | |
-- HOSTS -- | |
---------------- | |
Host 25 has 3 VM of the same type ! |
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
vcl 4.0; | |
import dynamic; | |
# You can add multiple sharding node | |
backend node01 { | |
.host = "node01.domain.lan"; | |
.port = "6081"; | |
} | |
backend node02 { | |
.host = "node02.domain.lan"; |
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
vcl 4.0; | |
# Add import | |
import dynamic; | |
# Probe for backend api server | |
probe api_probe { | |
.interval = 5s; | |
.timeout = 1s; | |
.window = 5; |
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
# Updated 04/01/2021 | |
server { | |
listen 443 default_server; | |
root /var/www/web; | |
# Only return Nginx in server header | |
server_tokens off; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/server.pem; |