How to Use ffmpeg to Help You Work with Openshot

Extracting Audio of a Video to MP3 File

ffmpeg -i input.ext -codec:a libmp3lame -qscale:a 2 output.mp3

Cropping Media File Duration

ffmpeg -ss 00:02:20.0 -i input.ext -c copy -t 00:00:31.0 output.ext

Removing Audio Stream from a Video File

ffmpeg -i input.ext -c copy -an output.ext

Reducing Final Video File Size

ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4

Merging Video Chunks from Ant Video Downloader

ffmpeg -f concat -safe 0 -i demuxer.txt -c copy -bsf:a aac_adtstoasc output.mp4

Pacman Fix Shell Script for TeX Live


cd /etc/texmf

for a in `find . -name "*.pacnew"`; do

    sudo mv $(echo ${a/.pacnew/}) $(echo ${a/.pacnew/}).mybackup;

    sudo mv $a $(echo ${a/.pacnew/});


sudo fmtutil-sys --all

Creating Linux Distro USB Live Media under Linux

Here is what you need:

  1. an ISO file of the Linux distribution of your choice,
  2. an empty flash drive whose size is larger than the ISO file,
  3. a working Linux computer (it doesn't have to be of the same distro or even architecture as the one in the Live ISO) and...
  4. a little bit of common sense.

Here is how you'd do it.

  1. Plug your flash drive in to your Linux computer.
  2. If your flash drive is automatically mounted, unmount it.
    1. Check the list of drives connected to your system.
      $ lsblk
    2. Unmount the partition.
      # umount /dev/sdd1
  3. Go to the folder where your ISO is located (so you don't need to type the full path to it later).
    $ cd /path/to/the/iso/file/of/the/distribution/you/want/to/put/in/the/flash/drive/
  4. Run "disk dump".
    # dd bs=4M if=manjaro-xfce-16.06.1-x86_64.iso of=/dev/sdd status=progress && sync
    1. Please note that you're dd-ing to the disk, not the partition. Therefore, dd will take all your disk size no matter how much the difference it has with the ISO file size.
    2. The parameter bs=4M is to make sure that the dumping process will run fast.
    3. The parameter status=progress is to report the dumping progress from start to finish.
    4. Lastly, sync is to clarify that... I don't know. People at Arch Linux use it so you need to follow them too. If you're curious, you can always do man sync.

Happy dd-ing!

P.S.: Run wipefs --all /dev/sdd to your USB live media to get rid of the live OS and restore the full capacity of the disk.

How to Download Anything with Wget

Here are useful wget parameters I've discovered within around six years of using wget as my one-and-only download helper (except for YouTube vids).

Resuming an interrupted download (or simply worry-free downloading)

$ wget -c

Turning off restrictions imposed by robots.txt

$ wget -e robots=off --wait 1

Downloading a whole folder recursively while leaving the unnecesary parent directories behind

$ wget -np -cr

Downloading nothing but files of a particular extension

$ wget --accept=*.ext

Downloading everything but files of a particular extension

$ wget --reject=*.ext

Keeping the downloaded files' names intact

This is especially important for downloading files whose names are typed in Russian/Asian writing systems (Cyrillic alphabet, Japanese kana, Arabic abjad, Hebrew alephbet, Hindi devanagari, etc.).

$ wget --restrict-file-names=nocontrol

Saving a downloaded file with a different name

This is especially important when you're downloading a file from a website that applies some kind of URL masking to their downloadable files (like but then suddenly the download gets interrupted out of pure bad luck.

$ wget -O desired-file-name.3gp -c

Happy leeching!

P.S.: Use your imagination.

CentOS 7: Removing Old, Corrupted Kernels

Before removing anything, first make sure that yum-utils is already installed in your system.

[user@localhost ~]$ rpm -q yum-utils

If you don't have it yet, install it.

[user@localhost ~]$ sudo yum install yum-utils

Check what versions of kernels are currently installed in your system.

[user@localhost ~]$ rpm -q kernel

Removing Old Kernels

Run this for removing old kernels and leaving only a few of them (2 in this example).

[user@localhost ~]$ sudo package-cleanup --oldkernels --count=2

Removing a Particularly Troublesome (or Simply Corrupted) Kernel

This is blatantly the same as how you uninstall a specific rpm package in CentOS 7.
(*Below is just an example in my case; yours might be different.)

[user@localhost ~]$ sudo rpm -e kernel-3.10.0-327.4.4.el7.x86_64

Happy removing!

Diposting oleh ideal1st pada 15.06.2016 tepat jam 15:38