Wednesday, May 16, 2012

Comparing RPM packages installed on two hosts, without using temporary files

When setting up a new Linux server, it's often interesting to compare the list of packages that are installed on the new server, with the list of packages installed on an existing server. You can use the following command line, which makes use of Bash supports for process substitution, to show the difference between packages installed on the local host and on the remote host.
 # ssh root@remotehost 'rpm -qa | sort' | diff -u <(rpm -qa | sort) -


If the above command gives no output, it means that the two hosts have identical packages installed.

If you want to disregard the package version differences in the comparison, then you will need to use something like this:

 # ssh root@remotehost 'rpm -qa --queryformat "%{NAME}\n" | sort' | diff -u <(rpm -qa --queryformat "%{NAME}\n" | sort) -

Update(2013-07-02):
Following Paul Waterman's comment, I did try out his rpmscomp Perl script, and I did find it useful. So I would recommend you also give it a try:

https://github.com/pdwaterman/rpmscomp

Also, to help in removing packages, I have found the rpmreader package useful:

https://fedorahosted.org/rpmreaper/

Friday, May 11, 2012

Moving old Nokia ringtones to the Apple iPhone

For the last seven years, I have used the 'bach' ringtone on my old Nokia 6230i. Now I have an iPhone 4s, I wanted the option of using the same ring tone. What follows is the procedure I used. I did this all on a Windows PC, but I believe you can also use 'faac' on Linux. Note that this procedure is 'free'.

I download the Nokia 6230i ringtone "Bach.aac" from here:

http://meramob.com/filedownload/2011/41824/Bach.html

I used this online service...

http://media.io/

... to convert the "Bach.aac" to "Bach.wav".

I then downloaded "FAACv1.28 Binary for Win32" as file "faac-1.28-mod.zip" from this site:

http://www.rarewares.org/aac-encoders.php

..and unziped the archive to extract binary executable "faac.exe".

Here is the 'help' for faac:

C:\Temp>faac.exe --help
Freeware Advanced Audio Coder
FAAC 1.28

Usage: faac.exe [options] infiles ...
Options:
-q Set quantizer quality.
-b Set average bitrate to x kbps. (ABR, lower quality mode)
-c Set the bandwidth in Hz. (default=automatic)
-o X Set output file to X (only for one input file)
-r Use RAW AAC output file.
-P Raw PCM input mode (default 44100Hz 16bit stereo).
-R Raw PCM input rate.
-B Raw PCM input sample size (8, 16 (default), 24 or 32bits).
-C Raw PCM input channels.
-X Raw PCM swap input bytes
-I Input channel config, default is 3,4 (Center third, LF fourth)

MP4 specific options:
-w Wrap AAC data in MP4 container. (default for *.mp4 and *.m4a)
-s Optimize MP4 container layout after encoding
--artist X Set artist to X
--writer X Set writer to X
--title X Set title to X
--genre X Set genre to X
--album X Set album to X
--compilation Set compilation
--track X Set track to X (number/total)
--disc X Set disc to X (number/total)
--year X Set year to X
--cover-art X Read cover art from file X
--comment X Set comment to X

Documentation:
--license Show the FAAC license.
--help Show this abbreviated help.
--long-help Show complete help.

More tips can be found in the audiocoding.com Knowledge Base at
http://www.audiocoding.com/wiki/

I then used this command line to convert the WAV file to a M4A file:

C:\Temp>faac.exe -b 128 -c 44100 -w Bach.wav
Freeware Advanced Audio Coder
FAAC 1.28

Average bitrate: 128 kbps
Quantization quality: 100
Bandwidth: 16000 Hz
Object type: Low Complexity(MPEG-4) + M/S
Container format: MPEG-4 File Format (MP4)
Encoding Bach.wav to Bach.m4a
frame | bitrate | elapsed/estim | play/CPU | ETA
403/403 (100%)| 74.8 | 0.4/0.4 | 29.51x | 0.0

Note that I used the "-w" option so that the AAC data stream was 'wrapped' in a MP4 container.

I then renamed "Bach.m4a" to "Bach.m4r".
(Note the M4R extension is used to identify the file as a ringtone.)

And I then dragged and dropped the "Bach.m4r" file into the iTunes library.
(If iTunes fails to accept the dropped file, it means that file is not in the correct format.)

Then I synced the ringtone to the iPhone.

The following pages provided inspiration for the above: