Skip to content

Instantly share code, notes, and snippets.

View debdutdeb's full-sized avatar
🩸

Debdut Chakraborty debdutdeb

🩸
View GitHub Profile
import {
IRead,
IModify,
IHttp,
IPersistence,
} from "@rocket.chat/apps-engine/definition/accessors";
import {
ISlashCommand,
SlashCommandContext,
} from "@rocket.chat/apps-engine/definition/slashcommands";
@debdutdeb
debdutdeb / privacy.md
Created August 9, 2022 12:44
TOS and Privacy statements for rocket.chat publisher profile

These apps do not collect any personal information, named or anonymous.

  • discuss
  • Slow Mode
@debdutdeb
debdutdeb / doom.txt
Created June 25, 2022 13:01 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@debdutdeb
debdutdeb / README.md
Last active January 21, 2022 14:46
Exporting livechat messages from db

Livechat rooms and messages both are stored in the same collection, rocketchat_room & rocketchat_message.

To first export the livechat rooms as a json file, use mongoexport like so,

mongoexport --collection=rocketchat_room --db=rocketchat \
  --jsonArray -q='{"t": "l"}' --sort='{_id: 1}' --pretty \
  --jsonFormat=canonical --type=json --out=livechat_rooms.json
@debdutdeb
debdutdeb / do.sh
Last active November 26, 2021 12:28
(cd /tmp; wget https://raw.githubusercontent.com/RocketChat/rocketchat-packer/main/image_creation/motd.sh)
cat > /var/lib/cloud/scripts/per-instance/01-set-root-url.sh <<EOF
#!/bin/bash
sed -E "s@^Environment=ROOT_URL=.+@Environment=ROOT_URL=http://\$(curl -s ipinfo.io/ip):3000@" /lib/systemd/system/rocketchat.service -i
systemctl daemon-reload
systemctl restart rocketchat
EOF
chmod +x /var/lib/cloud/scripts/per-instance/01-set-root-url.sh
export SOURCE_NAME=do-marketplace
export ROCKETCHAT_VERSION=latest
@debdutdeb
debdutdeb / README.md
Last active May 17, 2021 03:38
Vagrantfile for LVM testing.
  1. Save this file in your disk and change your PWD to that directory.

  2. Set the environment variable VAGRANT_EXPERIMENTAL to "disks".

export VAGRANT_EXPERIMENTAL=disks
  1. Finally start the vm with vagrant up. You'll definitely see a couple of warning messages like these:-
@debdutdeb
debdutdeb / inspect.json
Created May 12, 2021 13:03
Docker some nginx container inspect output.
[
{
"Id": "0409779fc2d976387170d664a6aed5ee80a460f8a8dd02c44a02af97df0bb956",
"Created": "2021-05-12T13:00:37.691732507Z",
"Path": "/docker-entrypoint.sh",
"Args": [
"nginx",
"-g",
"daemon off;"
],
@debdutdeb
debdutdeb / Dockerfile
Created May 2, 2021 06:48
Dockerfile and C program to demonstrate container stopping.
FROM alpine:latest AS builder
WORKDIR /
COPY stop.c .
RUN apk add --no-cache gcc libc-dev && \
gcc -o stop stop.c
FROM alpine:latest
@debdutdeb
debdutdeb / Dockerfile
Created May 2, 2021 06:47
Dockerfile and C program to demonstrate container pausing.
FROM alpine:latest AS builder
WORKDIR /
COPY pause.c .
RUN apk add --no-cache gcc libc-dev && \
gcc -o pause pause.c
FROM alpine:latest
WORKDIR /
@debdutdeb
debdutdeb / I.cpp
Last active April 12, 2021 07:22
I like how C++ programs look
#include <iostream>
class Printable {
public:
virtual void print() = 0;
};
class I : public Printable {
private:
std::string *name;