May 2013
M T W T F S S
« Apr    
 12345
6789101112
13141516171819
20212223242526
2728293031  
103

Refs

Categories

Archives

9,331slm
●5 ●38 ●132
 

[one-liner]: Dealing with UEFI

Background

UEFI looks to be a major pain in the @$$, but like it or hate it everyone in the Linux community will need to learn to navigate it. Here’s a list of useful UEFI resources that I’ve come across as I’ve started to get smarter about how to deal with this beast.

Solution

Wikipedia

Ubuntu Docs

AskUbuntu

Rodsbooks.com

Misc.

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Setting up the Subversion Client RabbitVCS 0.15.0.5 on Fedora 14

Background

If you do any software development work that requires the use of subversion then you may have heard of rabbitvcs. It’s one of the best subversion clients that integrates well with nautilus, under GNOME. I’d been running into an issue however where it wouldn’t allow me to perform a comparison of my checked out working directory and the subversion repository. I was running into this with version 0.14.2.1-3 on my Fedora 14 laptop.

1
2
3
4
5
6
7
% rabbitvcs diff WebDataInterface.java@105 WebDataInterface.java@112
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rabbitvcs/ui/diff.py", line 322, in <module>
    diff_factory(options.vcs, pathrev1[0], pathrev1[1], pathrev2[0], pathrev2[1], sidebyside=options.sidebyside)
  File "/usr/lib/python2.7/site-packages/rabbitvcs/ui/diff.py", line 304, in diff_factory
    return classes_map[vcs](path1, revision_obj1, path2, revision_obj2, sidebyside)
KeyError: 'unknown'

So I thought I’d try out version 0.15.0.5, which appears to be the latest. However I couldn’t find an up to date RPM for Fedora 14, I only found this one for Fedora 16.

Solution

I downloaded the Fedora 16 SRPM and rebuilt it for Fedora 14. I’m providing the RPMs on my yum repository for others that may need them.

The SRPM is available here.

References

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

[one-liner]: Download an RTMP Stream & Convert it to an MP3 File via the Fedora/CentOS Command Line

Background

I recently wanted to download a podcast that was being served via a RTMP stream. RTMP (Real Time Messaging Protocol) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released the specification of the protocol for public use.

Here’s how I was able to download the RTMP stream to a .flv file and convert it to a .mp3 file. Read on for the details.

Solution

step #1 – download the stream

I used the tool rtmpdump to accomplish this. Like so:

NOTE: the tool rtmpdump was available in my Distro’s repository

1
2
3
4
5
6
7
8
9
10
# I was able to get the rtmp url from looking at the page's source!
 
% rtmpdump -r rtmp://url/to/some/file.mp3 -o /path/to/file.flv
RTMPDump v2.3
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
28358.553 kB / 3561.61 sec
Download complete

step #2 – convert the flv file to mp3

OK, so now you’ve got a local copy of the stream, file.flv. You can use ffmpeg to interrogate the file further and also to extract just the audio portion.

1
2
3
4
5
6
7
% ffmpeg -i file.flv
....
[flv @ 0x25f6670]max_analyze_duration reached
[flv @ 0x25f6670]Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'file.flv':
  Duration: 00:59:21.61, start: 0.000000, bitrate: 64 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, 1 channels, s16, 64 kb/s

From the above output we can see that the file.flv contains a single stream, just audio, and it’s in mp3 format, and it’s a single channel. To extract it to a proper mp3 file you can use ffmpeg again:


…. Continue reading → [one-liner]: Download an RTMP Stream & Convert it to an MP3 File via the Fedora/CentOS Command Line »»

[one-liner]: Using yum-builddep to Speed Up the Building of SRPMs on Fedora & CentOS

Background

I just came across this nifty little tool called yum-builddep, which is part of the yum-utils package. It can be a really big time saver if you need to build source RPMS (SRPMs). What does it do? yum-builddep, installs all the RPM dependencies required to build a given SRPM.

Solution

Installation is a snap, it’s just part of the yum-utils package on Fedora & CentOS.

1
yum install yum-utils

Once installed you can use it like so:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# on my Fedora 14 system
 
% yum-builddep sox
...
 
Dependencies Resolved
 
===========================================================================================
Package                     Arch          Version                    Repository        Size
===========================================================================================
Installing:
 flac-devel                 x86_64        1.2.1-6.fc12               fedora           605 k
 gsm-devel                  x86_64        1.0.13-2.fc12              fedora            13 k
 ladspa-devel               x86_64        1.13-6.fc12                fedora            18 k
 libao-devel                x86_64        1.0.0-2.fc14               updates           33 k
 libid3tag-devel            x86_64        0.15.1b-10.fc13            fedora           9.3 k
 libsamplerate-devel        x86_64        0.1.7-2.fc12               fedora           8.3 k
 libsndfile-devel           x86_64        1.0.25-1.fc14              updates          140 k
 libtool-ltdl-devel         x86_64        2.2.10-3.fc14              fedora           166 k
 pulseaudio-libs-devel      x86_64        0.9.21-7.fc14              updates          302 k
 wavpack-devel              x86_64        4.60.1-1.fc14              updates           50 k
