Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View clouedoc's full-sized avatar
🌴
Doing absolutely nothing

Camille Louédoc-Eyriès clouedoc

🌴
Doing absolutely nothing
View GitHub Profile
@clouedoc
clouedoc / hetzner_outgoing_traffic.md
Last active April 17, 2024 01:24
Hetzner Robo outgoing traffic is not reaching some IPs

Hetzner stroking on some TCP outgoing traffic

My Robo server can access some IPs, but not some others. Weird!

Adding explicit TCP outgoing allow rules (fail)

I explicitely enabled outgoing IPv4 TCP + UDP traffic. Four entries in total:

  • IPv4 TCP
  • IPv4 UDP
@clouedoc
clouedoc / swc_converts_dynamic_import_to_require.md
Created April 15, 2024 01:23
SWC converts dynamic `import` calls to `require`, and it made me crazy. But I found the solution!

SWC converts dynamic import calls to require

This document describes the problem I faced as well as the solution

Problem

I need to access an ESM module from my output CJS project.

(I don't understand all of these terms well)

@clouedoc
clouedoc / pgbackrest-kawaii-n8n.json
Last active October 4, 2023 21:12
An n8n pgbackrest backup checker that talks to you nicely — because managing a database is already hard as it is!
{
"name": "pgbackrest auto-verifications",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 16
}

k8s

Adding nodes

Control plane

hostnamectl hostname controlplane
pacman -S wireguard-tools open-iscsi mosh git zsh
systemctl enable iscsid && systemctl start iscsi
import type { IMailCredentials } from './credentials';
import { findAndFetchMessage } from './fetch-mail';
/**
* Check if the credentials are working.
* @param credentials
* @throws if the credentials are invalid
*/
export async function mailCheckValid(credentials: IMailCredentials): Promise<void> {
const messages = await findAndFetchMessage(credentials, ['ALL']);

pgbouncer: no such user

If pgbouncer is returning a no such user error, make sure that BYPASSRLS is not enabled on the user that you are trying to connect to.

I don’t exactly know why, but it won’t work.

ALTER USER myuser WITH NOBYPASSRLS
@clouedoc
clouedoc / timescaledb_error.md
Created October 15, 2022 15:19
Pq: function time_bucket(unknown, timestamp without time zone) does not exist

Weird TimescaleDB permission error

Hello there,

I've encountered this error while trying to add a TimescaleDB (Postgres) datasource to Postgres:

Pq: function time_bucket(unknown, timestamp without time zone) does not exist

There is no solution online, so I've decided to post mine here. I hope that it finds you well

@clouedoc
clouedoc / proxyrack-countries.json
Created October 9, 2022 20:46
List of countries that ProxyRack can serve as of 9 oct. 2022
[
"CV",
"ID",
"BA",
"CR",
"CD",
"BF",
"NP",
"SE",
"PT",
@clouedoc
clouedoc / Dockerfile.squid
Created June 4, 2022 11:57
Dockerfile for squid with SSL interception and caching
FROM salrashid123/squidproxy
ENTRYPOINT [ "/apps/squid/sbin/squid" ]
CMD [ "-NsY", "-f", "/apps/squid.conf.intercept"]
# test your proxy with this command:
# curl --insecure --proxy http://<Your Proxy Host Here>:3128 https://www.lagado.com/tools/cache-test | grep "page serial number</b></td"
# the number should be the same everytime
@clouedoc
clouedoc / block-assets-plugin.ts
Last active June 2, 2022 17:43
This puppeteer-extra plugin blocks requests based on patterns. It includes supports for service workers.
import { CDPSession, Page, Target, WebWorker } from 'puppeteer';
import { PuppeteerExtraPlugin } from 'puppeteer-extra-plugin';
const blockedResources: string[] = [
// Assets
'*/favicon.ico',
'.css',
'.jpg',
'.jpeg',
'.png',