Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
🏠
Working from home

Lindemberg Barbosa bergpb

🏠
Working from home
View GitHub Profile
@bergpb
bergpb / install_cubic.sh
Created November 22, 2019 13:04
Install Cubic (Custom Ubuntu Image Creator)
# give permissions to execute file: chmod +x install_cubic.sh
# execute file ./install_cubic.sh
echo Installing CUBIC.....
sudo apt-add-repository ppa:cubic-wizard/release -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6494C6D6997C215E
sudo apt update && sudo apt install cubic -y
echo Finished!
@bergpb
bergpb / wsgi.py
Created November 16, 2019 21:30
wsgi.py - LisaPi
from lisapi import create_app
socketio, app = create_app()
# socketio.run(app)
if __name__ == "__main__":
socketio.run(app)
@bergpb
bergpb / __init__.py
Created November 16, 2019 21:29
__init__.py - LisaPi
import os
import config
from flask import Flask
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from flask_socketio import SocketIO, emit
db = SQLAlchemy()
migrate = Migrate()
@bergpb
bergpb / icons.txt
Created November 14, 2019 19:16
List with all Font Awesome 5 Icons
["500px", "accessible-icon", "accusoft", "acquisitions-incorporated", "ad", "address-book", "address-card", "adjust", "adn", "adobe", "adversal", "affiliatetheme", "air-freshener", "airbnb", "algolia", "align-center", "align-justify", "align-left", "align-right", "alipay", "allergies", "amazon", "amazon-pay", "ambulance", "american-sign-language-interpreting", "amilia", "anchor", "android", "angellist", "angle-double-down", "angle-double-left", "angle-double-right", "angle-double-up", "angle-down", "angle-left", "angle-right", "angle-up", "angry", "angrycreative", "angular", "ankh", "app-store", "app-store-ios", "apper", "apple", "apple-alt", "apple-pay", "archive", "archway", "arrow-alt-circle-down", "arrow-alt-circle-left", "arrow-alt-circle-right", "arrow-alt-circle-up", "arrow-circle-down", "arrow-circle-left", "arrow-circle-right", "arrow-circle-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "arrows-alt", "arrows-alt-h", "arrows-alt-v", "artstation", "assistive-listening-systems", "asterisk"
@bergpb
bergpb / Vagrantfile
Last active September 8, 2019 16:43
Vagrant - Zabbix + Grafana
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Install Zabbix and Grafana
# based on https://gist.github.com/ad-m/189273d73388e094293a35267d7301c3
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@bergpb
bergpb / Vagrantfile
Created September 5, 2019 18:41
Vagrantfile <- Zabbix 4.0 + Ubuntu Trusty64
# -*- mode: ruby -*-
# vi: set ft=ruby :
# based on https://gist.github.com/ad-m/189273d73388e094293a35267d7301c3
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
import re
class Pessoa():
@staticmethod
def validaCpf(cpf):
if (len(cpf) == 11) and (re.match('[0-9]+', cpf)):
return True
else:
return False
@bergpb
bergpb / Jenkinsfile
Last active August 27, 2019 01:33
Simple Jenkins declarative example
pipeline {
agent any
stages {
stage('build') {
steps {
echo 'Running build ...'
}
}
stage('test') {
steps {
@bergpb
bergpb / app.py
Created August 18, 2019 12:50
Get id with javascript in flask web app
from flask import Flask, render_template_string
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
data = [
{'id': 1, 'name': 'Nicola', 'age': 17},
{'id': 2, 'name': 'Josh', 'age': 17},
@bergpb
bergpb / aula_05_exer04.py
Created August 17, 2019 17:20
Exercício da Disciplina de Técnicas de Programação - Aula 05
from datetime import datetime as dt
class Pessoa:
def __init__(self, nome, cpf, data_nascimento):
self.nome = nome
self.cpf = cpf
self.data_nascimento = data_nascimento
class Funcionario(Pessoa):