Skip to content

Instantly share code, notes, and snippets.

View marcelaraujo's full-sized avatar

Marcel Araujo marcelaraujo

View GitHub Profile
@toraritte
toraritte / configure-postgres-to-allow-remote-connection.md
Last active September 4, 2023 01:06
Configure PostgreSQL to allow remote connections

Configure PostgreSQL to allow remote connections

NOTE: This post is a personal update to Neeraj Singh's post. [PostgreSQL must also be configured to allow remote connections][1], otherwise the connection request will fail, even if all firewalls rules are correct and PostgreSQL server is listening on the right port.

Steps

Outline

Couldn't create links, but this is a rather long answer so this may helps.

@bradwestfall
bradwestfall / HoC-vs-RenderProps-vs-Hooks.md
Last active April 14, 2024 15:54
An explanation of why Hooks are a nicer way to abstract re-useable state and functionality vs HoC's and Render Props

HoC (pattern) vs Render Props (pattern) vs Hooks (not pattern, a new API)

Someone was asking me about comparing the HoC and Render Props patterns (and their shortcomings) to hooks. I might leave this up as a public gist for others if it's helpful.


tldr;

Issues with HoC:

@jsdevtom
jsdevtom / frontend-ws-connection.ts
Last active April 17, 2024 07:35
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@cfra
cfra / ethernet-socat-ssh.md
Last active April 2, 2024 14:22
Tunneling Ethernet Over SSH With Socat and Tap Devices

Tunneling Ethernet Over SSH With Socat and Tap Devices

There are circumstances where one wants to attach the local machine to the same layer 2 ethernet segment, which a remote machine is connected to, with the only available transport being SSH.

While this solution has quite some shortcomings and should not be used to replace a real VPN, it can be beneficial e.g. for debugging network issues remotely.

@zytek
zytek / README.md
Last active September 5, 2023 18:24
Terraform to manage AWS RDS PostgreSQL databases, users and owners

Terraform vs PostgreSQL RDS

Thanks to new resources (postgresql_default_priviledges) and some fixes Terraform can now add new databases and manage ownership / access to them.

This example creates new database and two users. You can use owner to create new tables and run migrations and user for normal read/write access to database.

@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@gregjhogan
gregjhogan / generate-random-password.sh
Created January 20, 2019 03:11
Generate Random Password
openssl rand -base64 30
date +%s | sha256sum | base64 | head -c 32 ; echo
@gregjhogan
gregjhogan / azure-sdk-python-key-vault-get-secret-using-client-from-cli-credentials.py
Created November 29, 2018 01:04
azure sdk python key vault get secret using client from cli credentials
from azure.common.credentials import get_azure_cli_credentials
credentials, subscription_id = get_azure_cli_credentials(resource="https://vault.azure.net")
kv_client = KeyVaultClient(credentials=credentials)
kv_secret = kv_client.get_secret("https://<vault-name>.vault.azure.net/", "<secret-name>", "")
print(kv_secret.value)
@scc-agnitio
scc-agnitio / logger.js
Created November 15, 2018 12:02
Winton logger setup
var winston = require('winston');
const appName = "Content Server";
const version = "1.5.2";
var logger = new (winston.Logger)({
transports: [new winston.transports.File({
filename: __basePath + 'logs/log.log',
handleExceptions: false,
level: 'silly'
}),