Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / indian-postal-code.md
Last active October 8, 2021 06:42
Indian Postal Code
@nanusdad
nanusdad / embedding-videos.md
Last active October 8, 2021 06:39
Embedding videos
  • 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
@nanusdad
nanusdad / ffmpeg-cheat-sheet.md
Created May 20, 2021 04:25
FFMPEG cheat sheet

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 November 16, 2020 11:35
Expanding Root Volume on EC2 (Ubuntu)

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 December 21, 2023 16:43
Installing Moodle on AWS LightSail

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 August 25, 2020 17:46
Error message in Chrome developer console when logging into LearningLocker

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
@nanusdad
nanusdad / white_screen_on_android.md
Created September 27, 2019 17:41
White Screen after splash on Android builds

To troubleshoot

ionic cordova run browser --prod --release

Updates required to config.xml file

<preference name="SplashScreen" value="assets/images/logo.svg" />
<preference name="SplashScreenBackgroundColor" value="#000" />
@nanusdad
nanusdad / omero-cheat-sheet.md
Last active April 17, 2019 13:33
OMERO cheat sheet

Update root password

omero db password
Please enter password for OMERO root user: 
Please re-enter password for OMERO root user: 
UPDATE password SET hash = 'ibTzrADXfsKFfNwBdQsa+g==' WHERE experimenter_id  = 0;

Check password hash

psql -h localhost omdbprim -U omdbusr1 -c " select * from password"
@nanusdad
nanusdad / certbot-initial-and-expand-domains.md
Last active August 27, 2020 20:52
Using certbot to add and expand domains to cert

To use Lets Encrypt certbot command to install certificate to work with AWS Lightsail Wordpress instance

sudo certbot certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ \
-d domain1.org

To add new domains to certificate

sudo certbot certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ \
--expand -d domain1.org,www.domain1.org,domain2.edu,domain3.org
@nanusdad
nanusdad / vi_related.md
Last active April 19, 2018 04:41
VI related tips