How to check CentOS version

Sometimes you just login in into a box using ssh and need to check the OS version.

If this box runs CentOS you can use this command to determine what is the CentOS version:

[root@box ~]# cat /etc/*release*
CentOS release 4.3 (Final)

How to use RPM Commands

How to use RPM Commands

This is a post cointain some basic rpm commands to manage RPM packages.

1. Install a RPM package - you can use the command:
# rpm -ivh somepackage.arc.rpm

2. Uninstall a RPM package - you can use the command:
# rpm -e packagename
# rpm -e horde (e.g.)

3. Upgrade a RPM package - you can use the command:
# rpm -Uvh somepackage.arc.rpm
Note: When this command is used, RPM will uninstall the old version of package and install the new version.

4. Query a RPM package - you can use the command:
# rpm -q packagename
E.g.:
[root@box ~]# rpm -q glib
glib-1.2.10-15
Note: rpm -q command will print the package name, version, and release number of installed package. You can use this command to verify that a package is or is not installed on your system.

5. Package information - you can use the command:
# rpm -qi package
E.g.:
[root@box ~]# rpm -qi glib
Name : glib Relocations: (not relocatable)
Version : 1.2.10 Vendor: CentOS
Release : 15 Build Date: Tue Feb 22 05:32:17 2005
Install Date: Tue Mar 28 01:14:49 2006 Build Host: guru.build.karan.org
Group : System Environment/Libraries Source RPM: glib-1.2.10-15.src.rpm
Size : 321141 License: LGPL
Signature : DSA/SHA1, Sat Feb 26 20:42:07 2005, Key ID a53d0bab443e1821
Packager : Karanbir Singh
URL : http://www.gtk.org
Summary : A library of handy utility functions.
Description :
GLib is a handy library of utility functions. This C library is
designed to solve some portability problems and provide other useful
functionality which most programs require.

GLib is used by GDK, GTK+ and many applications. You should install
th glib package because many of your applications will depend on this
library.

As you can see, this command display package information, including name, version, and description of the installed program.

6. List files in package - you can use the command:
# rpm -ql package
E.g.:
[root@box ~]# rpm -ql glib
/usr/lib/libglib-1.2.so.0
/usr/lib/libglib-1.2.so.0.0.10
/usr/lib/libgmodule-1.2.so.0
/usr/lib/libgmodule-1.2.so.0.0.10
/usr/lib/libgthread-1.2.so.0
/usr/lib/libgthread-1.2.so.0.0.10
/usr/share/doc/glib-1.2.10
/usr/share/doc/glib-1.2.10/AUTHORS
/usr/share/doc/glib-1.2.10/COPYING
/usr/share/doc/glib-1.2.10/ChangeLog
/usr/share/doc/glib-1.2.10/NEWS
/usr/share/doc/glib-1.2.10/README
Note that this command will list all files in a installed RPM package. So it only works when the package is already installed on your system.

7. Check a RPM signature package - you use the command:
# rpm --checksig package
Note: This command will check the PGP signature of specified package to ensure its integrity and origin, it is secure to verify that ;)

Yum "GLib-CRITICAL" How To Fix

Yum fails "GLib-CRITICAL"

[root@box ~]# yum check-update
Repository atomic is listed more than once in the configuration
Repository plesk is listed more than once in the configuration
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
atomic 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files

(process:7349): GLib-CRITICAL **: file gtimer.c: line 106 (g_timer_stop): assertion `timer != NULL' failed

(process:7349): GLib-CRITICAL **: file gtimer.c: line 88 (g_timer_destroy): assertion `timer != NULL' failed
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 97, in main
result, resultmsgs = do()
File "/usr/share/yum-cli/cli.py", line 534, in doCommands
ypl = self.returnPkgLists()
File "/usr/share/yum-cli/cli.py", line 1176, in returnPkgLists
ypl = self.doPackageLists(pkgnarrow=pkgnarrow)
File "__init__.py", line 904, in doPackageLists
File "/usr/share/yum-cli/cli.py", line 75, in doRepoSetup
self.doSackSetup(thisrepo=thisrepo)
File "__init__.py", line 260, in doSackSetup
File "repos.py", line 277, in populateSack
File "/usr/lib/python2.3/site-packages/sqlitecachec.py", line 40, in getPrimary
self.repoid))
TypeError: Can not create index on requires table: near "NOT": syntax error


Possible Solution "GLib-CRITICAL":

First try it:
# rpm -Uvh http://www.mirrorservice.org/sites/mirror.centos.org/4.6/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm http://www.mirrorservice.org/sites/mirror.centos.org/4.6/os/i386/CentOS/RPMS/sqlite-devel-3.3.6-2.i386.rpm

It should fix the problem, it worked on CentOS. If didnt, go to http://mirror.centos.org/centos/

And install or re-install the next packets:
- glib
- yum
- sqlite
- python-sqlite
- python-elementtree
- python-urlgrabber

Remember to use:
# rpm -Uvh somerpm.rpm

What is mrtstub.exe - mrtstub process

mrtstub.exe - mrtstub process information

mrtstub.exe is a process that belongs to malware category thta can download other malicious processes and cause unwanted behavior on your computer. You should run a tool like spybot to disable and remove mrtstub.exe, it is most likely an adware or spyware.

Linux partition possibility

Linux partition possibility

A normal linux installation requires at least two partitions. It usually improves performance to more partitions.

Disk be divided into 4 partitions.
About 33% to linux bootable

About 33% to Windows bootable
Windows requires residency on the first primary partition

128M to swap
Note that a filesystem optimized for memory caching improves performance, that partition must have a filesystem supported by the operating system that will use it.

About 33% to data
This partition should be used by either or both OS if is compartible, it will be used for data, and can have any filesystem. The Windows bootable partition must be one of the filesystems supported by Windows, the linux bootable partition must be one of the filesystems supported by linux.

Fix svchost.exe high loads on Windows

Problem: svchost.exe file take up 100% of cpu resources (when Internet is turned on)

One possible cause of high loads from svchost is the DNS Client service. On some cases, it can cause high CPU loads. So, if you are facing this problem and dont need Windows DNS Client service you can disable it.

How to stop/disable the DNS Client
Type "services.msc" on the run box, find "DNS Client" and on the proprieties, chance it to "Disabled". If you are running a firewall, you can also disable Windows Firewall to, if you are using other there is no reason to keep both because can provoke conflicts.

After it, everything should back normal.

How to Change cPanel Theme via command line

If you need to change all cpanel account themes, you can use this command as root:

# replace RS=oldtheme RS=newtheme -- /var/cpanel/users/*

This will change all the cpanel users theme, if you need to change only one account,

# cd /var/cpanel/users/
# nano user_account

and replace rhe "RS=" line