Skip to content

Instantly share code, notes, and snippets.

View adamjacobmuller's full-sized avatar

Adam Jacob Muller adamjacobmuller

  • ISPRIME and BelugaCDN
  • New York
View GitHub Profile
@alecs
alecs / gist:b9507fb44895e10ebafab1d463b4009d
Created October 29, 2021 09:46
Trudesk shell helper functions
sd_make() {
local accesstoken=""
local domain=""
local subject=$1
local description=$2
echo $1
echo $2
if [ -n "${subject}" -a -n "${description}" ]; then
curl "https://${domain}/api/v1/tickets/create" --compressed \
-H "authority: ${domain}" -H 'accept: application/json, text/plain, */*' \
FROM alpine:3.8
LABEL maintainer "Alex Negulescu <alecs@sysops.ro>"
ENV MONGO_USERNAME root
ENV MONGO_PASSWORD password
RUN addgroup -S -g 9999 mongodb 2>/dev/null
RUN adduser -S -D -h /var/lib/mongodb -s /sbin/nologin -G mongodb -g mongodb -u 9999 mongodb 2>/dev/null
@alecs
alecs / gist:606ec763ddf3fcaf675f3a682c11d623
Created November 19, 2021 17:11
mongodb entrypoint.sh
#!/bin/sh
# short circuit if first arg is not 'mongod'
[ "$1" = "mongod" ] || exec "$@" || exit $?
: ${MONGO_USERNAME}
: ${MONGO_PASSWORD}
# Database owned by mongodb
[ "$(stat -c %U /data/db)" = mongodb ] || chown -R mongodb /data/db