Skip to content

Instantly share code, notes, and snippets.

View thiago-vieira's full-sized avatar
🏴

Thiago Vieira thiago-vieira

🏴
View GitHub Profile
@thiago-vieira
thiago-vieira / search_columns.sql
Created August 22, 2022 15:59
PostgreSQL - procurar em todas as tabelas de um schema por um determinado valor:
CREATE OR REPLACE FUNCTION search_columns(
needle text,
haystack_tables name[] default '{}',
haystack_schema name[] default '{public}'
)
RETURNS table(schemaname text, tablename text, columnname text, rowctid text)
AS $$
begin
FOR schemaname,tablename,columnname IN
SELECT c.table_schema,c.table_name,c.column_name
@thiago-vieira
thiago-vieira / realtime.bat
Created August 7, 2022 01:41
Fazendo o Windows usar o mesmo horário que o Linux
# executar no cmd ou PowerShell como administrador
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1
@thiago-vieira
thiago-vieira / dual_boot_windows_pop.sh
Last active August 7, 2022 00:14
Dual Boot Windows 10 e pop OS 22.04
# Após instalar o Linux, verifique qual é a partição do sistema EFI do Windows (exemplo: /dev/sda1)
sudo fdisk -l
# Crie uma pasta e monte a partição do sistema EFI do Windows nesta pasta
sudo mkdir /mnt/efi-windows
sudo mount /dev/sda1 /mnt/efi-windows
@thiago-vieira
thiago-vieira / terminal.sh
Created July 26, 2022 14:03
Convert disk from kvm to ovirt
qemu-img convert <disco_origem>.img -O qcow2 <disco_destino>.qcow2
@thiago-vieira
thiago-vieira / tcpdump.sh
Last active July 20, 2022 17:44
Capturing with “tcpdump” for viewing with Wireshark
tcpdump -i eth0 -s 65535 -w tcpdump.log
@thiago-vieira
thiago-vieira / hotfix_plone.txt
Last active July 11, 2022 18:43
Instalação de hotfix no Plone 4
Instalação de hotfix no Plone
A página a seguir lista todos os hotfixes disponíveis para cada versão
do Plone: https://plone.org/security/hotfixes
Basta seguir as instruções contidas nas páginas de cada hotfix.
Caso encontre o erro SSLV3_ALERT_HANDSHAKE_FAILURE ou
CERTIFICATE_VERIFY_FAILED ao executar o buildout e o download do produto
(hotfix) não seja concluído, é possível que o Plone esteja rodando com
@thiago-vieira
thiago-vieira / add_log.sql
Last active April 11, 2021 05:28
Exemplo de PL/SQL com uso de execute immediate
DECLARE
permissao_existe number(4);
log_anterior_existe number(4);
responsavel_id number(8);
usuario_id number(8);
setor_id number(8);
tipo_permissao varchar(30 CHAR);
id_ccod_objeto varchar(18 CHAR);
motivo varchar(100 BYTE);
dataHoraAgora date;
@thiago-vieira
thiago-vieira / log_table.sql
Created April 11, 2021 05:12
Exemplo de tabela para fazer log de inclusão e exclusão de registros
-- schema and data test
create table log_table
( id integer,
tipo varchar2(30),
usuario integer,
setor integer,
data_inclusao date,
data_exclusao date,
id_anterior integer,
status_atual integer
@thiago-vieira
thiago-vieira / search.md
Last active March 27, 2021 01:32
finding-my-gists
@thiago-vieira
thiago-vieira / plone.sh
Last active March 27, 2021 01:11
Startup script for Plone
#!/bin/sh
# Startup script for Plone
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 1
fi