Skip to content

Instantly share code, notes, and snippets.

View pedropalhari's full-sized avatar

Pedro Palhari pedropalhari

View GitHub Profile
@pedropalhari
pedropalhari / miab-forward-all-spam.txt
Last active May 12, 2022 20:03
Disabe mail-in-a-box SPAM. Making all emails go to the inbox.
- Modify the SpamAssassin file
$ nano /etc/spamassassin/local.cf
- Add all domains as whitelisted from SpamAssassin, anywhere on the file
whitelist_from *@*
- Disable postgrey by creating a new .local file with whitelists and whitelisting every domain
$ nano /etc/postgrey/whitelist_clients.local
- Anywhere on the file
@pedropalhari
pedropalhari / create_postgresql_user.txt
Created July 22, 2022 02:42
Create PostgreSQL user - without trial and error.
- Go to the postgres user
$ sudo su postgres
- Execute create user
$ createuser --interactive <user>
- Change it's password inside postgres
$ psql
$ ALTER USER <user> WITH PASSWORD '<password>';
@pedropalhari
pedropalhari / gist:a2d7d046207a5f059c1bd4e1eb4735fe
Last active September 9, 2022 20:35 — forked from mkocikowski/gist:aeca878d58d313e902bb
Setting up Redis to run as a daemon under systemd

This can be used to daemonize anything that would normally run in the foreground; I picked Redis. Put this in /etc/systemd/system/redis.service:

[Unit]
Description=Redis
After=syslog.target

[Service]
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
RestartSec=5s
@pedropalhari
pedropalhari / vercel.env.d.ts
Created June 13, 2023 23:38
A gist containing all System Environment Variables from Vercel in `.d.ts` form so it can be used from a TypeScript deployed project
/**
* For more info on this variables, please check System Environment Variables on Vercel:
*
* https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables
*
* - Palhari, 2023/6/13
*/
declare namespace NodeJS {
export interface ProcessEnv {