Skip to content

Instantly share code, notes, and snippets.

View israelalagbe's full-sized avatar

Israel Alagbe israelalagbe

View GitHub Profile
@israelalagbe
israelalagbe / getUsersByChunkSize.js
Last active February 26, 2025 01:09
Mongoose Get Decuments In Chunk (MongoDB)
const getUsersByChunkSize = async function * (chunkSize = 10) {
const limit = chunkSize;
let page = 1;
const total = await User.countDocuments({});
for(let startAt = 0; startAt < total; startAt += limit) {
const users = await User.find({}).skip(startAt).limit(limit);
@israelalagbe
israelalagbe / Readme.md
Created August 13, 2020 20:40 — forked from StefanieD/Readme.md
Install and use Supervisord with AWS Elastic Beanstalk, Symfony 2 and RabbitMq Bundle
  • Place the supervisord.conf under .ebextensions/supervisor/

  • Place the supervisor.config under .ebextensions/

  • Place the data_import_consumer.conf under .ebextensions/supervisor/

GET and Export all environment variables from elastic beanstalk

Bash Script

declare values="$(/opt/elasticbeanstalk/bin/get-config environment)"
for s in $(echo $values | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" ); do
    export $s
done