isobartw-push:
$(DK) push isobartw/node:$(NODE_TAG)-alpine
$(DK) push isobartw/node:$(NODE_TAG)
$(DK) push isobartw/node:lts
$(DK) push isobartw/node:$(NODE_TAG)-alpine-pm2
$(DK) push isobartw/node:$(NODE_TAG)-pm2
$(DK) push isobartw/node:$(NODE_TAG)-alpine-gm
$(DK) push isobartw/node:$(NODE_TAG)-gm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Uploading binary data with nodejs | |
* axios + fs.createReadStream | |
* | |
* */ | |
const fs = require('fs'); | |
const axios = require('axios').default; | |
const FormData = require('form-data'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -r 0.01 -loop 1 -i image.jpg -c:v libx264 -tune stillimage -preset ultrafast -ss 00:00:00 -t 00:00:10 -pix_fmt yuv420p -shortest out.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert unix timestamp to the local timezone | |
tail -f logs/access.log | jq '.time |= (tonumber / 1000 | strflocaltime("%c %Z"))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// without hidden folders | |
for f in $(ls -d */); | |
do | |
echo "zip -r -X ${f:0:-1}.zip $f" | |
done | |
// include hidden folders | |
for f in $(ls -Al | awk -F" " '/^d/ {print $9}'; | |
do | |
echo "zip -r -X $f.zip $f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace "4bk.aaa.com.tw" -> "bk.aaa.com.tw" in *.js|htm|html|css files | |
find www -type f \( -iname "*.js" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.css" \) -exec sed -i '' 's/4bk.aaa.com.tw/bk.aaa.com.tw/g' {} + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# POST multipart/form-data with a file upload | |
curl --request POST --url https://postman-echo.com/post -F "foo1=bar1" -F "foo2=bar2" -F "image=@/Users/isobar/Downloads/radar.jpg" | |
## POST multipart/form-data with json string | |
curl --request POST --url https://postman-echo.com/post -F "json=$jsonString" | |
# POST on windows | |
curl --request POST --url https://xxxxxx.ngrok.io/upload/ -F "filename=@d:\Data\My documents\Processing\mySample_http_post\test.tif" | |
# POST binary data with a file upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy a-*.ejs to d-*.ejs | |
$ for f in a-*.ejs; do cp $f d${f: 1}; done; | |
cp a-1.ejs d-1.ejs | |
cp a-2.ejs d-2.ejs | |
cp a-3.ejs d-3.ejs | |
cp a-4.ejs d-4.ejs | |
# copy loop_*.mp3 to loop_*.wav | |
$ for f in loop_*.mp3; do echo $f ${f:0:-4}.wav; done; | |
loop_1.mp3 loop_1.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
START_TIME=$SECONDS | |
set -e | |
echo "-----START GENERATING HLS STREAM-----" | |
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME] | |
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1 | |
# comment/add lines here to control which renditions would be created | |
renditions=( |
NewerOlder