Skip to content

Instantly share code, notes, and snippets.

View sandromello's full-sized avatar

Sandro Mello sandromello

View GitHub Profile
@sandromello
sandromello / themis-policy.py
Last active January 12, 2016 20:10
Example using themis-core classes
# Considerando que a máquina possua o pacote themis-core instalado é possível acessar os dados
>>> from themis.marshalredis import MarshalRedis
>>> from themis.policy import Policy
>>> p = Policy(MarshalRedis('redis01.domain.tld'))
>>> print json.dumps(pdata.as_dict, indent=2)
{
"enable": true,
"jailaction": "block",
"actionheaders": {},
"policy_name": "xxxxxxxx",
swagger: "2.0"
info:
description: |
Koli fucking box.
[Learn about Swagger](http://swagger.wordnik.com) or join the IRC channel `#swagger` on irc.freenode.net.
For this sample, you can use the api key `special-key` to test the authorization filters
version: "1.0.0"
title: Koli API
@sandromello
sandromello / aws-ip.sh
Created April 6, 2016 12:43
aws-cli get instances ips
#!/bin/bash
searchString=$1
IpSearchType=PublicIpAddress
if [ "$1" = "private" ]; then
IpSearchType=PrivateIpAddress
searchString=$2
else
IpSearchType=PublicIpAddress
fi
@sandromello
sandromello / auth.py
Created July 4, 2016 12:20
Autenticação Loja
import urlparse
import requests
AUTH_URL = 'https://{}/public/login?integrandose=true'.format('app.lojaintegrada-staging.com.br')
form_data = {
'email': STORE_USER,
'senha': STORE_USER_PASSWD
}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
r = requests.post(AUTH_URL, data=form_data, headers=headers, allow_redirects=False, verify=False)
@sandromello
sandromello / minio-server.json
Created August 24, 2016 12:03
Minio Server Pod
{
"kind": "ReplicationController",
"apiVersion": "v1",
"metadata": {
"name": "minio",
"labels": {
"app": "minio"
}
},
"spec": {
@sandromello
sandromello / bundle.yml
Created September 28, 2016 01:41
Koli Quick Install
apiVersion: v1
kind: Secret
data:
accesskey: OFRaUlkySlJXTVBUNlVNWFI2STU=
secretkey: Z2JzdHJPdm90TU1jZzJzTWZHVWhBNWE2RXQvRUk1QUx0SUhzb2JZaw==
metadata:
name: objectstorage-keyfile
labels:
app: minio
namespace: koli-system
@sandromello
sandromello / minio-expose.yml
Created September 28, 2016 01:42
Minio Expose
kind: Service
apiVersion: v1
metadata:
name: minio
labels:
app: minio
namespace: koli-system
spec:
clusterIP: 10.0.0.25
ports:
@sandromello
sandromello / authentication-webhook.yaml
Last active October 4, 2016 16:11
Authentication Webhook Test
# clusters refers to the remote service.
clusters:
- name: remote-auth
cluster:
insecure-skip-tls-verify: true
server: http://192.168.0.101:8000/webhook-auth # URL of remote service to query. Must use 'https'.
# kubeconfig files require a context. Provide one for the API server.
current-context: webhook
contexts:
@sandromello
sandromello / bundle-ksolo.yml
Created October 4, 2016 15:24
Koli Bundle Kube Solo
apiVersion: v1
kind: Secret
data:
accesskey: OFRaUlkySlJXTVBUNlVNWFI2STU=
secretkey: Z2JzdHJPdm90TU1jZzJzTWZHVWhBNWE2RXQvRUk1QUx0SUhzb2JZaw==
metadata:
name: objectstorage-keyfile
labels:
app: minio
namespace: koli-system
@sandromello
sandromello / minio-service-ksolo.yml
Created October 4, 2016 15:30
Minio Service Kube Solo
kind: Service
apiVersion: v1
metadata:
name: minio
labels:
app: minio
namespace: koli-system
spec:
clusterIP: 10.100.254.40
ports: