Skip to content

Instantly share code, notes, and snippets.

View viniciusmelocodes's full-sized avatar
:octocat:
Serving customers with high quality projects

Vinícius Melo viniciusmelocodes

:octocat:
Serving customers with high quality projects
  • Vinícius Melo
  • Brazil
View GitHub Profile
SELECT
CAD.CADASTRO_ID,
COUNT(*)
FROM
CADASTROS CAD
GROUP BY
CAD.CADASTRO_ID
HAVING
COUNT(*) > 1
@viniciusmelocodes
viniciusmelocodes / install_oci8_ubuntu20_04_php7.4_oracle_11g.md
Last active February 2, 2022 05:18 — forked from eSkiSo/install_oci8_ubuntu20_php7.4.md
Install OCI8 (Oracle) in Ubuntu 20.04 with PHP 7.4 (Oracle 11G)
@viniciusmelocodes
viniciusmelocodes / install_oci8_ubuntu20_php7.4.md
Created February 2, 2022 05:14 — forked from enlinea777/install_oci8_ubuntu20_php7.4.md
Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4
SELECT
COL.COLUMN_ID,
COL.OWNER AS SCHEMA_NAME,
COL.TABLE_NAME,
COL.COLUMN_NAME,
COL.DATA_TYPE,
COL.DATA_LENGTH,
COL.DATA_PRECISION,
COL.DATA_SCALE,
COL.NULLABLE
CREATE OR ALTER USER FB_ADMIN PASSWORD 'fb_admin' GRANT ADMIN ROLE;
EXECUTE BLOCK
AS
DECLARE VARIABLE tablename VARCHAR(32);
BEGIN
FOR SELECT rdb$relation_name
FROM rdb$relations
WHERE rdb$view_blr IS NULL
AND (rdb$system_flag IS NULL OR rdb$system_flag = 0)
# Guarda data inicial.
dataInicial=$(date)
# Envia notificação para ser mostrado no sistema.
zenity --notification --text "$dataInicial: Iniciando rotina de backup automático para GDrive."
# Salva texto em arquivo de log.
echo "$dataInicial: Iniciando rotina de backup automático para GDrive." >> /ESTACAO/BANCODADOS/log_gbak_fdb.log
# Gera o arquivo de backup.
# google-drive-ocamlfuse
$ sudo add-apt-repository ppa:alessandro-strada/ppa
$ sudo apt update && sudo apt install google-drive-ocamlfuse
# To set your Google drive folder, launch the tool.
$ google-drive-ocamlfuse
# It’ll pop up a webpage in your default browser, prompting you to log in to your Google account.
Salvar em crontab -e:
# Backup do banco de dados TROPICAL.fdb - 12:00 todo dia
0 12 * * * cd /ESTACAO/BANCODADOS && ./backup_banco_dados_tropical.sh
# Backup do banco de dados TROPICAL.fdb - 00:00 todo dia
0 0 * * * cd /ESTACAO/BANCODADOS && ./backup_banco_dados_tropical.sh
[
IIF(Length(<MASTER."CNPJ_CPF">) = 11,
FormatMaskText('000\.000\.000\-00;0;_', <MASTER."CNPJ_CPF">),
FormatMaskText('00\.000\.000\/0000\-00;0;_', <MASTER."CNPJ_CPF">),
)
]
$path = "D:\trunk"
Get-ChildItem $path -Hidden -Recurse -Filter "__history" | Remove-Item -Force -Verbose -Recurse
Write-Host "Feito: __history"
Write-Host
Get-ChildItem $path -Hidden -Recurse -Filter "__recovery" | Remove-Item -Force -Verbose -Recurse
Write-Host "Feito: __recovery"
Write-Host