Skip to content

Instantly share code, notes, and snippets.

@gigabyteservice
gigabyteservice / Install MongoDB on Ubuntu with Nginx and PHP
Created April 15, 2022 16:07
Install MongoDB on Ubuntu with Nginx and PHP
sudo apt update
sudo apt install nginx
sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
@gigabyteservice
gigabyteservice / PHP nginx site config
Created April 15, 2022 15:59
PHP nginx site config
server {
listen 80;
server_name example.com;
root /var/www/html/example.com/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
@gigabyteservice
gigabyteservice / How to Install MongoDB on Ubuntu 20.04.txt
Last active April 19, 2022 12:42
How to Install MongoDB on Ubuntu 20.04
sudo apt update
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt update
sudo apt install mongodb-org
#/bin/bash
set -e
# set -e: Exit immediately if a command exits with a non-zero status.
mynickjibri=`uuidgen`
# change the nickname of jibri
sed -i "s/\(^\s*nickname\s*=\).*/\1 \"$mynickjibri\"/" \
/etc/jitsi/jibri/jibri.conf
systemctl restart jibri
@gigabyteservice
gigabyteservice / loop-json.sh
Created April 10, 2022 16:50 — forked from IAmStoxe/loop-json.sh
This example shows you how to utilize jq to loop bash script through an array of JSON values.
jsonData='[{"name": "name#1","value": "value#1"},{"name": "name#2","value": "value#2"}]'
for row in $(echo "${jsonData}" | jq -r '.[] | @base64'); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
# OPTIONAL
# Set each property of the row to a variable
name=$(_jq '.name')
value=$(_jq '.value')
@gigabyteservice
gigabyteservice / create-docker-droplet.sh
Created April 8, 2022 23:04 — forked from christianberg/create-docker-droplet.sh
Shell script to create a Digital Ocean Droplet and install docker
#!/bin/bash
set -e
SECRETFILE=~/.digitalocean
if [[ -z $DIGOCEAN_ID ]] || [[ -z $DIGOCEAN_KEY ]]; then
if [ -e $SECRETFILE ]; then
. $SECRETFILE
fi
fi
@gigabyteservice
gigabyteservice / muc_allow_moderator_enter_lobby.patch
Created November 8, 2021 21:46 — forked from ashiqhassan95/muc_allow_moderator_enter_lobby.patch
Allow moderator to enter meeting without approval in lobby mode
Instruction
1. goto: cd /usr/share/jitsi-meet/prosody-plugins/
2. run: sudo patch -b </var/www/jitsi-meet/resources/prosody-plugins/muc_allow_moderator_enter_lobby.patch
3. You will see following:-
patching file mod_muc_lobby_rooms.lua
Hunk #1 succeeded at 1390 (offset 134 lines).
4. A backup file be saved in that same folder with named as mod_muc_lobby_rooms.lua.orig
==================================================================
--- mod_muc_lobby_rooms.lua 2021-09-16 11:43:45.425000000 +0530
+++ mod_muc_lobby_rooms.lua 2021-09-16 11:42:16.435872526 +0530
@gigabyteservice
gigabyteservice / send_jitsi_data.html
Created November 3, 2021 13:57 — forked from r03ert0/send_jitsi_data.html
Script showing how to send data through a Jitsi channel
<div>
<b>Message:</b>
<input
onchange="sendMessage(this.value)"
placeholder="Type and press enter to send message"
style="width: 640px"
/>
</div>
<div
id="info"
@gigabyteservice
gigabyteservice / jibri-minio.sh
Created October 20, 2021 20:15 — forked from dimaskiddo/jibri-minio.sh
Jitsi Jibri Automatic MinIO Uploader
#!/bin/bash -e
PATH=${PATH}:/usr/local/bin
# Configure Recordings
RECORDINGS_DIR=$1
# Configure MinIO
MC_PROTOCOL="YOUR_MINIO_PROTOCOL_HTTP_OR_HTTPS"
@gigabyteservice
gigabyteservice / jitsi_uploader.sh
Created October 20, 2021 20:14 — forked from sarahbanas/jitsi_uploader.sh
Modified /usr/bin/jitsi_uploader.sh that modifies the video file names and path, allowing you to insert the data into a remote or local MySQL database and move the video file to the static jitsi folder for browser viewing/download.
#!/bin/bash
RECORDINGS_DIR=$1
VIDEO_FILE_PATH=$(find $RECORDINGS_DIR -name *.mp4)
VIDEO_FILE_NAME=${VIDEO_FILE_PATH}
### WE USE THIS FILE FOR UPLOADS
CONFIG_FILE_PATH="/etc/jitsi/uploader"
# pull jitsi uploader environment var overrides if it exists