Skip to content

Instantly share code, notes, and snippets.

@ardentperf
ardentperf / run_test_uuid.sh
Created February 3, 2024 11:38
UUID benchmark driver script
#!/bin/bash
INIT_TABLE_ROWS=20000000
PGBENCH_TRANSACTIONS_PER_CLIENT=100000
PGBENCH_CLIENTS=10
run_test() {
echo "$(date +%y%m%d.%H%M) STARTING TEST $1"
pg_stop
@fabiolimace
fabiolimace / baixar_ebooks_comprados_amazon.json
Last active September 28, 2024 19:29
Isto é um robô que baixa todos os ebooks comprados na Amazon, usando a extensão do Firefox 'UI.Vision RPA' v9.2.9. Pode baixar 4000 livros da coleção pessoal em cerca de 10h. Informe a a quantidade de páginas de seu Conteúdo Digital na variável 'pmax'. Última atualização em 25/09/2024.
{
"Name": "baixar_ebooks_comprados_amazon",
"CreationDate": "2024-9-26",
"Commands": [
{
"Command": "comment",
"Target": "Isto é um robô que baixa todos os ebooks comprados na Amazon, usando a extensão do Firefox 'UI.Vision RPA' v9.2.9. Pode baixar 4000 livros da coleção pessoal em cerca de 10h. Informe a a quantidade de páginas de seu Conteúdo Digital na variável 'pmax'. Última atualização em 25/09/2024.",
"Value": "",
"Description": ""
},
@fernandobarbalho
fernandobarbalho / ibge_municipios_2022.r
Last active August 2, 2023 12:47
FAz downoload da tabela com dados de população, área e densidade demográfica de municípios. Em seguida faz tratamentos na tabela. Retorna um dataframe
gera_tabela_ibge_municipios<- function(){
# Load required libraries
library(httr)
library(jsonlite)
library(janitor)
library(tidyverse)
# API endpoint URL
api_url <- "https://apisidra.ibge.gov.br/values/t/4714/n6/all/v/all/p/all/d/v614%202"
@fabiolimace
fabiolimace / one-page-prtsc-to-pdf.sh
Last active September 28, 2024 19:28
Convert a set of two-page print screens into a single PDF file using ImageMagick
#!/bin/bash
#
# Convert a folder containing one page printscreens in PNG format to a PDF file.
#
# Before using this script, you have to make print screens from the book you want to convert to PDF.
#
# This script processes all print screens and generates a PDF file with A4 page size.
#
# If the output file is too big, you can simply print it to file to generate a smaller version of the output file.
#
This file has been truncated, but you can view the full file.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/44.0.2403.67 Mobile/12D508 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0
library(rvest)
library(tidyverse)
#-- links
url = "https://www.camara.leg.br/internet/sitaqweb/resultadoPesquisaDiscursos.asp?txIndexacao=&CurrentPage=19&BasePesq=plenario&txOrador=JAIR%20BOLSONARO&txPartido=&dtInicio=&dtFim=&txUF=&txSessao=&listaTipoSessao=&listaTipoInterv=&inFalaPres=&listaTipoFala=&listaFaseSessao=&txAparteante=&listaEtapa=&CampoOrdenacao=dtSessao&TipoOrdenacao=DESC&PageSize=50&txTexto=&txSumario="
url %>%
read_html(url) %>%
html_nodes("a") %>%
@KarthickSudhakar
KarthickSudhakar / kvm_export_import.sh
Last active October 28, 2024 20:11
Bash script to import and export KVM virtual machine
#!/usr/bin/env bash
# ----------------------------------------------------------------------------------------------------
# AUTHOR : KARTHICK S
# PURPOSE : THIS SCRIPT WILL EXPORT/IMPORT THE CONFIG AND VM DISK.
#
# usage:
# export function will take care of exporting the necessary for all VM. Run as "<scriptname.sh> export"
# import function will take care of importing the necessary for all VM. Run as "<scriptname.sh> import"
#
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active November 6, 2024 19:57
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@alexishida
alexishida / Manual Instalação Token ePass2003 Ubuntu.txt
Created August 16, 2021 13:26
Instalando token ePass2003 - Ubuntu
-----------------------------------------------------------------------------------------------------------------------------
PROCEDIMENTOS PARA INSTALAÇÃO ePass2003
Autor: Alex Ishida <[email protected]>
Data: 16/08/2021
Versão: 1.0.0.0
-----------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------
# Instalando os Drivers
@thinkerman
thinkerman / awesome-php.md
Created March 7, 2021 17:39 — forked from llbbl/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks