Skip to content

Instantly share code, notes, and snippets.

View cesarbruschetta's full-sized avatar
🎯
Focusing

Cesar Augusto cesarbruschetta

🎯
Focusing
View GitHub Profile
@cesarbruschetta
cesarbruschetta / gera_stmp_password.py
Created July 27, 2019 20:15
Gera senha para usuário do AWS Simple Email Service (SES)
import os #required to fetch environment varibles
import hmac #required to compute the HMAC key
import hashlib #required to create a SHA256 hash
import base64 #required to encode the computed key
import sys #required for system functions (exiting, in this case)
# Fetch the environment variable called AWS_SECRET_ACCESS_KEY, which contains
# the secret access key for your IAM user.
key = "<AWS_SECRET_ACCESS_KEY>"
#! /usr/bin/env python2.6
# -*- coding:utf-8 -*-
# apt-get install python-matplotlib
# http://www.htmlstaff.org/ver.php?id=24964
import pylab, datetime
log = open('temp.log','r').read()
text = log.split('\n')
# -*- coding: utf-8 -*-
"""
Script de test para criar registros e recurar e calcular media
SQL de criação da tabela
CREATE TABLE `tb_customer_account` (
`id_customer` INT NOT NULL ,
`cpf_cnpj` VARCHAR(20) NOT NULL ,
`nm_customer` VARCHAR(200) NOT NULL ,
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import urllib
from subprocess import call
#arquivo = sys.argv[1]
pasta_download = '/home/cesar_augusto/pacote-tar/'
pasta_download2 = '/home/cesar_augusto/pacote-zip/'
#/opt/virPython2.6/bin/python
#./bin/python
import os
from pyinotify import WatchManager, IN_DELETE, IN_CREATE, IN_CLOSE_WRITE, ProcessEvent, Notifier
import sys
#os.getcwd()
#os.path.realpath
#os.listdir(folder)
#! /usr/bin/python
# -*- coding: utf-8 -*-
from ConfigParser import ConfigParser
import os, time, subprocess, socket
class BackupDB(object):
str_date = time.strftime('%Y-%m-%d-%H:%M')
exclude_database = ['information_schema','performance_schema','test','mysql']
#!/bin/bash
# A linha acima é conhecida como shebang e server para chamar o interpretador do script
# poderia-se trocar o bash pelo sh ou outro shell de sua preferência
########################################################
# EXEMPLO DE SCRIPT DE FIREWALL PARA ARTIGO NO SITE www.vivaolinux.com.br
# CRIADO POR phrich
# Data da última alteração: 11/01/2012
# ######################################################
#!/bin/bash
DIR="$1"
# Caso nao seja digitado nenhum diretorio,
# Sera usado o diretorio corrente por padrao
if ! [ $DIR ]
then
DIR='.'
fi
#!/usr/bin/python
import os
import pyinotify
import sys
#Source code folder to monitor
folder_source = "/media/src/"
folder_dest = "/home/ubuntu/projects/"
#!/usr/bin/env python
"""
Real time log files watcher supporting log rotation.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
"""
import os