Absolutely Tech

[SOLVED] VLC does not support the audio or video format “h.264″ on Ubuntu

I got the following error in VLC today while trying to play some media file:

VLC does not support the audio or video format “h.264″. Unfortunately there is no way for you to fix this.”

All other media files game same error with different codec names. I couldn’t play anything in VLC. To fix the problem I installed package called libva1.

sudo apt-get install libva1

Cheers!

[SOLVED] “undefined symbol: menu_proxy_module_load” error in GNOME applications

In all GTK apps I used to get the following warnings when run from terminal:

`menu_proxy_module_load': /usr/lib/virtualbox/VirtualBox: undefined symbol: menu_proxy_module_load
 
(<unknown>:23888): Gtk-WARNING **: Failed to load type module: (null)

This error was received while running Virtualbox. Though, it seems just a warning and doesn’t really change anything in the application, it does make the terminal messy. I figured I could fix the problem by simply installing appmenu-gtk.

So, run the following command to fix the issue:

sudo apt-get install appmenu-gtk

Cheers!

[HowTo] Save all flash video files being played in Chrome/Chromium to Home directory

After watching a video on youtube in chrome, I felt like saving it. I couldn’t find the flv in ~/.cache or in /tmp. So I dug around and found this link: http://superuser.com/questions/235535/in-google-chrome-on-linux-where-is-the-flv-if-not-in-tmp.

The solution by omab worked for me. So I wrote this one line command which would save all the currently playing files in Chrome and Chromium in home directory.

A=`ps auwx | grep "flash" | grep "chrom" | awk '{print $2}'`; ls -la /proc/$A/fd | grep Flash | awk '{print $8}' | xargs -I _ mplayer /proc/$A/fd/_  -dumpstream -dumpfile ~/_.flv

Leave your thoughts in the comments!

Cheers!

[HowTo] Stop phpmyadmin from asking username, password in localhost

Yesterday, I showed you how you can keep local installation of phpmyadmin from logging you out every few minutes. I took one more step and edited configuration to not ask me username, password at all. Now phpmyadmin never asks me for mysql username and password.

Keep in mind if you follow this tutorial anyone would be able to access your database using phpmyadmin unless you deny access via apache configuration. Don’t do this on production servers.

Steps to follow:

  • Run: gksudo gedit /etc/phpmyadmin/config.inc.php
  • Find:
    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    And change it to:

    $cfg['Servers'][$i]['auth_type'] = 'config';
  • Just below this line, add:
    $cfg['Servers'][$i]['user'] = '';
    $cfg['Servers'][$i]['password'] = '';

    Replace and with mysql username and password.

  • Save the file.
  • Changes will be applied immediately, no need to restart apache.

Now, you’ll never have to enter username and password in phpmyadmin.

Cheers!

[SOLVED] Error “undefined reference to `libiconv_open’” while compiling

I was trying to compile sphinx server from source but I go the following errors on executing make

