Last active
September 28, 2020 12:47
-
-
Save ahasverus/a3c900b098f0286d052c6fa91dc8d3bc to your computer and use it in GitHub Desktop.
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
### [.] ALWAYS OPEN CHROMIUM IN PRIVATE MODE | |
###----------------------------------------- | |
# N.B. | First install { AdBlock }, { Adblock Plus } and { Adblock for Youtube } extensions and | |
# | Allow them to be run in private mode | |
$ defaults write org.chromium.Chromium IncognitoModeAvailability -integer 2 # / 0 | |
$ defaults write com.brave.Browser IncognitoModeAvailability -integer 2 | |
### [.] YOUTUBE-DL COMMANDS | |
###----------------------------------------- | |
# Download video | |
youtube-dl {video URL} | |
# Extract audio from video | |
youtube-dl --extract-audio --audio-format mp3 {video URL} | |
### [.] FFMPEG COMMANDS | |
###----------------------------------------- | |
# Cut video (from the 5th minute for a duration of 10s) | |
ffmpeg -ss 00:05:00.0 -i "input.mkv" -c copy -t 00:00:10.0 "output.mkv" | |
# Export file metadata to tempfile | |
ffmpeg -i "path/to/my/file.ext" -f ffmetadata ~/Documents/__tempfile | |
# Delete a specific tag | |
ffmpeg -i "path/to/my/file.mp3" -metadata artist="" "path/to/my/file.mp3" | |
# Delete ALL metadata in a file | |
ffmpeg -i "path/to/my/file.ext" -map 0:a -codec:a copy -map_metadata -1 "path/to/save/naked__file.ext" | |
# Export cover artwork in MP3 file | |
ffmpeg -i "path/to/my/file.mp3" "path/to/save/artwork.jpg" | |
# Add cover artwork to MP3 file | |
ffmpeg -i "path/to/my/file.mp3" -i "path/to/my/artwork.jpg" -c copy -map 0 -map 1 -metadata:s:v title="Cover (front)" "path/to/save/covered__file.mp3" | |
# Add metadata in MP3 file | |
ffmpeg -i "path/to/my/file.mp3" -metadata artist="The Artist" -metadata track="2/10" "path/to/my/file.mp3" | |
# Common FFMPEG tags | |
(TPE1) artist | |
(TIT2) title | |
(TPE2) album_artist | |
(TALB) album | |
(TYER) date | |
(TRCK) track | |
(TCON) genre | |
(TENC) encoded_by | |
(TCOP) copyright | |
(TCOM) composer | |
(TPOS) disc | |
# Convert MKV to MP4 | |
for i in *.mkv; do | |
ffmpeg -i "$i" -strict experimental -c:v copy -c:a aac -b:a 192k "${i%.*}.mp4" | |
done | |
### [.] IMAGE-MAGICK COMMANDS | |
###----------------------------------------- | |
# Convert picture in another format | |
convert "path/to/my/picture.png" "path/to/my/picture.jpg" | |
# Resize picture | |
convert "path/to/my/picture.jpg" -resize "300x300" "path/to/my/picture.jpg" | |
### === Liste le contenu d'une archive | |
tar -tf achive.tar.bz2 | |
### === Création d'une archive | |
tar -jcvf achive.tar.bz2 ./folder | |
### === Ajout de fichiers à une archive | |
tar -jrvf achive.tar.bz2 ./folder/ | |
### === Extraction du contenu d'une archive | |
tar -jxvf achive.tar.bz2 ./dest_dir | |
### [.] MPLAYER COMMANDS | |
###----------------------------------------- | |
# Repeat a song | |
mplayer --loop 5 song.mp3 | |
# Shuffle a playlist | |
cd ~/Music | |
find ./Music/Media.localized/ -type f -iname \*.mp3 > playlist.txt | |
mplayer -shuffle -playlist playlist.txt | |
### [.] HOMEBREW COMMANDS | |
###----------------------------------------- | |
# Update Homebrew and formulas | |
brew update && brew upgrade | |
# Search formula | |
brew search "{pattern}" | |
# Clean up Homebrew cache | |
brew cleanup | |
# Homebrew diagnostic | |
brew doctor | |
# Get installed Homebrew and Cask formulas | |
brew list | |
brew leaves | |
brew cask list | |
# Get installed Homebrew formula with dependencies | |
brew deps --tree --installed | |
### [.] UNIX COMMANDS | |
###----------------------------------------- | |
echo -e `whoami` && echo -e `date` | |
# List folder content in a tree | |
tree ~/Documents/ | |
# Get processes informations (CPU, MEMORY, etc) | |
top -o mem | |
# Open file with Atom (example) | |
open -a Atom "path/to/my/file.ext" | |
# Find files with specific extension/pattern | |
sudo find ~ -name "*.json" | |
# Get files/folders sizes | |
du -h ~/Documents/ | |
# Create symlink to backup folder using Dropbox | |
ln -s ~/Calibre\ Library/ ~/Dropbox/ | |
# OR, https://stackoverflow.com/questions/24200924/run-a-script-only-at-shutdown-not-log-off-or-restart-on-mac-os-x | |
# Disable SPOTLIGHT | |
sudo mdutil -a -i off | |
# Delete Spotlight indexed files database | |
sudo rm -rf /.Spotlight-V100/* | |
# Empty trash | |
rm -rf ~/.Trash && mkdir ~/.Trash | |
ip address show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment