http://www.alper.net/ Eyup Alper Yoney

27Jun/112

The Linux Way of youtube to mp3

Few days ago, I found a new song in youtube and I've been listening it since then. I like to have it in my mp3 player but I couldn't find it in mp3 format. First, I thought to google it for tools or add-ons to convert from youtube video to mp3 but then I realized that it is actually quite easy with the shell. The necessary processes are already in place in my Linux.

1. youtube-dl, is a small command-line program to download videos from YouTube.com and a few more sites.
2. ffmpeg, is a complete, cross-platform solution to record, convert and stream audio and video.
3. lame, is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.

Here is the procedure;
First download the video with youtube-dl

$ youtube-dl "http://www.youtube.com/watch?v=QjA5faZF1A8"

then extract the audio from the video file with ffmpeg

$ ffmpeg -i QjA5faZF1A8.flv QjA5faZF1A8.wav

last, convert the wav file to mp3 with lame

$ lame QjA5faZF1A8.wav QjA5faZF1A8.mp3

Enjoy it :)

Tagged as: , 2 Comments
18Sep/103

ThinkPad x100e and Fedora 13

I've been running Fedora 12 with x100e since April. I had written about the Fedora 12 installation here. I decided to install Fedora 13 last week. I think Fedora 13 installation is smoother than Fedora 12 installation. In addition, I've been more satisfied with Fedora 13 performance so far.

Installation consists 3 steps,

1. Put your Fedora 13 DVD to your driver and boot up from DVD drive. Follow the installation steps and install Fedora 13. I performed the installation with external DVD driver. There is no trick in the first step, it's similar to any other simple installation.

2. During the first boot after installation, Fedora 13 freezes. You need to edit kernel parameters as following. At Grub prompt, press 'e' to edit the command before booting, then select the second line and again press 'e' to edit the selected command. Type radeon.modeset=0 at the end of the command, press 'b' to boot up. This is the way to boot up Fedora 13 until display driver installation.

3. Install the ATI display driver and wireless adapter driver.
a. ATI Display Driver  link (Notebook Graphics -> Mobility Radeon Series -> Mobility Radeon HD 3xxx Series -> Linux x86).
b. You need to get wireless adapter driver from Realtek website and build it (to install compiler and other development packages as prerequisite). The RTL8192SE driver works well in my system, even wireless adapter is reported as 8172 in lspci output.

Now,  you can boot up without radeon.modeset=0.

Display

Tagged as: , 3 Comments
29Jul/100

Numbers of CPU Cores in Solaris 10

The psrinfo is a tool that reports the numbers of physical processors and numbers of virtual processors. Most unfortunate, it is not possible to find out numbers of cores in the Solaris 10 psrinfo output.  Below output shows that my configuration has got 2 physical processors and total 16 virtual processors.

alper:~ $ psrinfo -vp
The physical processor has 8 virtual processors (0-7)
SPARC64-VII (portid 1024 impl 0x7 ver 0x91 clock 2400 MHz)
The physical processor has 8 virtual processors (8-15)
SPARC64-VII (portid 1032 impl 0x7 ver 0x91 clock 2400 MHz)

To find out the numbers of cores, you need analyze the kstat output. The below output shows that virtual CPU instance: 0 belongs to cpu core 0 (core_id line in output).

alper:~ $ kstat cpu_info
module: cpu_info                        instance: 0
name:   cpu_info0                       class:    misc
        brand                           SPARC64-VII
        chip_id                         1024
        clock_MHz                       2400
        core_id                         0
        cpu_fru                         hc:///component=/MBU_A/CPUM0
        cpu_type                        sparcv9
        crtime                          126.7569109
        current_clock_Hz                2400000000
        device_ID                       279287011836295
        fpu_type                        sparcv9
        implementation                  SPARC64-VII (portid 1024 impl 0x7 ver 0x91 clock 2400 MHz)
        snaptime                        10650736.0805644
        state                           on-line
        state_begin                     1269762960
        supported_frequencies_Hz        2400000000

Therefore, it is possible to find out the number of cores by counting numbers of unique core_id in `kstat cpu_info` command.

alper:~ $ kstat cpu_info | grep core_id | awk '{ print $2}' | uniq | wc -l
       8

Briefly, my configuration has got 2 physical processors, 8 cores (4 in each physical processor), and 16 virtual processors (2 in each core).

Tagged as: , No Comments
2Jun/100

Math Joke

I came across the joke while cleaning up my e-mail box, it was sent by my friend Hakan who is pursuing his PhD in mathematics. I would like to share it :)

A father who is very much concerned about his son's bad grades in math decides to register him at a catholic school. After his first term there, the son brings home his report card: He's getting "A"s in math.
The father is, of course, pleased, but wants to know: "Why are your math grades suddenly so good?"
"You know", the son explains, "when I walked into the classroom the first day, and I saw that guy on the wall nailed to a plus sign, I knew one thing: This place means business!"

Tagged as: , No Comments
23Apr/106

ThinkPad x100e and Fedora 12

I had installed the Fedora 12 via external DVD driver, I hadn't faced any problem during the installation. However, Fedora freezes on the first boot. I can make it boot by disabling ACPI in Grub.

At Grub prompt press 'e' to edit the command before booting, then select the second line and again press 'e' to edit selected command. Type acpi=off at the end of the command, press 'b' to start the boot procedure.

After I successfully boot up the Fedora, I updated the system. Unfortunately, the ACPI problem hasn't  been solved by updates. I added acpi=off to the grub.conf file under /boot/grub/grub.conf to make it permanent (run grub-install after editing grub.conf file, like grub-install /dev/sda). Disabling ACPI isn't very good idea, especially in a laptop. As I found on the net, Ubuntu works fine when acpi=on. I am going to try finding better  Fedora solution later. I think it is enough to get it work today.

The wireless adapter driver isn't supported on default. You need to get it from Realtek website and build it (to install compiler and other development packages as prerequisite). The RTL8192SE driver works well in my system, even wireless adapter is reported as 8172 in lspci output.

Finally, I typed the commands to getting the scroll button work as follows;

> yum install gpointing-device-settings.i686
> gpointing-device-settings

- Select TPPS/2 IBM TrackPoint, check "Use wheel emulation" and set 2 as button value (not permanent!).

Note: After I wrote the explanation above, I found another way to run Fedora on x100e. I patched and compiled the kernel. I  run the Fedora without acpi=off now. I sent the patch to other two users and they reported that it works fine on their x100e as well. Please write me if you need the patch.

Tagged as: , 6 Comments