If you have to deal with VPS, there are some specific solutions, that should be known by a Linux administrator. Today I will post the solution for yum error.

You can get this error on software update. For example, when trying to update ImageMagick:

-bash-3.1# yum update ImageMagick
Loading “installonlyn” plugin
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.main(sys.argv[1:])
File “/usr/share/yum-cli/yummain.py”, line 82, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 206, in getOptionsConfig
errorlevel=opts.errorlevel)
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 132, in
doConfigSetup
self.conf = config.readMainConfig(startupconf)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 598, in
readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot,
startupconf.distroverpkg)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 661, in
_getsysver
idx = ts.dbMatch(‘provides’, distroverpkg)
TypeError: rpmdb open failed

Let’s see the error message. It tells us: error: no dbpath has been set. How should we proceed?

First of all, you need to try to clear the database. Here is the set of commands that should help you to do this:

#yum clean all
#rm -f /var/lib/rpm/__db*
#rpm –rebuilddb
#yum update

If this doesn’t help, here is another set:

#rm /dev/urandom
#mknod -m 644 /dev/urandom c 1 9

After that, run

#yum clean all

This should do the trick.

If you need to start anything automatically in Linux, you should alter some files that are processed during system startup. There are lots of ways to do this; I will show you how to . Note, that this installation of Apache does not allow to start it using chkconfig httpd on.

In order to setup automatic start, we will have to deal with /etc/init.d/rc.local . This is the file, that is processed on system startup and it will allow you to run anything you like. We need to start Apache using /usr/local/apache2/bin/apachectl start. Let’s add this string to the end of your /etc/init.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don’t
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/apache2/bin/apachectl start

That’s all! Now your httpd daemon will be automatically started at boot. You can start any daemon this way. If you know any more methods to start daemons, please, add them in comments.

Tags:

It’s very strange that Windows Mobile Devices have a lot of tweaks abd settings that can be done by modifying registry values. Don’t know why Microsoft didn’t set up any kind of visual interface for doing that. Anyway, today I will share you a very useful trick to enable GPRS connection abort.

Windows mobile devices are used to connect to the Internet when necessary. Especially, if you are using any custom ROMs, there are lots of software that require Internet connection. For example, Weather forecast plugins and time synchronization software, automatic E-mail check and so on. Every time the connection is established, it requires your phone to use a higher frequency (GRPS or 3G connectivity, that depends on your carrier). After your software has performed data exchange, the connection remains unterminated. This means it starts draining your battery and you have to charge it again and again.

The solution is to enable automatic disconnection for all GPRS connections. It won’t affect your working software, as even ICQ keeps sending pings to the server, or some dummy packets to keep connection alive. There is a registry tweak, and let me show you where it is.

I am using Total Commander for Pocket PC to edit my device’s registry. It’s free, but you’re welcome to use any shareware solutions. Open your favorite registry editor and navigate to the following keys:

HKEY_LOCAL_MACHINE\Comm\ConnMgr\Planner\Settings\
SuspendResume = GPRS_bye_if_device_off
CacheTime = xxx (where xxx are seconds before auto disconnect)

The first value isn’t so easy to change with Total Commander, that’s why I would suggest you to install a CAB file that will do this for you. Here is the cab that will enable GPRS auto disconnect after 60 seconds of inactivity. Of course, you can change CacheTime parameter to any value you like. I have left it at 300 seconds.

This works perfectly on my Acer S200 and it should save battery of any WM device.

I am not sure where you can use this list, I just would like to share it with you. I think you might need it developing WAP sites. Here is the link: Mobile User Agent List

Earn money from your website/blog by, selling text links, banner ads - Advertisers can, buy links, from your blog for SEO. Get paid through PayPal