1.0.155 • Published 6 months ago

ehmeh.com v1.0.155

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

ehmeh.com

Development

to install

npm install

cd client
npm install
cd ..

cd socket
npm install
cd ..

to run

npm run dev

SERVER

CERTBOT

certbot certonly --non-interactive --agree-tos --email support@ehmeh.com --webroot -w /w/ehmeh.com/site/client --cert-name ehmeh.com -d ehmeh.com -d s.ehmeh.com -d www.ehmeh.com --expand --force-renewal

PM2

NODE_ENV=production && cd /w/ehmeh.com/site/socket && pm2 stop ehmeh.com && pm2 delete ehmeh.com && pm2 start index.js --watch --name="ehmeh.com" -o /w/ehmeh.com/data/log/node -e /w/ehmeh.com/data/log/node --merge-logs --max-restarts 3 --restart-delay 5000 --node-args="-r esm --expose-gc --max-old-space-size=8048" && pm2 save

NGINX

service nginx reload && service nginx restart && service nginx status

FOLDERS

mkdir -p /w/ehmeh.com/site/
touch /w/ehmeh.com/site/index.html

mkdir -p /w/ehmeh.com/site.git/
touch /w/ehmeh.com/site.git/index.html

cd /w/ehmeh.com/site.git/
git init --bare

mkdir -p /w/ehmeh.com/
touch /w/ehmeh.com/index.html

mkdir -p /w/ehmeh.com/data/
touch /w/ehmeh.com/data/index.html

mkdir -p /w/ehmeh.com/data/log/
touch /w/ehmeh.com/data/log/index.html

mkdir -p /w/ehmeh.com/data/git/
touch /w/ehmeh.com/data/git/index.html

touch /w/ehmeh.com/site.git/hooks/post-receive
chmod +x /w/ehmeh.com/site.git/hooks/post-receive

GIT HOOK

EDIT FILE:

nano /w/ehmeh.com/site.git/hooks/post-receive

PUT CONTENTS:

#!/bin/sh -xv

# extract to temp directory
git --work-tree=/w/ehmeh.com/data/git/ --git-dir=/w/ehmeh.com/site.git checkout -f

# install socket packages
cd /w/ehmeh.com/data/git/socket/
rm -Rfq /w/ehmeh.com/data/git/socket/node_modules
rm -Rfq /w/ehmeh.com/data/git/socket/package-lock.json
npm install

# rsycn the folder
cd /w/ehmeh.com/site/
rsync -rtvcu /w/ehmeh.com/data/git/ /w/ehmeh.com/site/

# run the script
cd /w/ehmeh.com/site/web/
chmod +x -R /w/ehmeh.com/site/web/script.sh
/w/ehmeh.com/site/web/script.sh

FFPMEG

# optimize video with ffmpeg

ffmpeg -i landing-3.mp4 -vcodec h264 -crf 28 landing-3-optimized.mp4

# reverse video

ffmpeg -i landing-3-optimized.mp4 -vf reverse landing-3-optimized-reversed.mp4

# concat two videos

(echo file 'landing-3-optimized.mp4' & echo file 'landing-3-optimized-reversed.mp4' )>list.txt
ffmpeg -safe 0 -f concat -i list.txt -c copy landing-3-optimized-loop.mp4