Merge pull request #127 from terminalforlife/master

New Files & Examples (Including `ffmpeg`, Per #124)
pull/128/head
Igor Chubin 4 years ago committed by GitHub
commit 7a2557b17a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,28 @@
# ffmpeg
# Tools for transcoding, streaming and playing of multimedia files
# Convert IN_FILE to OUT_FILE, based on its extension. So, if your IN_FILE has
# the `.mp3` extension and your OUT_FILE has the `.ogg` extension, then your
# file will be converted -- but original kept in-tact -- to an OGG file.
ffmpeg -i IN_FILE OUT_FILE
# Remove the original upon successful completion of ffmpeg(1).
ffmpeg -i IN_FILE OUT_FILE && rm -v IN_FILE
# Convert all MP3s in the CWD to OGGs, deleting the originals when successfully
# converted. This will be a huge time-saver! Note that this is Bash syntax.
# By the way, this example works non-recursively.
for File in *.mp3; { [ -f "$File" ] || continue; ffmpeg -i "$File" "${File%.mp3}.ogg" && rm -v "$File"; }
# Obviously ffmpeg(1) works with audio files, but it can also work on images.
# This example will convert a JPEG image to the PNG format.
ffmpeg -i ImageFile.jpg ImageFile.png
# By default, ffmpeg(1) is really verbose, so shut it up, displaying only the
# more important information, by using the `-v` flag, followed by its `0`
# argument; this argument means that only 'panic' messages will be shown. Refer
# to the ffmpeg(1) man page for more information on these levels of logging.
ffmpeg -v 0 -i IN_FILE OUT_FILE
# If you want to see ongoing but not over-the-top statitics for the file on
# which ffmpeg(1) is currently working, you can make use of the `-stats` flag.
ffmpeg -stats -i IN_FILE OUT_FILE

@ -48,3 +48,13 @@ perl -ne '/^$ARGV[0]::$</ and print(STDERR "WARNING: User has an empty password.
# Display the current user's UID and GID in a format ideal for chmod(1).
perl -e 'print("$<:" . (split(" ", $)))[0] . "\n")'
# Permissions allowing, output the first 512 bytes of an MBR storage device, -
# where the partition table should be stored, using Perl's read() function.
#
# Note that the 2-argument style open() should not be used unless the file is
# static; no chance of changing to something potentially problematic.
#
# You might spot some printable strings, such as 'LILO' or 'GRUB', if you've
# also stored your bootloader on the MBR of the storage device (non-UEFI).
perl -e 'open(my $FH, "</dev/sda"); read($FH, my $Data, 512); close($FH); print("$Data\n")'

Loading…
Cancel
Save