Installing for dependencies:
 ladspa                     x86_64        1.13-6.fc12                fedora            34 k
 pulseaudio-libs-zeroconf   x86_64        0.9.21-7.fc14              updates           26 k
 
Transaction Summary
===========================================================================================
Install      12 Package(s)
 
Total download size: 1.4 M
Installed size: 8.6 M
Is this ok [y/N]:

Notice it’s determining what libraries and other RPMs are required to BUILD sox from source, not just what is needed to install sox. Here’s another example, probably more consistent with how most people will end up using yum-builddep, where you’ll use it as an aid in rebuilding a SRPM package.


…. Continue reading → [one-liner]: Using yum-builddep to Speed Up the Building of SRPMs on Fedora & CentOS »»

[one-liner]: Installing 3rd Party Apps (Java, Skype, MS Fonts, and Codecs) using the app easyLife on Fedora Linux

Background

Never heard of this app before, easyLife, but it purports to simplifying the installation of the extras that you typically will need on your Fedora system, (i.e. Java, Nvidia, Skype, Adobe Flash, Fonts, etc.). It works like other apps have in the past, Automatix & Ultamatix, on Ubuntu, and Fedora Frog just to name a few.

Solution

easyLife provides an easy installation method for the following 3rd party software on Fedora:

  • Sets “sudo” command up for your regular user;
  • Configures RPMFusion repository for extra and non-free software;
  • Installs Flash Player plugin;
  • Installs all kinds of Codecs (h264,divx,xvid,mp3 etc);
  • Installs nvidia and ati drivers;
  • Installs Skype;
  • Installs Sun Java and Sun Java Plugin for Firefox;
  • Integrates Sun Java with system-switch-java;
  • And many others…

Installation is dead simple.

1
2
3
4
5
6
7
8
# download the latest version
% curl -L 'http://sourceforge.net/projects/easylife-linux/files/latest/download?source=files' 2> /dev/null > easylife_latest.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 59384  100 59384    0     0  41328      0  0:00:01  0:00:01 --:--:-- 80575
 
# install the rpm
% su -c "rpm -Uvh easylife_latest.rpm"

And here’s what easyLife looks like once you fire it up.

easyLife Main Window

easyLife Main Window

References

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

How to Add a New Hard Drive to a Linux Software RAID (CentOS & Fedora)

Getting Started

A while back I setup a 1TB hard drive for backing up my primary file server. That 1TB drive was setup in a software RAID, a RAID 1 mirror to be exact. However I opted at the time to only add the one drive to the RAID, mainly because I only had just the one. Well I finally got around to getting a 2nd 1TB drive and needed to add it as another member of the RAID. These are the steps that I used to accomplish it.

Preexisting RAID

Now before we get started here’s what the RAID setup looks like. NOTE: Throughout this article I’ll be making use of the command mdadm. This command is the primary tool for managing a software RAID under Linux. Also notice that my RAID is identified by /dev/md0. Typically the software RAIDs are identified as /dev/mdX, where X is a number.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Existing RAID setup
 
% mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Wed Dec 16 22:55:51 2009
     Raid Level : raid1
     Array Size : 976759936 (931.51 GiB 1000.20 GB)
  Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
   Raid Devices : 1
  Total Devices : 1
Preferred Minor : 0
    Persistence : Superblock is persistent
 
    Update Time : Sun Feb 19 04:22:02 2012
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0
 
           UUID : 1f1b36fd:ce3d589e:6a89fc71:2e8f3e64
         Events : 0.222
 
    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1

Nothing amazing here. We have 1 device, the RAID is clean and the RAID device is /dev/sdc1.

Installing the 2nd HDD (Hard Disk Drive)

The next step was to power down the system, install the 2nd HDD, and reboot. Once the system detected the new drive I confirmed that it was detected cleanly by the Linux kernel.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# visually inspect the dmesg log
 
% dmesg
...
...
 
### drive #1 (existing HDD)
 
ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata5.00: ATA-8: Hitachi HDS721010CLA332, JP4OA3MA, max UDMA/133
ata5.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata5.00: configured for UDMA/133
 
...
...
 
### drive #2 (newly added HDD)
 
ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata6.00: ATA-8: Hitachi HDT721010SLA360, ST6OA31B, max UDMA/133
ata6.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata6.00: configured for UDMA/133

Good so the hardware was detected by the kernel. Now let’s see if the kernel was able to assign a device handle to the newly installed HDD.


…. Continue reading → How to Add a New Hard Drive to a Linux Software RAID (CentOS & Fedora) »»

Page 1 of 912345...Last »