Skip to content

Instantly share code, notes, and snippets.

View brunobbbs's full-sized avatar

Bruno Barbosa brunobbbs

View GitHub Profile
@brunobbbs
brunobbbs / secret_gen.py
Created January 18, 2016 01:52 — forked from henriquebastos/secret_gen.py
SECRET_KEY generator.
#!/usr/bin/env python
"""
Django SECRET_KEY generator.
"""
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
print(get_random_string(50, chars))
@brunobbbs
brunobbbs / forms.py
Created March 15, 2016 14:54
Login with email on Django
from django.contrib.auth import authenticate, login as l
class LoginForm(forms.Form):
email = forms.EmailField(
label=_("Email"),
widget=forms.TextInput(
attrs={'class': 'form-control', 'placeholder': 'Email'}
)
)
@brunobbbs
brunobbbs / tsuru-now-ubuntu-1404.sh
Last active January 9, 2017 22:01
Script to install tsuru on ubuntu 14.04
#!/bin/bash -ue
# Copyright 2016 tsuru-now authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
set -eu
release=""
codename=""

Keybase proof

I hereby claim:

  • I am brunobbbs on github.
  • I am brunobbbs (https://keybase.io/brunobbbs) on keybase.
  • I have a public key ASAczGGn_0ov45gVznTTiCy1LP80xrQjS2w9Fb44zmdleAo

To claim this, I am signing this object:

@brunobbbs
brunobbbs / default.vcl
Last active July 5, 2020 08:45
Varnish example file for Plone installation
# VCL file optimized for plone.app.caching. See vcl(7) for details
vcl 4.0;
import directors;
import std;
probe healthcheck {
.interval = 10s;
.request = "HEAD / HTTP/1.1";
#!/usr/bin/env python
# Copyright 2016 Pablo Santiago Blum de Aguiar <scorphus@gmail.com>. All rights
# reserved. Use of this source code is governed by the BSD 2-Clause License that
# can be found in the LICENSE file.
import argparse
import json
import os
import sys