• rssfeed

VIM macro to add changelog entry within spec file

Editing spec files is somewhat time-consuming repetitive task. It’s good to add a change log entry every time you rebuild srpm package. One can do it typing it all over the times. Someone can use the maco. I do use this one:

nmap ,cl /%changelog<CR>:r!date +'\%a \%b \%d \%Y'<CR>0i* <ESC>$a David Hrbáč <my@email.tld> -

Simply add this line to you .vimrc file.

Running yum-3.2.8 on CentOS 4.7 – part II.

Today I have looked again at yum 3.2.8 on Centos 4. I wanted everything to clean up, go back to unittests again. I have backported python-nose and started to clean up the source. Finally I had to make all yum tests python 2.3 compatible. Here is the result:

[root@build-c4-i386 yum-3.2.8]# make test

..............................................................................................................................................................

----------------------------------------------------------------------

Ran 158 tests in 0.889s

OK

As you can see, all tests have passed. And as usual packages are available within my testing repo.

http://fs12.vsb.cz/hrb33/el4/hrb/testing/i386/repoview/
http://fs12.vsb.cz/hrb33/el4/hrb/testing/x86_64/repoview/

Running yum-3.2.8 on CentOS 4.7

Today I spent a few hours testing and backporting yum-3.2.8 from CentOS 5.2 to CentOS 4.7. It wasn’t so hard to backport. Most of the time I have spent on testing and searching. Code is patched to allow sets, which are supported in python 2.3 :o ) and that’s almost all. Final rpms are available for testing here:

http://fs12.vsb.cz/hrb33/el4/hrb/testing/i386/repoview/
http://fs12.vsb.cz/hrb33/el4/hrb/testing/x86_64/repoview/

[root@webmel4 ~]# yum update yum
Loading "fastestmirror" plugin
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Reducing CentOS.Karan.Org-EL4 - Stable to included packages only
Finished
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for yum to pack into transaction set.
yum-3.2.8-9.el4.hrb.2.1.1 100% |=========================|  29 kB    00:00
---> Package yum.noarch 0:3.2.8-9.el4.hrb.2.1.1 set to be updated
--> Running transaction check
--> Processing Dependency: python-iniparse for package: yum
--> Processing Conflict: yum-metadata-parser conflicts yum >= 3.0
--> Processing Dependency: yum-fastestmirror for package: yum
--> Processing Dependency: yum-metadata-parser >= 1.1.0 for package: yum
--> Processing Dependency: yum < 2.5 for package: yum-utils
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for yum-utils to pack into transaction set.
yum-utils-1.1.10-9.el4.hr 100% |=========================| 9.7 kB    00:00
---> Package yum-utils.noarch 0:1.1.10-9.el4.hrb.1 set to be updated
---> Downloading header for yum-fastestmirror to pack into transaction set.
yum-fastestmirror-1.1.10- 100% |=========================| 7.0 kB    00:00
---> Package yum-fastestmirror.noarch 0:1.1.10-9.el4.hrb.1 set to be updated
---> Downloading header for python-iniparse to pack into transaction set.
python-iniparse-0.2.3-4.e 100% |=========================| 5.3 kB    00:00
---> Package python-iniparse.noarch 0:0.2.3-4.el4.hrb set to be updated
---> Downloading header for yum-metadata-parser to pack into transaction set.
yum-metadata-parser-1.1.2 100% |=========================| 4.3 kB    00:00
---> Package yum-metadata-parser.i386 0:1.1.2-2.el4.hrb set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 yum                     noarch     3.2.8-9.el4.hrb.2.1.1  hrb-testing       506 k
Installing for dependencies:
 python-iniparse         noarch     0.2.3-4.el4.hrb  hrb-testing        34 k
 yum-fastestmirror       noarch     1.1.10-9.el4.hrb.1  hrb-testing        10 k
Updating for dependencies:
 yum-metadata-parser     i386       1.1.2-2.el4.hrb  hrb-testing        24 k
 yum-utils               noarch     1.1.10-9.el4.hrb.1  hrb-testing        58 k

Transaction Summary
=============================================================================
Install      2 Package(s)
Update       3 Package(s)
Remove       0 Package(s)
Total download size: 633 k
Is this ok [y/N]: y
Downloading Packages:
(1/5): yum-utils-1.1.10-9 100% |=========================|  58 kB    00:00
(2/5): yum-fastestmirror- 100% |=========================|  10 kB    00:00
(3/5): python-iniparse-0. 100% |=========================|  34 kB    00:00
(4/5): yum-3.2.8-9.el4.hr 100% |=========================| 506 kB    00:00
(5/5): yum-metadata-parse 100% |=========================|  24 kB    00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction

  Updating  : yum-metadata-parser          ######################### [1/9]
  Installing: python-iniparse              ######################### [2/9]
  Updating  : yum                                                    [3/9]warning: /etc/yum.conf created as /etc/yum.conf.rpmnew
  Updating  : yum                          ######################### [3/9]
  Updating  : yum-utils                    ######################### [4/9]
  Installing: yum-fastestmirror            ######################### [5/9]
  Cleanup   : yum-utils                    ######################### [6/9]
  Removing  : yum-plugin-fastestmirror     ######################### [7/9]
  Cleanup   : yum                          ######################### [8/9]
  Cleanup   : yum-metadata-parser          ######################### [9/9]

