Skip to content

Instantly share code, notes, and snippets.

@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active January 21, 2025 17:22
Debian/Ubuntu - CERTBOT without SNAP/SNAPD

CERTBOT - Install using Python PIP

Install Certbot using Python PIP (Package Installer for Python) - without using SNAP, APT or SYSTEMD. (Debian/Ubuntu)


This guide will help you install LetsEncrypt / Certbot using venv PIP under Debian/Ubuntu.

  • This guide has been tested up to Debian 12 / Bookworm.
@deniscapeto
deniscapeto / main_csv.js
Last active February 4, 2024 14:56
K6 load testing using CSV file
import papaparse from 'https://jslib.k6.io/papaparse/5.1.1/index.js';
import { SharedArray } from "k6/data";
import http from 'k6/http';
import { check } from 'k6';
const csvData = new SharedArray("another data name", function() {
return papaparse.parse(open('./data.csv'), { header: true }).data;
});
const BASE_URL = 'https://www.mywebsiteundertest.com.br'
@fabiolimace
fabiolimace / UUIDv6.sql
Last active April 2, 2025 00:39
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@djfdyuruiry
djfdyuruiry / MultiThreadedCsvReaderWriter.java
Last active July 5, 2024 12:03
Multi-threaded CSV Reader/Writer for Java
// uses Apache commons CSV, IO and Lang
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
@ststeiger
ststeiger / Foreign_key_dependencies_PGSQL.sql
Last active January 4, 2025 19:59
List tables by foreign-key dependencies PostgreSQL (also works on MS-SQL with minor modifications)
DROP TABLE IF EXISTS CTE_AllTables;
-- CREATE TEMPORARY TABLE IF NOT EXISTS CTE_AllTables
CREATE TEMPORARY TABLE CTE_AllTables AS
SELECT
ist.table_schema AS OnTableSchema
,ist.table_name AS OnTableName
,tForeignKeyInformation.FkNullable
-- WARNING: TableSchema or Tablename can contain entry-separator (';' used)
,CAST(DENSE_RANK() OVER (ORDER BY ist.table_schema, ist.table_name) AS varchar(20)) AS OnTableId
@jfrost
jfrost / gist:6382059
Last active May 16, 2024 18:41
PostgreSQL Duplicate indexes check
\o /tmp/duplicate-indexes.txt
-- check for exact matches
SELECT indrelid::regclass
, array_agg(indexrelid::regclass)
FROM pg_index
GROUP BY indrelid
, indkey
HAVING COUNT(*) > 1;