Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, June 9, 2009

Filenames Encoding Conversion Under Linux

If you need to mass-convert filenames from one encoding to another, say you are migrating from one distro to another and need to move the legacy data, you can do that with the convmv util.

# apt-get install convmv
# convmv -f cp1251 -t utf8 -r --notest /dir/name

Saturday, July 26, 2008

Ubuntu HDTV fix

I had a problem with Ubuntu on my old notebook with Intel Mobile 915GM video-card. It didn't want to play hdtv files, rips and some .mkv files. It had been crashing with an insufficient resources error.

The issue is simple, the video card uses the system memory for its own purposes, and ubuntu has wrong default xorg configuration for the videocard. Add the following three lines to your /etc/X11/xorg.conf file into the Section "Device" section (search for the Driver "i810" line).

Option "VideoRam" "65536"
Option "CacheLines" "1980"
Option "LinearAlloc" "32768"

This will fix the problem.

Saturday, June 28, 2008

Making Quicktime work in Ubuntu

There is a common issue with quicktime videostreams under linux. So this is a simple trick how you can make it working under the Ubuntu linux.

1) Uninstall all the video plugins you have got with your firefox installation (for example the vlc plugin)

2) Install the mplayer package and the quicktime extentions for it.

3) Install the mozilla-mplayer plugin

4) Reinstall firefox.

That's it. Go to apple.com/trailers, it should get working now

Wednesday, May 14, 2008

Tried KDE4 on Kubuntu

I've been testing Kubuntu with KDE4 today and have learnt two lessons.

1) There's nothing to be eager about KDE4. I mean, seriously, the guys do a good job, but this is still the same good old kde3. Those plasma and dolphin stuffs, doesn't change much, that's like a good version of the superkaramba project, it looks nice but practically doesn't change the workflow at all. And as 99% of applications still from KDE3, if don't mention internal changes, in really you've got a new nice theme for kde.

I'm little bit disappointed, the fourth version was anounced for good couple of years ago and then been delayed several times and as the result we've got something pretty raw and almost nothing new.

Yup, that's it, there's nothing in really why you should migrate to kde4 so far.

2) The quality of kubuntu is lower then the quality of ubuntu. Sorry gus, but that's true. There are several things which works out of box in ubuntu, but doesn't work in kubuntu. Several things are left behind in order to keep the kde-purity, that left a bad feeling.

Sunday, April 13, 2008

Rescue data from a reiserfs partition

Couple of days ago, I met a situation, when my /home partition, which was on reiserfs filesystem, all the sudden, got dead. It was not able to restore the partition with reiserfs utils, it didn't want to mount anymore, info said there only 563 Kb of 60 Gb data left. Not good.

I've spent a day rescuing the data, and managed to get back 99% of it (i belive), so now I share the experience.

The rule number one in such a situation is to calm down. Sit down, take a blank sheet of paper, a pencil and then in a nice friendly characters write the phrase "DON'T PANIC".

I'm serious, it's pretty easy to get jumpy and overreactive when "all of yours" suddenly getting disappeared. And surrely it's easy to broke something down completely. So, don't touch anything until you get back to the cool consciousness.

The second thing you need, is a complete copy of your damaged partition. For that you'll need another free partition with exact same size. If you have such space on another hard drive, create it there, or think about baying another one.

Once you have your new partition for the backup. You need to boot up on some kind of live-cd with a linux environment. I've used the ubuntu 7.10 live-cd, it's quite handy, understand most of the modern hardware, contains the gparted util, have a web-browser etc. So it's stuffed pretty good for our purpose.

When you have your live cd booted up, you may copy the partitions. There's a builtin prgramm called 'dd', which allows you to copy block devices byte by byte, one to another. So you run it like that.

$ sudo dd conv=noerror if=/dev/old of=/dev/new

Where the '/dev/old' and '/dev/new' are your damaged and backup partitions. The optional attribute 'conv=noerror' tells the commad to skip reading errors.

Optionally you may unlock the 'universe' repository and install the 'dd_rescue' prgramm, which I belive, a wrapper for the 'dd' command and provides some more resuce oriended functionality.

The main point is to create an exact copy of the aviable data from the damaged partition.

And note, depends on the conditions, this may take quite a long time. My 60G partition was copied in about 7 hours.

That's it. Once you have a copy block. You run the 'reiserfsck' on the _copy_ partition like that.

$ sudo reiserfsck --rebuild-tree -S /dev/new

Note the '-S' option. This tells the reiserfsck programm to scan the whole partition for the aviable data. It's important, don't miss it up.

This operation usually is quite fast. Depends on the size of your data, and its condition this will take some minutes.

After the reiserfsck pargamm have finished, mount your new partition and take a look how is it going. If your partition was not damaged too hard, most of the data and directories structure will be on the right places. And there will be the 'lost+found' directory, take a look in it too, there will be lots of directories and subdirectories named with numbers. The util put there the files which were recovered but which former place was not found. And you may find there some files which you have deleted recently. So browse throw the directories, you may find some valuable data there too.

This is pretty much it. In really it's qute a simple stuff. Just don't get scary, some bad blocks on your hard drive is not a big problem, most of your data usually safe untill the harddrive any-working.

Tuesday, February 12, 2008

Epiphany updates look well

Have switched source tags from feisty to hardy on my laptop's ubuntu yesterday. And found that epiphany now, similar to knoqueror in kde, follows the gnome look'n'feel theme.





Looks quite nice. And note, it's on the gecko engine. Unfortunately Firefox, still renders the gray standard buttons.

Tuesday, February 5, 2008

How to defragment your XFS partition

If one beautiful morning, you like me found yourself having performance problems with reading from your huge XFS partition, you probably will think about defragmentation for the partition (at last if you had former windows experience). And will be right, case XFS in difference of ReiserFS needs a defragmenation. So this is how you may do it.

First you'll need to install some packages.

On your ubuntu/debian/suse whatever if you use the apt-get utility, say this.

# apt-get install xfsdump


Under Gentoo, this

# emerge xfsprogs xfsdump


Then you'll need to check if your partition needs a defragmentation in really

# xfs_db -r /dev/sda5
xfs_db> frag
actual 22222222, ideal 2342342, fragmentation factor 99.9%
xfs_db> quit


Once you see a scary fragmentation factor, run the command for the optimization

# xfs_fsr -v /dev/sda5
.......


That's it, now you may go have a drink, lift something heavy, play the guitar or pay an attention to your girlfriend. This whill take some time.