Dependency Installed: python-iniparse.noarch 0:0.2.3-4.el4.hrb yum-fastestmirror.noarch 0:1.1.10-9.el4.hrb.1
Updated: yum.noarch 0:3.2.8-9.el4.hrb.2.1.1
Dependency Updated: yum-metadata-parser.i386 0:1.1.2-2.el4.hrb yum-utils.noarch 0:1.1.10-9.el4.hrb.1
Complete!

Everything works fine. Now it’s time to publish and make some public QA. As you can see, it handles obsolete packages!

[root@webmel4 ~]# yum install hrb-foo
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * kbs-CentOS-Extras: centos.karan.org
 * fasttrack: ftp.fi.muni.cz
 * hrb-kernel-stable: fs12.vsb.cz
 * update: ftp.fi.muni.cz
 * rpmforge: ftp-stud.fht-esslingen.de
 * hrb-testing: fs12.vsb.cz
 * base: ftp.fi.muni.cz
 * addons: ftp.fi.muni.cz
 * hrb-stable: fs12.vsb.cz
 * extras: ftp.fi.muni.cz
Reducing CentOS.Karan.Org-EL4 - Stable to included packages only
Finished
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package hrb-bar.noarch 0:1-1.el4.hrb set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 hrb-bar                 noarch     1-1.el4.hrb      hrb-testing       2.1 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 2.1 k
Is this ok [y/N]: n
Exiting on user Command
Complete!

nmap to get web server info

I realized that nmap can be used to get info about web server.  Informations about servers are easy to read via header. Admins tend to mask actual product or version the web is running on. So, then nmap comes to play with.

[root@kremilek ~]# nmap -sV -P0 -p80 www.idnes.cz
Starting Nmap 4.20 ( http://insecure.org ) at 2009-02-12 21:03 CET
Interesting ports on c1.idnes.cz (194.79.52.192):
PORT   STATE SERVICE VERSION
80/tcp open  http    Microsoft IIS webserver 6.0
Service Info: OS: Windows
Service detection performed. Please report any incorrect results at http://insecure.org/nmap/submit/ .
Nmap finished: 1 IP address (1 host up) scanned in 6.096 seconds
Header way:
[root@kremilek ~]# HEAD www.idnes.cz
200 OK
Cache-Control: no-cache
Connection: close
Date: Thu, 12 Feb 2009 20:03:46 GMT
Accept-Ranges: bytes
ETag: W/"c6b3f4ff4c8dc91:23a"
Server: Microsoft-IIS/6.0
Content-Length: 77562
Content-Location: http://www.idnes.cz/sph.htm
Content-Type: text/html
Last-Modified: Thu, 12 Feb 2009 20:03:40 GMT
Client-Date: Thu, 12 Feb 2009 20:03:46 GMT
Client-Peer: 194.79.52.192:80
Client-Response-Num: 1
X-Powered-By: ASP.NET

Call to undefined function load_config() – squirrelmail-1.4.8-5.el4.centos.3

During one of my squirrelmail upgrades I have discovered strange behavior. Users were able to login, but only blank page had appeared. I have found this in log:

[Mon Feb 09 18:29:10 2009] [error] [client 89.103.46.115] PHP Fatal error:  Call to undefined function load_config() in /usr/share/squirrelmail/plugins/change_sqlpass/functions.php
on line 326, referer: http://blabla.blabla.tld/src/login.php

change_sqlpass pluging needs compatibility plugin to run. So here is the patch:

--- ../../functions/strings.php.orig    2006-08-11 04:15:43.000000000 -0700
+++ ../../functions/strings.php 2006-09-01 06:11:03.000000000 -0700
@@ -31,6 +31,7 @@
* For that reason, bring in global.php AFTER we define the version strings.
*/
require_once(SM_PATH . 'functions/global.php');
+include_once(SM_PATH . 'plugins/compatibility/functions.php');

/**
* Wraps text at $wrap characters

Virtual disk provisioning

/usr/sbin/vmkfstools -i testfed.vmdk -d thin tmp.vmdk
/usr/sbin/vmkfstools -E tmp.vmdk testfed.vmdk

Remove old kernels

Simple way to remove all but one kernel:

if [ $(rpm -q kernel | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel | sed '$d'); fi
if [ $(rpm -q kernel-smp | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel-smp | sed '$d'); fi

OpenSSH5 on CentOS 5

I have rebuilt OpenSHH5 RPMs for CentOS 5. They seem :o ) to work pretty well.

Files are located here:

Kickstart encrypted password

Easy way to create encrypted password for kickstart:

perl -e 'print crypt("password", "Xa") . "\n";'p

Enable installonlyn on CentOS 4.x

Easy way to enable:

yum -y install yum-utils; \
cp -p /usr/share/doc/yum-utils-0.5/plugins/installonlyn/installonlyn.conf /etc/yum/pluginconf.d/; \
cp -p /usr/share/doc/yum-utils-0.5/plugins/installonlyn/installonlyn.py /usr/lib/yum-plugins/