Skip to content

Instantly share code, notes, and snippets.

View rondinelisaad's full-sized avatar

Rondineli Saad rondinelisaad

View GitHub Profile
@rondinelisaad
rondinelisaad / find_command.py
Last active November 5, 2015 10:05
script python para listar arquivos usando o modulo fnmatch
# !/usr/bin/python
# -*- coding: utf-8 -*-
#script name: find_command.py
#Description: Executa o comando de shell find a fim de encontrar arquivos com uma dada extensao/string e que foi acessado por um dado periodo.
#Verifica a data de criacao, acesso e tamanho.
#Coded by: Rondineli
import subprocess, os, sys, os.path, time
#findCMD => busca por arquivos no diretorio corrente, com dado nome e data de criacao
@rondinelisaad
rondinelisaad / compacta_log.sh
Last active October 21, 2015 16:13
compacta_log.sh
#!/bin/bash
#Author: Rondineli Saad
#Create in: 2015-10-15
#Version: 0.2
#Description: compacta os logs do apache e move para pasta com seu respectivo ano/mes/nome da instancia e envia para o ftp.ratchet.scielo.org para processamento.
DIR_SOURCE="<diretorio de log>"
DATE_YESTERDAY=`date -d "yesterday" +"%Y-%m-%d"`
MONTH_ATU=`date "+%B"`
MONTH_LAST=`date '+%B' --date '1 month ago'`
from sys import argv
import gzip
script, gzip_file = argv
with gzip.open(gzip_file) as g:
try:
while g.read(1024 * 1024):
pass
except IOError as e:
print("Corrompido!", e)
@rondinelisaad
rondinelisaad / update-macaw.sh
Created October 22, 2015 11:41
Macaw update script
!#/bin/sh
WEB_PATH=/var/www/macaw_bhlscielo_org
WEB_USER=apache
echo CHDIR
@rondinelisaad
rondinelisaad / Vagrantfile
Created October 23, 2015 12:57
Vagrantfile with vsphere plugin
Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = './example_box/dummy.box'
config.vm.provider :vsphere do |vsphere|
# The host we're going to connect to
vsphere.host = '[ip_vcenter]'
@rondinelisaad
rondinelisaad / Vagrantfile
Created October 23, 2015 17:36
Vagrantfile with puppet and shell provision
Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = './example_box/dummy.box'
config.vm.provider :vsphere do |vsphere|
# The host we're going to connect to
vsphere.host = '[ip_vcenter]'
#!/usr/bin/env python
#coding: utf-8
import argparse
import os
import time
username = 'postgres'
defaultdb = 'template1'
port = '5432'
date = time.strftime('%Y-%m-%d')
#!/usr/bin/python
#coding: utf-8
import os
from utils import *
#Autor: Rondineli Saad
#Versão: 0.1
#Nome do script: compactacao.py
#Descrição: script para compactação de arquivos de logs do apache, onde
#!/usr/bin/python
#coding: utf-8
from StringIO import StringIO
import subprocess
from utils import (send_mail, FROM, TO)
def list_ipcs():
"""
@rondinelisaad
rondinelisaad / user-data-node
Last active July 29, 2016 14:52
user-data-node1
#cloud-config
users:
- name: "core"
passwd: $6$rounds=4096$Y63druuqdw4NQcqy$tAWhdc.UuWia2/HP1IblRJ2IMABi.1XLOq.lmjJ6Znmdr2lQ.aBZulcMDyvFn.ivM.gtf4mppn.JvbMC7UXje0
coreos:
etcd2:
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
advertise-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
initial-cluster: etcdserver=http://192.168.169.55:2380