Skip to content

Instantly share code, notes, and snippets.

View zerefdev's full-sized avatar

Mosseab Chakrani zerefdev

View GitHub Profile
@zerefdev
zerefdev / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Created January 24, 2023 14:58 — forked from gubatron/multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent
View multiple-deploy-keys-multiple-private-repos-github-ssh-config.md

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

@zerefdev
zerefdev / check_env.ts
Last active November 8, 2022 18:06
Nest.js: check if all used environment variables are defined in .env before building.
View check_env.ts
import { createReadStream } from 'node:fs';
import { readdir } from 'node:fs/promises';
import { resolve } from 'node:path';
let envFileContent = '';
createReadStream('.env')
.on('data', (chunk) => {
envFileContent += chunk.toString();
})
.on('end', () => {
@zerefdev
zerefdev / mongo_backup.sh
Created May 11, 2021 15:39
MongoDB Backup Script
View mongo_backup.sh
#!/bin/sh
BACKUP_NAME=mongo_backup_`date +"%d-%m-%Y"`.gz
DB=db_name
USER=db_user
PASS=db_password
echo "Dumping MongoDB $DB database to compressed archive"
mongodump --db $DB --username=$USER --password=$PASS --archive=$HOME/backups/$BACKUP_NAME --gzip
View apidoc.code-snippets
{
"apidoc boilerplate": {
"scope": "javascript, typescript",
"prefix": "apidoc",
"body": [
"/**",
" * @api {$1} /$2/$3 $4",
" * @apiVersion 1.0.0",
" * @apiName $1-$3",
" * @apiGroup $2",
@zerefdev
zerefdev / docker-help.md
Created February 29, 2020 18:56 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@zerefdev
zerefdev / markdown-text-101.md
Created September 4, 2019 14:36 — forked from almeidx/markdown-text-101.md
A guide to Markdown on Discord.
View markdown-text-101.md

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__