Examples:
drwxr-xr-x 755
-rw-r--r-- 644
# Copiando folder desde server a local, con permisos de superusuario: | |
rsync -avz -e "ssh -i /ruta/del/archivo.pem" --rsync-path="sudo rsync" usuario_remoto@direccion_ip_remota:/ruta/del/folder/remoto /ruta/del/folder/local | |
# Copiando folder desde local a server, con permisos de superusuario: | |
rsync -avz -e "ssh -i /ruta/del/archivo.pem" /ruta/del/archivo/local usuario_remoto@direccion_ip_remota:/ruta/del/destino/remoto | |
# Renombrar todos los directorios agregándo suffix _OLD | |
find . -maxdepth 1 -type d -not -name "." -exec bash -c 'mv "$0" "${0}_OLD"' {} \; | |
# Renombrar todos los directorios eliminando el suffix _OLD |
// option I | |
const capitalizeWords = (string) => { | |
return string.split(' ').map((elem => elem.charAt(0).toUpperCase() + elem.slice(1).toLowerCase())).join(' '); | |
} | |
// option II | |
const capitalizeWords = string => string.split(' ').map((elem => elem.charAt(0).toUpperCase() + elem.slice(1).toLowerCase())).join(' '); | |
// option III | |
const capitalizeWords = sentence => (sentence.toLowerCase().replace(/(^\w{1})|(\s+\w{1})/g, letter => letter.toUpperCase())); |
#!/usr/bin/env bash | |
#styles | |
VP_NONE='\033[00m' | |
VP_RED='\033[01;31m' | |
VP_GREEN='\033[01;32m' | |
VP_YELLOW='\033[01;33m' | |
VP_PURPLE='\033[01;35m' | |
VP_CYAN='\033[01;36m' | |
VP_WHITE='\033[01;37m' |
db.getCollection('myCollection').find({}).limit(N).forEach(function(doc){ | |
db.getCollection('myCollection').remove({_id: doc._id}); | |
}); | |
# or | |
db.getCollection('myCollection').find({}).limit(N).forEach(function(doc){ | |
db.getCollection('myCollection').deleteMany({_id: doc._id}); | |
}); |
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.
brew options ffmpeg | |
brew install ffmpeg \ | |
--with-chromaprint \ | |
--with-fdk-aac \ | |
--with-fontconfig \ | |
--with-freetype \ | |
--with-frei0r \ | |
--with-game-music-emu \ | |
--with-libass \ |
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
// require moment and lodash | |
import moment from 'moment'; | |
import _ from 'lodash'; | |
// Option 1 | |
function sortByDate(array, element) { | |
const sortedArray = array.sort((a, b) => moment(a[element]).diff(moment(b[element]))); | |
return sortedArray; | |
} |