Pages

Showing posts with label tech help. Show all posts
Showing posts with label tech help. Show all posts

The Importance of Running Applications Using Command-Line Interface in GNU/Linux

These days you certainly don't have to rely on the GNU/Linux command-line interface that much even though it's the foundation of the entire operating system. This is because nowadays we have powerful GUI tools written in various toolkits such as GTK+/Qt, etc which makes the life of a someone who's even new to GNU/Linux much more "comfortable" without a doubt.

But quite ironically, many users, beside all those excellent package manager GUIs, etc still prefer to use the command-line when it comes to installing applications because unlike with a GUI where you have to go to the menu and open it then search and click on the "apply" button, etc... with a command-line tool (which is the "engine" these GUIs use anyway) all you gotta do is just copy and paste the command in to your Terminal and hit the "enter" key... the rest will be taken care of :D... especially with Debian based distributions such as Ubuntu for instance.

And the command-line, also known as the "Shell" (which is also known as "Terminal", which is again, another emulation of the original "command line interface" in a GUI environment such as in your Gnome/KDE desktop) is the way how operating systems used to get "orders" from the users since at that time there weren't any graphical user interfaces available thus the shell or the command-line was THE interface it self.

So it is a or "the" most powerful tool, especially in GNU/Linux OS to this day and perhaps always will be as long as the hackers have the authority.  

The "shell emulator" for the Gnome desktop... known as the Gnome Terminal...

Anyway because of its this powerful nature, did you know that you can actually use the command-line also as a way of fixing certain types of application related errors?. Of course not all the errors since some are "caused" by coding errors where there's nothing we as users can do about it but...

This is certainly not something new and is something that anyone like me who's got a decent knowledge of GNU/Linux knows that, concerning software (since the command line is the heart of GNU/Linux and its adaptation is in a much higher scale than I can image...) apart from installing, you can use the command line as a way of fixing certain errors that won't let you run the newly installed programs otherwise!.

For instance (this is just a singe example as I've seen this over and over again) sometime ago in my Ubuntu Laptop (11.04) I installed a software called NTFS-Config. Now I used the "apt-get" command to installed it but after the installation was over I closed the Terminal window and clicked on the icon on the menu to launch it. I waited for few seconds but nothing happened. Then I clicked on the icon again, but still nada, nothing happened.

So I realized the application  have failed to run ("oh Gayan, what an insight that is" :P).

The point is, the application didn't give me any errors or messages of any kind which would help me at lest to understand what was happening. Since I've been using (like many others) command line quite efficiently to getting fixed certain things in apps in the past, I opened the Terminal window and put the command that should launched the "ntfs-config" utility to see what information it can throw at me.

The same thing happened, it failed to launch but, unlike with the above method, this time I was able to see an "output" by the application which was "hidden" while it was running without using the command-line. Below is a portion of the error.
Traceback (most recent call last):
  File "/usr/bin/ntfs-config", line 102, in <module>
    main(args, opts)
  File "/usr/bin/ntfs-config", line 75, in main
    app = NtfsConfig()
  File "/usr/lib/pymodules/python2.7/NtfsConfig/NtfsConfig.py", line 56, in __init__
    os.mkdir(HAL_CONFIG_DIR)
OSError: [Errno 2] No such file or directory: '/etc/hal/fdi/policy' 
Now as you can see, although the whole "text" would get anyone a bit confused and I certainly have no idea what the heck that is all about, yet one line (in bold text) got my attention.

It basically says that "ntfs-config" cannot find a folder in "/etc/hal/fdi/policy" directory path. So I checked and realised that there isn't any folder by that name in that path!. So all I did was manually created the folders it said, "missing".

That's all I did and the next thing I did was reopened it via the standard menu and clicking on the icon and guess what?, this time it worked!.

So all I'm trying to say to all those who are new and learning GNU/Linux from scratch (I'm an average dude... trust me :D) haven't happened to know this yet... whenever an application fails to start after a successful installation, just run it using your command line.

Remember :- this obviously won't be able to fix all the errors since some are only fixable via accessing the original programming codes... in that case there's nothing anyone can do unless the original developers fix it.

But other small issues like the above mentioned one, etc, whenever something like that happens, try running that app in your Terminal because even if you can't figure it out and fix it, still most of the time, command line will at least be able to give some "feedback" to you which should help to finding a way to fix it. Again not all the time but heck, it might save you few "angry faces" :D. Good luck.

How To Setup K-Lite Media Player to Automatically Download Subtitles?

If you want to install almost all of known multimedia codecs in MS Windows via a single application, then I don't think there are that many who can beat K-lite codec pack!. Unlike many other codecs... K-Lite developers make sure to frequently update their codecs and release new versions frequently.

Not just for playback (decoding) actually, say that you also wanted to have their (both audio and video) encoders such as MP3, Vorbis, Xvid, Divx, etc then again K-lite is pretty darn good!. Although it does not have any GUI front-ends for encoding MP3, etc (it only installs the libraries of codecs that can be used to encode files)... still you don't have to search here and there for few dozens of codecs since K-Lite installs them by default.

Anyhow, back to the story. It even has a player of its own called Media player classic. Although this refers to the MS Windows which was used to be the "default" player around Win 2000 I think (they still ship it though) but K-Lite MPC is actually as nothing to do with MS, they've just create a player of their own (which uses the MPLayer as the engine) and is released under the GNU/GPL license, it just looks like MPC, that's all :).

Anyhow lets say that you have purchased a DVD and have Ripped it so it'd fit into a CD, which is legal :) (say 700MB in size) then wouldn't it be nice if you could let MPC automatically search and download the proper subtitle when you watch it??.

