Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Alfredo Braga alphabraga

🎯
Focusing
  • EMAP - Empresa Maranhense de Administração Portuária
  • São Luis, Brasil
  • @alphabraga
View GitHub Profile
View RM.exe.conf
ml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="JobServer3Camadas" value="true" />
<add key="Host" value="172.10.1.2" />
<add key="Port" value="8050" />
<add key="UpdateServer" value="172.10.1.2:8050"/>
<add key="EnableCompression" value="false" />
<add key="FileServerPath" value="\\SRV-TOTVS\totvs-storage" />
<add key="ActionsPath" value="C:\totvs\CorporeRM\RM.Net;C:\totvs\CorporeRM\Corpore.Net\Bin" />
@alphabraga
alphabraga / flush.sh
Created Jan 16, 2020
realiza o flush do poll do jboss
View flush.sh
#!/bin/bash
tipo=$1
if [ -z $tipo ]
then
echo "Parâmetro obrigatório info ou o tipo de operacao [all, idle]"
exit 1;
View videozap.sh
function videozap(){
f="para-zap-$(basename -- $1)"
ffmpeg -i $1 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p ./$f
}
View VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# 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|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@alphabraga
alphabraga / zeravaloresorcados.sql
Created Dec 14, 2018
procedure para zerar valores orçados
View zeravaloresorcados.sql
create or replace PROCEDURE ZERARVALORESORCAMENTO(ANO VARCHAR2) IS
ID_PERIODO NUMBER;
BEGIN
/**
Autores: ALfredo Braga / Paulo Moraes
Data : 05/11/2014
Atualmente o RM gerencia os itens de Orçamento de maneira peculiar.
View gist:ed86f443b9a8ae98848fc758876be539
declare
cursor c1 is
SELECT DISTINCT P.IDLANCAMENTO,
P.IDPARTIDA,
M.IDMOV,
M.TIPO,
M.CODCONTA AS CONTA_MOV,
CPRD.CODCONTA AS CONTA_PRD,
M.VALOR AS VALOR_CONTABIL,
PRD.CODCONTAGER AS CONTA_GERENCIAL_PRD,
@alphabraga
alphabraga / index.php
Created Mar 5, 2015
Simples exemplo de como usar o respect/validation não utilize isso em produção!
View index.php
<!DOCTYPE html>
<html>
<meta charset="UTF8" />
<head>
<title>Login</title>
</head>
<body>
<?php
require 'vendor/autoload.php';
@alphabraga
alphabraga / files_backup.sh
Last active Aug 29, 2015
BACKUP DE ARQUIVOS DO SITE
View files_backup.sh
#!/bin/bash
#Esse simples script realiza o ZIP dos arquivos de uma determinada pasta e
#em seguida os envia via rsync para um outro servidor.
#É necessário que em sua maquina você tenha instalado o rysnc
#É necessário também a criação de uma chave ssh para que não seja necessário a digitação de senha
echo "Iniciando compressão de arquivos da pasta de uploads";
zip -9 -r /root/files-backup/backup-arquivos-site-`date +"%d_%m_%Y"`.zip /var/www/html/site/public/files;
@alphabraga
alphabraga / mssql_connect.php
Created Feb 28, 2014
Simple code for connect with mssql
View mssql_connect.php
error_reporting(-1);
ini_set('display_errors', 'On');
ini_set("display_errors",1);
ini_set("error_reporting",E_ALL);
$conn = mssql_connect('localhost','user', 'pass');
mssql_select_db('database', $conn);
View gist:8617338
<?xml version="1.0" encoding="UTF-8"?>
<project name="DB Post Deploy Restore" default="run">
<property file="properties" />
<!-- find out what db's need to be restored and loop through the process for each -->
<target name="run">
<input propertyname="production.user">(Required) Please enter your ssh user name:</input>
<foreach list="${dbs}" param="db" target="prepare" />