Skip to content

Instantly share code, notes, and snippets.

@dolph
dolph / curl.sh
Last active September 21, 2018 03:33
Peeking inside OpenStack keystone Fernet token payloads: http://dolphm.com/inside-openstack-keystone-fernet-token-payloads
curl localhost:35357/v3/auth/tokens \
-H "X-Subject-Token: {{ fernet_token }}" \
-H "X-Auth-Token: {{ keystone.conf [default] admin_token }}" \
| python -m json.tool
$ whoami
user
$ sudo su
# whoami
root
$ whoami

user

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
@dolph
dolph / .flake8
Last active July 2, 2018 15:01
Converts JSON metadata to YAML headers
[flake8]
# E501: line too long
# E701: multiple statements on one line
ignore = E501,E701
@dolph
dolph / .travis.yml
Created June 21, 2018 15:05
ML4K Travis configuration draft
language: node_js
node_js:
- "8.10"
services:
- mysql
before_install:
- npm install -g typescript
- npm install -g tslint
- npm install -g tslint-eslint-rules
- npm install -g mocha
@dolph
dolph / auth.json
Last active June 7, 2018 07:06
Keystone performance benchmarking
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"domain": {
"id": "default"
04e0f4dc966d072df8bd129b3806a0798d8e1beef4e96b9edf845e88c898ade2356433e16697e78c95443990e275eda49a46162213958df46edc79d74b2926d4ac
[http] 2018/02/28 20:15:06 gorequest.go:1049: HTTP Request: POST /api/v2/generation/4da0686a-5e1e-4635-802b-c07e3deca858/8420ae4f-7dee-4619-b2aa-27abd31a67f3/generate?bss_account=a21c1d44cf86ed9f415a538f736d9920 HTTP/1.1
Host: bmd-dashboard-api.stage1.ng.bluemix.net
Authorization: [suppressed]
Content-Type: application/json
X-Auth-Iam-Token: Bearer [suppressed]
X-Codegen-Origin: cli
{"devOps":{"cfOptions":{"Memory":"","instances":1,"orgGuid":"20923446-4c82-4f13-a0de-169e72e38a02","organization":"","space":"","spaceGuid":"4da0686a-5e1e-4635-802b-c07e3deca858"},"deploymentType":"CF","kubeOptions":null,"region":""},"generate":[{"language":"node","type":"generator"}],"generatorOptions":null}
[http] 2018/02/28 20:15:07 gorequest.go:1078: HTTP Response: HTTP/1.1 202 Accepted
Connection: close
? select-resource-type
1. Backend Service / Web App
2. Mobile Client
Enter a number> 1
? select-language
1. Java - MicroProfile / Java EE
2. Java - Spring Framework
3. Node
4. Python - Django
1550 root 20 0 546M 103M 58856 S 62.2 0.3 37:25.89 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
62.6% CPU usage when I alt-tab in xfce.