August 8

Linux: Shred files inside a directory tree recursively

I found a lot of different thoughts on this one, but the following seemed to work the best.
Be careful and make 100% certain you are in the directory that you are wanting to shred the files in the current subdirectories.
It is safer to specify the root directory you are wanting to shred inside of.
Also note that on certain files systems some data may still be recovered.

find -type f -execdir shred -u ‘{}’ ;

Once finished use the folling to rm you shubdirectories:

rm -R *

Be very cautious and meticulous when deleting files.

Category: Linux | Comments Off on Linux: Shred files inside a directory tree recursively
August 7

Linux: Installing QEMU

2013 – The following command worked
Fedora:
su -c “yum install qemu”

Ubuntu:
sudo apt-get install qemu-system

 

To boot an ISO do something similar to:

qemu-system-x86_64 -cdrom filename.iso

If you prepared a USB pen drive and want to test it, run it like this (/dev/sdx being your device name; you may need to sudo to access it):

qemu-system-x86_64 -hda /dev/sdx
Category: Linux | Comments Off on Linux: Installing QEMU
August 3

Linux: Combine MP4/M4V Files

You may want to combine multiple mp4/m4v video files into one continuous video. In order to do this, you need to install the gpac library of programs onto Ubuntu. Open up Terminal and run:

sudo apt-get install gpac

This will install the gpac library. One of the programs included with it is MP4Box, which you can use to concatenate the video files. If you are using 64 bit Linux or get an error like MP4Box: error while loading shared libraries: libgpac.so: cannot open shared object file: No such file or directory, then you need to link the shared library to /usr/lib: (I did not run into this issue -nh)

sudo ln -s /usr/local/lib64/libgpac.so /usr/lib/libgpac.so

Now to convert your files, add -cat filename.mp4 for each of your files to this command, with -new combinedfile.mp4 as your output, combined file:

MP4Box -cat vid1.mp4 -cat vid2.mp4 -cat vid3.mp4 -new combinedfile.mp4

Once the process finishes, your combined video file will be in combinedfile.mp4.

By: A. Martin

Category: Linux | Comments Off on Linux: Combine MP4/M4V Files
July 11

Linux: Batch convert mp3 to wav

Install mpg123
sudo apt-get install mpg123

Make certain all of your mp3 audio files are in the same directory.

Put the following code into a file:
vi mp3towav.sh

###Start of script###
for i in *.mp3 ; do
echo $i
b=`basename $i .mp3`
mpg123 -w $b.wav input $i
done
###End of script###

Put the conversion script into the same directory as your mp3s
chmod +x mp3towav.sh

Simply run ./mp3towav.sh

 

* Note – If there are spaces in your file names you will get errors and the conversion process will fail.
The easiest way to fix this is to replace the spaces with another character like a dash

Here is a script to remove the spaces in a file and replace them with dashes:
vi spacetodashconvert.sh

###Start of script###
#!/bin/bash

ls | while read -r FILE
do
mv -v “$FILE” `echo $FILE | tr ‘ ‘ ‘-‘ `
done
###End of script###

Run this in the same directory that contains your mp3 files, then re-run the mp3towav script

Category: Linux | Comments Off on Linux: Batch convert mp3 to wav