mirror of
https://github.com/cheat/cheat.git
synced 2025-09-01 09:38:29 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
8096ca7f90 | |||
511c57f582 | |||
6ca4b6c8e7 | |||
9c696cc430 | |||
001fdb0eda | |||
af354ba6a3 | |||
196875a828 | |||
6cf69bc190 |
@ -38,7 +38,7 @@ from docopt import docopt
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# parse the command-line options
|
# parse the command-line options
|
||||||
options = docopt(__doc__, version='cheat 2.1.11')
|
options = docopt(__doc__, version='cheat 2.1.13')
|
||||||
|
|
||||||
# list directories
|
# list directories
|
||||||
if options['--directories']:
|
if options['--directories']:
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
# To sort directories/files by size
|
# To sort directories/files by size
|
||||||
du -sk *| sort -rn
|
du -sk *| sort -rn
|
||||||
|
|
||||||
|
# To show cumulative humanreadable size
|
||||||
|
du -sh
|
||||||
|
12
cheat/cheatsheets/ffmpeg
Normal file
12
cheat/cheatsheets/ffmpeg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Print file metadata etc.
|
||||||
|
ffmpeg -i path/to/file.ext
|
||||||
|
|
||||||
|
# Convert all m4a files to mp3
|
||||||
|
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 320k "${f%.m4a}.mp3"; done
|
||||||
|
|
||||||
|
# Listen to 10 seconds of audio from a video file
|
||||||
|
#
|
||||||
|
# -ss : start time
|
||||||
|
# -t : seconds to cut
|
||||||
|
# -autoexit : closes ffplay as soon as the audio finishes
|
||||||
|
ffmpeg -ss 00:34:24.85 -t 10 -i path/to/file.mp4 -f mp3 pipe:play | ffplay -i pipe:play -autoexit
|
@ -22,6 +22,14 @@ git commit --date="`date --date='2 day ago'`"
|
|||||||
git commit --date="Jun 13 18:30:25 IST 2015"
|
git commit --date="Jun 13 18:30:25 IST 2015"
|
||||||
# more recent versions of Git also support --date="2 days ago" directly
|
# more recent versions of Git also support --date="2 days ago" directly
|
||||||
|
|
||||||
|
# To change the date of an existing commit
|
||||||
|
git filter-branch --env-filter \
|
||||||
|
'if [ $GIT_COMMIT = 119f9ecf58069b265ab22f1f97d2b648faf932e0 ]
|
||||||
|
then
|
||||||
|
export GIT_AUTHOR_DATE="Fri Jan 2 21:38:53 2009 -0800"
|
||||||
|
export GIT_COMMITTER_DATE="Sat May 19 01:01:01 2007 -0700"
|
||||||
|
fi'
|
||||||
|
|
||||||
# To removed staged and working directory changes
|
# To removed staged and working directory changes
|
||||||
git reset --hard
|
git reset --hard
|
||||||
|
|
||||||
@ -86,3 +94,13 @@ git diff --no-index path/to/file/A path/to/file/B
|
|||||||
# To pull changes while overwriting any local commits
|
# To pull changes while overwriting any local commits
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git reset --hard origin/master
|
git reset --hard origin/master
|
||||||
|
|
||||||
|
# Update all your submodules
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# Perform a shallow clone to only get latest commits
|
||||||
|
# (helps save data when cloning large repos)
|
||||||
|
git clone --depth 1 <remote-url>
|
||||||
|
|
||||||
|
# To unshallow a clone
|
||||||
|
git pull --unshallow
|
||||||
|
@ -28,3 +28,7 @@ ssh user@example.com -C -c blowfish -X
|
|||||||
|
|
||||||
# For more information, see:
|
# For more information, see:
|
||||||
# http://unix.stackexchange.com/q/12755/44856
|
# http://unix.stackexchange.com/q/12755/44856
|
||||||
|
|
||||||
|
# Copy files and folders through ssh from remote host to pwd with tar.gz compression
|
||||||
|
# when there is no rsync command available
|
||||||
|
ssh user@example.com "cd /var/www/Shared/; tar zcf - asset1 asset2" | tar zxf -
|
||||||
|
2
setup.py
2
setup.py
@ -3,7 +3,7 @@ import os
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'cheat',
|
name = 'cheat',
|
||||||
version = '2.1.11',
|
version = '2.1.13',
|
||||||
author = 'Chris Lane',
|
author = 'Chris Lane',
|
||||||
author_email = 'chris@chris-allen-lane.com',
|
author_email = 'chris@chris-allen-lane.com',
|
||||||
license = 'GPL3',
|
license = 'GPL3',
|
||||||
|
Reference in New Issue
Block a user