Last active
January 6, 2019 21:07
-
-
Save ggirou/07423d3fb5fe7ff58024 to your computer and use it in GitHub Desktop.
Linux commands
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
. |
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
# Rename files with a sequential prefix number in modification date order | |
ls -1tr | nl -n rz -w 2 | sed -r 's/^([0-9]+)\t(.+)$/"\2" "\1 - \2"/' | xargs -l1 mv |
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
# Export existing commit dates in `commit_dates` file | |
git log --pretty='if test $GIT_COMMIT = %H; then export GIT_AUTHOR_DATE="%ai" GIT_COMMITTER_DATE="%ci"; fi;' > commit_dates | |
# Update `commit_dates` file to whatever you want... | |
nano commit_dates | |
# Apply new dates on commits | |
git filter-branch --env-filter "`cat commit_dates`" |
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
#!/bin/bash | |
sudo mount -t cifs -o user=my-user,vers=1.0 //my-nas/Volume_1 /home/me/my-nas |
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
# https://github.com/rg3/youtube-dl | |
# Download playlist videos | |
youtube-dl https://www.youtube.com/playlist?list=.... | |
# Download playlist videos with custom filename | |
youtube-dl -o '%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=.... | |
# Rename downloaded files from default filname template to new one | |
youtube-dl --get-filename -o '"%(title)s-%(id)s.%(ext)s" "%(playlist_index)s - %(title)s.%(ext)s"' | xargs -l1 mv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment