I ran into this bug which prevented me to update yum packages, and after a quick search, this helped to fix it:
# vim /usr/lib/python2.7/site-packages/urlgrabber/grabber.py
Go to line 1539, with vim you can use
Replace the line with this:
if cur > (float(max_size)*1.10):
This entry was posted in Linux, Python and tagged bug, can't, fedora, float, Linux, multiply, non-int, package, python, sequence, TypeError, update, yum on . January 3, 2013
With this release, I have been having some pulse audio problems. Sometimes I do not have sound while playing Spotify, Rhythmbox or any other desktop player.
After a research, it is usually fixed with this three lines (not always):
rm -rf ~/.pulse
Do not run it as root.
I wanted to give it a shot, and installed ATI propietary driver. It did not ended well.
Gdm could not start, it stucked after loading services.
To remove it:
# yum remove kmod-catalyst* xorg-x11-drv-cata*
I will not try them again.
If you upgraded from Fedora 16 to Fedora 17, you may get an error when shutting down the system.
This happens because the kernel is the same, and grub2.cfg does not get the Fedora 17 kernel, but it is installed, although not recognized.
To fix this just run the following command:
# grub2-mkconfig > /etc/grub2.cfg && grub2-install /dev/sda
Notice that you should change /dev/sda for your partition
This will generate a new grub2.cfg with the new Fedora 17 kernel.
This entry was posted in Linux and tagged down, error, fedora, fix, kernel, Linux, not, panic, problem, shutdown, shutting, solve, upgrade, upgrading on . May 30, 2012
Some of my library was in m4a files, which I have problems to play, furthermore I prefer having everything in mp3 format.
So I wrote the following script:
echo "Dependencies: mplayer and lame"
if [ $# -lt 1 ]; then
echo "Usage: sh m4a2mp3.sh '/path/to/files'"
echo "This could take sometime. Converting to 320kbps MP3 files..."
for i in *.m4a; do mplayer -ao pcm "$i" -ao pcm:file="$i.wav"; done
for i in *.wav; do lame -h -b 320 "$i" "$i.mp3"; done
echo "Cleaning the house..."
rm -rf *.m4a
rm -rf *.wav
echo "All files converted. Thank you."
Usage is pretty straightforward:
sh m4a2mp3.sh /path/to/your/songs
The only dependencies, as you can see also in the script are mplayer and lame
You can install them with the following command:
# Yum based (Fedora, CentOS, SuSE)
yum install mplayer lame
# Apt based (Debian, Ubuntu, Mint) (NOT TESTED)
apt-get install mplayer lame
As always, you also can find the script on my Github.
This entry was posted in Bash, Linux, Programming and tagged bash, convert, files, Linux, m4a, mp3, play, script, shell, transform, wav on . May 10, 2012
This script is specially useful when you clone VMs, but can be used in any other kind of situation where you have problems with network cards, say, duplicated cards for X reason.
Try to run this script I wrote:
if [ $UID -ne 0 ]
echo "Sorry, you have to run this script as root"
cat /etc/udev/rules.d/70-persistent-net.rules | grep PCI | cut -d' ' -f5 | cut -b 2-6 | uniq > /tmp/drivers
for driver in $(cat /tmp/drivers); do
rm -rf /etc/udev/rules.d/70-persistent-net.rules && echo "Removing 70-persistent-net.rules"
rmmod $driver && echo "Removing $driver"
modprobe $driver && echo "Loading $driver"
rm -rf /tmp/drivers
Tested under Debian and Fedora, but should work fine on other distributions.
The code is also on my
github This entry was posted in Linux, Networking and tagged bash, card, delete, driver, Linux, load, modprobe, network, Networking, nic, remove, reset, rmmod, rules.d, script, shell, udev, unload on . March 30, 2012
To find whether Ubuntu requires a reboot or not, is as simply as checking if a special file exists.
To do so:
ls /var/run/reboot-required | grep required
If the file exists, system would require a reboot.