docker ps -a
This file contains hidden or 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
#!/bin/bash | |
# Latest version install or update (close & open terminal after install) | |
tag="$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')" && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$tag/install.sh | bash | |
# Update node to the latest LTS version & set as default + update npm + reinstall current packages | |
nvm install --lts --reinstall-packages-from=node --latest-npm --default | |
This file contains hidden or 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
#!/bin/bash | |
# Source : https://gist.github.com/rponte/fdc0724dd984088606b0?permalink_comment_id=4508916#gistcomment-4508916 | |
tag="$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')" | |
echo $tag |
This file contains hidden or 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
# Application Environment [ string : dev|prod ] | |
# Determines the context : | |
# - dev : development (error message are shown, no cache...) | |
# - prod : production (no error essages, additionsal security measures, speed optimizations...) | |
APP_ENV=dev | |
# Configuration File [ string ] | |
# Path to the context specific environment | |
# Here to show a string interpolation example | |
APP_ADDITIONAL_CONF="./.env-${APP_ENV}" |
Page rules used for caching HTML output on edge servers (excluding admin & preview pages).
URL | Settings |
---|---|
www.domain.com/wp-admin* | Cache level : Bypass |
www.domain.com/*preview=true* | Cache level : Bypass |
www.domain.com/* | Cache Level: Cache Everything, Edge Cache TTL: a month |
CloudFlare's cache should be purged on website updates.
List of commands I often need but never remember...
When there are functions shortcuts, I usualy put ththe code ~/.bash_functions
and source it in ~/.bash_rc
to make it globally available.
Search recursively in the folder ./
for files containing the pattern text
.
This file contains hidden or 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
#!/bin/bash | |
# Based on https://gist.github.com/yellowled/1439610 & https://github.com/chuyskywalker/easy-web-video-encode/blob/master/encode.sh | |
CORES=$(grep -c ^processor /proc/cpuinfo) | |
if [ "$CORES" -gt "1" ]; then | |
CORES="$(($CORES - 1))" | |
fi | |
for filename in ./*.mp4; do |
This file contains hidden or 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
#!/bin/bash | |
######################################################################## | |
# | |
# Creates a thumbnail extracted from a video | |
# | |
######################################################################## | |
ffmpeg -i VIDEO.mp4 -ss 00:00:05.000 -f image2 -vframes 1 VIDEO.png |
NewerOlder