How fix Mp3 files with wrong time?

Submitted by Renan on Mon, 21/02/2011 - 02:44

Who never downloaded a "bugged" Mp3 raise the hand! Some of them came with a very annoying bug: the time of the music displayed isn't the real one. Some musics have a little more than 5 min but the time indicated by the player is around 2 min or even 3 seconds! After a brief analysis I've found that in these cases the header and the bitrate of the file are not mutually correspondents.

Then I runned after some app that could fix these broken Mp3 and finally get into VBRFix. In its site you can get the version with a QT GUI. There is an available version in the Debian repositories too, but this one doesn't have a graphical interface.

In this post I will explain who to use only the text mode version, which in the Debian based distributions (Ubuntu, Mint, Aptosid, etc) can be installed by doing:

$ sudo apt-get install vbrfix

After installed, you can fix the Mp3 files by doing:

$ vbrfix -always file.mp3 file_backup.mp3

The -always tag means it will always (derp) fix the file, doesn't matter if it is CBR(Constant Bit Rate) or VBR (Variable Bit Rate). Next come the file name that will be fixed and, after, the backup file name which will be a copy the non-fixed file. After processing, a new fixed file will be available for use! Enjoy!

Computer History

Submitted by Renan on Sat, 05/02/2011 - 03:23

Many people believe that the word "computer" has been created recently to name machines which are nowadays extremely important in nearly all human activities like heath, banking and the small gadgets like smartphones.

However, it has a long history. The first use of the word "computer" was recorded in 1613. In that time it was used to refer a person who carried out calculations (or computations) and the word continued with the same meaning until the middle of the 20th century.

Apache: PHP not working in UserDir

Submitted by Renan on Thu, 29/07/2010 - 18:30

Here is a tip to PHP developers that uses the Debian family of distros: how enable the execution of PHP scripts in the public_html folder. Apparently, this feature is disabled by default in the Debian based distros. Before start, I'm assuming that you already have both Apache and PHP installed, configured and running.

The interest in using Apache's mod_userdir is to increase the system security at the same time making easy the file handling. All the files inside the public_html folder present in your home dir will be accessible through Apache.

As root, run the following commands. First, we enable the userdir mod:

# a2enmod userdir

The script will enable the module and will tell you do restart Apache. At next, create the public_html folder using your normal user, inside your Home, and define its permissions:

  1. $ mkdir public_html
  2. $ chmod 711 public_html

Now, as root, define the Home's folders permissions(this is a critical detail):

# chmod 711 /home /home/[your_login]

The next step is enable the execution of PHP scripts inside public_html. To do that, as root, open the file /etc/apache2/mods-enabled/php5.conf and find the following lines:

  1. <IfModule mod_userdir.c>
  2.   <Directory /home/*/public_html>
  3.     php_admin_value engine Off
  4.   </Directory>
  5. </IfModule>

Comment them by putting a # in the beginning of each one. Save and close. Now restart the Apache server by running the following command as root:

# /etc/init.d/apache2 restart

The end! You can now run your PHP apps inside your public_html folder without being worried about doing weird tricks to read/write the default /var/www. :)

Reload partition table without rebooting a Linux system

Submitted by Renan on Tue, 20/07/2010 - 22:17

After buying a new 500Gb hard-drive for my laptop(the 120Gb old one is without room :) ) I took to partitionate it and install my operating systems. As usual, first I've installed Windows(although I did not use frequently, it's impossible don't have it) and then Sidux(Sidux, Debian Sid based, stable, rolling-release, I recommend).

After all installed, I've forgoted creating some partitions for the Gentoo installation(learning purposes :) ) and my "file backup" partition(to share files between my systems). After creating the first ext4 partition using the KDE Partition Manager ( btw, KDE > Gnome ;) ), it could not format or do other operation in this fresh partition.

Searching arround for some time, I notice that the system are not listing the partition id at /dev. There have all the other partitions(/dev/sda1, /dev/sda2, /dev/sda5, etc) but not the new one(/dev/sda8, for example). After rebooting, it showed up. Then I conclude that the Linux Kernel, at booting, read the partition table and create all the resources in /dev -- a process that does not occour(at least, automatically) in runtime.

But, if cannot be done automatically, it can be done manually! :)

I've found 3 methods that force the Kernel reload the partition table and repopulate its ids in /dev.

Partprobe

This program has the objective to tell the Kernel reload the partition table of a device(Hard-disks, flash-drives, etc) in runtime. To use, install it in your distribution using the package management tools provided(in my case, it's Debian's apt-get):

# apt-get install partprobe

After, execute partprobe as root telling what device you want to reload the partition table:

# partprobe /dev/sdX (Where X is your device letter)

Done! Your system should have recognized the new partitions you have created! Now, just return to KPM and do the stuff(format/label/etc) your freshly created partition!

Hdparm

If partprobe did not work, its possible to do the same procedure using Hdparm: a general hard-disk utilitary. Just execute the following command as root:

#  hdparm -z /dev/sdX (Where X is your device letter)

Via Kernel interface

This method does not use any previous programs because it comunicates directly with the kernel interface. Because of that, there is no error recovering if something wrong happens while reloading your partition table. You are warned. I'm not responsible for any data loss or kryptonite damage you might suffer. :)

As root user, send the following signal to the kernel interface:

# echo 1 > /sys/block/sdX/device/rescan (Where X is your device letter)

Then, check the dmesg reported messages to confirm that the kernel done the reloading of the device's partition table.

After this, your partition(s) should be recognized and enabled in /dev, making it possible to format, label and mount them!

If you work with Linux servers, you know how painfull is to reboot a system. Using this tip you can work with partitions and avoid the downtime that one simple restart could do. ;)

Sis 671/771 Patched Driver for Xorg greater than 7.3

Submitted by Renan on Sun, 04/07/2010 - 23:59

I am one of the unfortunate people that have a Sis 671 video card and use Linux. But recently, when I dist-upgraded my Sidux(Debian sid), it came with Xorg 7.5. Then the driver that I compiled for 7.3 broke.

After some days hacking with the source code of the modified Winischhofer's Driver(lately patched by Bartlomiej Gerlich) I finally get rid of the errors and made the source compile with Xorg 7.4(the 7.5 version was downgraded to 7.4, debian unstable things). And the driver worked wonderfully.

The Bartlomiej version is 0.9, so I decided to name it 0.9.1 because of this little patch by myself. I tested this version on Xorg 7.5 and 7.4. Fell free to see the source and compile it at your system. My little retribution to the community. ;)

http://rapidshare.com/files/344102632/xorg-driver-sis671-0.9.1-fixed.tar.gz.html

Greetings!

Syndicate content
"If debugging is the process of removing bugs, then programming must be the process of putting them in." Drupal theme by Kiwi Themes.