Skip to content

Instantly share code, notes, and snippets.

eladnava /
Last active February 15, 2024 20:19
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
# Make sure to:
# 1) Name this file `` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x
# 7) Test it out via ./
eladnava / server.js
Created November 13, 2020 04:28
Get Facebook Ads Lead Notifications in Realtime with Node.js
View server.js
const axios = require('axios');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
// Enter the Page Access Token from the previous step
const FACEBOOK_PAGE_ACCESS_TOKEN = '_______________________________';
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
if [ "true" == ${ALREADYINVOKED:-false} ]
echo "RECURSION: Detected, stopping"
export ALREADYINVOKED="true"
eladnava / private.xml
Last active September 5, 2016 20:23
Karabiner private.xml for volume and music playback controls using F13 - F19 keys on wired Apple Keyboard
View private.xml
<?xml version="1.0"?>
<name>F19 to Sleep</name>
KeyCode::VK_CONSUMERKEY_EJECT, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L