Skip to content

Instantly share code, notes, and snippets.

@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active October 22, 2024 20:39
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'
@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 September 23, 2024 06:16
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;