Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / ssl-cert-on-ubuntu-lightsail-for-Moodle.md
Last active Mar 27, 2022
Setting up LetsEncrypt SSL certificate for Moodle on Ubuntu
View ssl-cert-on-ubuntu-lightsail-for-Moodle.md

Setting up LetsEncrypt SSL certificate for Moodle on Ubuntu

  1. Install certbot

sudo apt install certbot python3-certbot-apache
  1. Enable firewall to allow Apache https and ssh

sudo ufw status
sudo ufw enable
@nanusdad
nanusdad / linux-package-installation-and-management.md
Created Jan 25, 2022
Linux (Ubuntu / Debian) package installation and management
View linux-package-installation-and-management.md

Linux (Ubuntu / Debian) package installation and management

List packages

apt list --installed
dpkg -l

Remove package

sudo apt-get remove 
@nanusdad
nanusdad / gitlab-backup-and-restore.md
Last active Jan 25, 2022
Gitlab backup and restore notes
View gitlab-backup-and-restore.md

Gitlab backup and restore notes

Backup (on old server)

sudo gitlab-backup create
#backup is available in
cd /var/opt/gitlab/backups
cp 1643*.tar /tmp
cd /tmp
gzip 1643*.tar
View indian-postal-code.md
View embedding-videos.md
  • Use <video> HTML element - w3schools
  • Disabling picture-in-picture
<video controls disablePictureInPicture controlsList="nodownload">
  <source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/mp4">
  <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/ogg">
</video>
  • Disabling picture-in-picture with JavaScript
View ffmpeg-cheat-sheet.md

FFMPEG Cheat sheet

Compress MP4 files

ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

Compressed file to better compatibility (WhatsApp)

ffmpeg -i broken.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p working.mp4

Convert MOV to MP4

@nanusdad
nanusdad / expanding-root-vol-on-ec2-ubuntu.md
Last active Nov 16, 2020
Expanding Root Volume on EC2 (Ubuntu)
View expanding-root-vol-on-ec2-ubuntu.md

Expanding Root Volume on EC2 (Ubuntu)

df -hT
lsblk
sudo growpart /dev/nvme0n1 1
  • For ext4
sudo resize2fs /dev/nvme0n1p1
@nanusdad
nanusdad / InstallingMoodleonAWSLightSail.md
Last active Dec 1, 2020
Installing Moodle on AWS LightSail
View InstallingMoodleonAWSLightSail.md

Installing Moodle on AWS LightSail

Start with a new LightSail Instance running Ubuntu 20.04

  • Update
sudo apt update
  • Install Apache
sudo apt-get install apache2
@nanusdad
nanusdad / learning-locker-api-auth-jwt-password-error.md
Created Aug 25, 2020
Error message in Chrome developer console when logging into LearningLocker
View learning-locker-api-auth-jwt-password-error.md

LRS error

Error message in Chrome developer console when logging into LearningLocker

Unable to connect to "/api/auth/jwt/password”

  • Check mongo as root
sudo su -
service mongod status