Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / git_new_local_branch.md
Last active Jul 24, 2021
Git - create new local branch push to GitHub
View git_new_local_branch.md
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 / expressjs_with_godaddy_certs.md
Last active Dec 15, 2020
Express JS with GoDaddy SSL Certificates
View expressjs_with_godaddy_certs.md

How to use GoDaddy SSL certs with Express JS

  • Node requires each certificate in the CA chain to be passed separately in an array.
  • GoDaddy provides a cerficate file (gd_bundle.crt) probably looks like this:
-----BEGIN CERTIFICATE-----
MIIE3jCCA...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
@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 / 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 / certbot-initial-and-expand-domains.md
Last active Aug 27, 2020
Using certbot to add and expand domains to cert
View certbot-initial-and-expand-domains.md

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 / 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
@nanusdad
nanusdad / spawn-continous-stdout
Created Jul 26, 2013
Node JS : continous 'live' stdout example
View spawn-continous-stdout
var util = require('util'),
spawn = require('child_process').spawn,
ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data);
@nanusdad
nanusdad / moodle_on_digital_ocean.md
Last active Apr 14, 2020
Installing Moodle on Digital Ocean Ubuntu server
View moodle_on_digital_ocean.md
sudo apt-get update  
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

sudo vi /etc/apache2/mods-enabled/dir.conf 
	#add index.php to start of line
@nanusdad
nanusdad / white_screen_on_android.md
Created Sep 27, 2019
White Screen after splash on Android builds
View white_screen_on_android.md

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" />