Well, you can easily search for its subtitle by from the main menu : "File" -> "Subtitle database" -> "Search". This will take you directly to Google and automatically enters the name of the file that you're playing as well.

But there is another option in MPC that's disable by default (see below screenshot), which can be used to automatically search an online subtitle database (won't open any web browser unlike with the above method) within the player itself, all you have to do is just put a "check" mark on the appropriate subtitle and it'll be automatically loaded into the movie which is totally awesome than the above method.

Sorry about the black screen , the "overlay Output" won't allow me to take image/screenshots :/


So how can we "enable" it?. 

Simple, just open the MPC (media player classic) and from the menu choose : "View" -> "Options"

.... and from the window you get after that, from your left go to: "Output".

Now as you can see below, by default, MPC uses the "Overlay Mixer". If we want to enable subtitle downloading in K-Lite/MPC then we have to choose either "VMR-7 (renderless)**" or "VMR-9 (renderless)**".


Note : I don't use Win 7 or Vista, but I think in those OSs you'll see few more options, but in all cases if you choose one of those above mentioned Output methods, it should just work in all MS Windows operating systems. 

So, simply click on one of those output options. For this example I choose "VMR-7 (renderless)**". Now click "OK" button and also close the MPC (it has to be restarted to enable the new video render).

Double click on the MPC again, play a movie that you have now you should be able to download the subtitle in MPC! (see below screenshot).



Once you click on "Download" button, you'll be greeted with a small window showing you available subtitles (different languages, etc). Select your language and then click on "Download & Open" button. That's it (depending on your film's FPC... some of these subtitles may not show subs at the proper timing, in that case, from the list, select something else).


Another thing, you have to rename the movie that you're playing to its true name because if the file name only has a portion of your Movie or something else (number, etc), then MPC will have troubles finding the subtitle, since it's your movie file name is what it uses to search for the subtitle online. Good luck.

Note: in some countries it's illegal to download ripped movies (unless they come from a vendor who has the privileges from the original creators) but if you have a legally purchased a DVD/Blueray disk, etc, then fear not, you can Rip it and make a backup, nonetheless.

Will Your Graphic Card Let You Run Ubuntu 11.04 Natty Smoothly?

I always had troubles with Ubuntu (started around 10.04 I think) with my ATI GPU, which is an old one actually - Raedon Express 200m. But the same VGA or the Laptop, had no problems whatsoever with Fedora or Debian in general. This was due to the fact that Ubuntu heavily depends on a OpenGL widow render manager called Compiz

Is it that important?...

If you don't know what the heck that means, then Compiz is the one behind all these fancy effects that you get in Ubuntu, you know things like transparency window borders, various effects such as minimizing effect/fading effects and other various "fancy" VGA related 3D effects.

Here's the "thing"...

All the VGA cards that are manufactured by ATI and Nvidia are closed sourced ones (although Intel seems to approach a bit open minded). Meaning that if you want to get the best 3D effects then you have currently have two options.

1. Use the proprietary drivers (which usually come with major GNU/Linux distros... but with Ubuntu, you can easily install then via the "Software Center". So it's easily fixable in Ubuntu.

OR...

2. You can use the free and true GNU VGA drivers that are written by developers by figuring out the hardware and how it works all by themselves called reverse engineering. Both ATI and Nvidia refuse to give away how their GPU (graphic processor in VGA cards) work... thus the GNU developers have to figure it out all by themselves.

Not to say the truth that even though most of the time they "just" work, but... the never the graphic card is the more time it's gonna take for these poor developers to figure out how it work :(. Although, impressively, some of these drivers actually work better than the original drivers written by the vendors them selves!. But they could be buggy under heavy/complex usage such as with Compiz window manger.

So most of the time you'll be better off with the official drivers. But if you use something other than Ubuntu the installation might be a bit difficult.


Back to the story...

Weird things that you can do with Compiz ;-)...

There are certain hardware which Compiz does not work or tends to be very buggy :(. But according to Compiz, Canonical no longer uses the original code written by Compiz developers, they've created a lot of bug fixes and have added better compability of Compiz with Ubuntu by changing the code. So this buggy driver list of original Compiz utility may not be applicable with the Ubuntu due to those changes.

But you should still consider about your VGA card and its compability with Compiz before running Ubuntu 11.04 Natty Narwhal since the Unity desktop now runs as a plugin on top of Compiz!. So a buggy VGA driver can do some serious annoyance for the PC + most importantly for the users as well.

If you own a Laptop or a Desktop PC directly from HP, Dell or other manufactures... then you can read this official Ubuntu certified hardware list first. Although the 11.04 version is not there, but if your hardware is there, you're good to go.

Secondly you can read this Compiz hardware page which addresses few of the known problems that can occur with certain Nvidia, ATI, Intel... graphic cards and how to resolve them. Again remember, some of these "issues" may not be applicable with Ubuntu, yet it's well worth the read.

Finally, after or to prior to the Ubuntu 11.04 Natty installation, if you're having problems or questions, you can ask them from this ask Ubuntu community maintained web site. Before posting your question, try searching it first. Who knows... maybe it's already been answered (oh you lucky geek :P).

"One of the best 2D/3D graphic "creators"... competing with Microsoft's DirectX..."

As mentioned before, in Ubuntu, using the "Software Center" or the "property hardware drivers" wizard, most of the time you should be able to install the official GPU drivers.

In that case, simply open the "Software Center" and enter Ati or Nvidia and do a search. Then follow the instructions on the screen. Also try to read few of recommendations/feedback given by others as well (usually appears below the "description" section).   

Good luck.