Skip to content

Instantly share code, notes, and snippets.

View rafrancoso's full-sized avatar

Renato Aparecido Françoso rafrancoso

View GitHub Profile
@rafrancoso
rafrancoso / install_environment.sh
Created October 10, 2017 21:46
Configure Debian\Mint\Ubuntu Apache PHP7.1 Mysql and Oracle Client environment
#MySql
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password 123'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password 123'
apt-get install -y mysql-server
mysql -uroot -p123 -e "CREATE USER 'user'@'%' IDENTIFIED BY 'pass';"
mysql -uroot -p123 -e "GRANT ALL ON *.* TO 'user'@'%';"
#Allow external connection
#Mint/Ubuntu Version
#-sed -i "/^bind-address*/s/^/#/g" /etc/mysql/mysql.conf.d/mysqld.cnf
@rafrancoso
rafrancoso / oci8-php-debian.sh
Created December 14, 2018 15:27
Install oci8 php driver on Debian
#download oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm from oracle site
#download oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm from oracle site
apt-get install -y php7.1-dev build-essential php-pear libaio1 alien
alien -i oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
alien -i oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
yes '' | pecl install oci8
echo "extension=oci8.so" > /etc/php/7.1/mods-available/oci8.ini
ln -s /etc/php/7.1/mods-available/oci8.ini /etc/php/7.1/apache2/conf.d/oci8.ini
@rafrancoso
rafrancoso / feriados_moveis.sql
Created March 6, 2019 19:14
Calcular a data da páscoa, Paixão de Cristo e Carnaval
/*Busca via WS a data da Páscoa de cada ano e calcula o carnaval, Paixão de Cristo e Corpus Christi entre 2019 e 2029*/
SELECT ANO
,PASCOA
,PASCOA - 47 AS CARNAVAL
,PASCOA - 2 AS PAIXAO_DE_CRISTO
,PASCOA + 60 AS CORPUS_CHRISTI
FROM (SELECT 2000 + LEVEL AS ANO
,CAST(TO_TIMESTAMP_TZ(EXTRACTVALUE(HTTPURITYPE('www.holidaywebservice.com/Holidays/GBSCT/Dates/GBSCTHolidayDates.asmx/GetEaster?year=' || TO_CHAR(2000 + LEVEL))
.GETXML(),
'/dateTime',