undefined reference to `libiconv_open’
undefined reference to `libiconv’
undefined reference to `libiconv_close’

To fix the error, you can compile without iconv (multiple encoding support) support. Use the following commands to compile. You can add more parameters as per your requirements.

./configure --without-iconv
make CFLAGS=-liconv
make install

I hope that helps

[SOLVED] kernel_thread_helper+0×7/0×10 during Ubuntu boot process

Recently, I tried installing Ubuntu on my friend’s computer. I used Maverick’s Live CD but the boot process stuck at kernel_thread_helper+0×7/0×10. I noticed a huge list of acpi errors above this message and figured it was somehow related to ACPI. To solve the problem I simply turned of ACPI.

Solving the problem in Live CD:
Insert live cd, and before the Ubuntu tries to boot into it press Esc repeatedly until you get to Ubuntu menu. Press F6 and select acpi=off and press enter. You can now press Esc again to close this sub-menu and press ‘Enter’ to boot into Live CD. This time your boot process should complete without any errors.

Solving the problem in installed system:
(Once you install Ubuntu using Live CD, you have to follow the following steps to fix this problem in your installation.)
1. In the grub menu, press ‘e’. Search for ‘quiet splash’ and add ‘acpi=off’ (without quotes) after that to make it look like ‘quiet splash acpi=off’. You’ll be able to boot in now.
2. Go to Applications->Accessories->Terminal
3. Execute:

sudo gedit /etc/default/grub

4. Find the line which says GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” and change it to the following:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=off”
5. Exit gedit.
6. Execute:

sudo update-grub

7. Restart. This time you don’t have to edit anything. Ubuntu should boot without any issues.

Comments and suggestions are more than welcome.

[HowTo] Use locate command and updatedb to search all partitions

Updatedb command by default does not include /media path for updating its database. You can change the settings in /etc/updatedb.conf so that it starts indexing other partitions too.

sudo gedit /etc/updatedb.conf

In the PRUNEPATHS setting, remove /media. Save the file and run

sudo updatedb

This will index all your files from /media folder. Make sure the partitions are mounted.

Cheers!

[Solved] apt-get “is to be installed” errors in Ubuntu

This class of error means the dependency is of different version than required. I tried to install deluge-console but it gave me the following error:

deluge-console : Depends: deluge-common (= 1.3.0-0ubuntu1) but 1.3.0-1~getdeb1 is to be installed

The error is not that self-explanatory. Here the deluge-common version required by deluge-console is 1.3.0-0 but 1.3.0-1 is installed. This means that I have newer version of a dependency required by the application I am trying to install.

Fortunately, you can force the version in apt-get:

sudo apt-get install deluge-common=1.3.0-0ubuntu1

I forced an older version, downgrading the package. This fixed the error for me and I could successfully install deluge-console after that.

This method can be applied to fix problems in other applications as well.

Cheers!

[Solved] Mp3 not playing on Amarok

After upgrading to Maverick, somehow Amarok stopped playing Mp3. Same thing happened when I upgraded to Lucid from Karmic.

To fix it, install libxine1-all-plugins:

sudo apt-get install libxine1-all-plugins

That fixed it for me!

Cheers!

[HowTo] Suspend Ubuntu from terminal or keyboard shortcuts

When learning to make bash scripts, at one point or other you’d like to know how to suspend your computer from terminal. Well, there are quite some methods available for Ubuntu. You can choose whatever suits your needs. I prefer method 3 (look below).

Method 1:

sudo sh /etc/acpi/sleep.sh force

Method 2:

sudo pm-suspend

This command might not be available in older versions of Ubuntu. It works perfectly fine on Lucid and Maverick.

Method 3:

This command does not require sudo so it might come in handy. For example, you can map it to a keyboard shortcut for easy access.

dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

One thing to notice here is none of the commands I mentioned here will ask your password on resuming. For that you’ll have to lock your computer before suspending. You’ll have to use gnome-screensaver-command --lock before suspending to lock the computer

Create a suspend script:

Open a new file in gedit:

sudo gedit /usr/bin/suspend-comp

Copy and paste the following code and save it:

#!/bin/sh 
sleep $1;
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

If you want the script to ask for a password on resuming, copy-paste this code instead:

#!/bin/sh 
sleep $1;
gnome-screensaver-command --lock
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Add the executable bit:

sudo chmod +x /usr/bin/suspend-comp

Now suspend-comp time-in-seconds can be used in terminal. For example, if I want to have my computer suspended after 20 seconds I can simply type:

suspend-comp 20

Mapping it to keyboard shortcut for easy access:

Go to System->Preferences->Keyboard Shortcuts. Click Add. Type Suspend for Name and suspend-comp 0 in Command field. Click Apply.

Now scroll to the bottom of the list to find Suspend. Click on ‘Disabled’ on the right to ‘Suspend’. Now press any key combination to map the command to it. I used Ctrl+Alt+Shift+s.

Now simply pressing Ctrl+Alt+Shift+s will suspend your computer.

Cheers!