RedHat Package Manager (all well known rpm) can check integrity of installed components. It can indicate if there were any of installed files modified, or did somebody change a permission? To run a basic and comprehensive install integrity check, you simply execute (preferably as root): rpm -V rpm_name_to_check or rpm --verify rpm_name_to_check
If there are no issues, you'll get empty output and return code 0. That is: $ rpm -V libusb $ echo $? 0 For a modified deployed file you may see something like this: $ rpm -V httpd ..?...... /usr/sbin/suexec .....UG.. /var/www .....UG.. /var/www/cgi-bin .M...UG.. /var/www/html In the case of a modified install the return code will be 1:
$ echo $?
1
httpd install test above translates as: /var/www, /var/www/cgi-bin got their User ownership and Group memberships modified. And /var/www/html got Mode (chmod) changed in addition to the User and the Group.The question mark in rpm -V output means a certain test could not have been performed. In our example above "..?...... /usr/sbin/suexec" means md5 sum can't be calculated for /usr/sbin/suexec. That is often because rpm can not access a file being verified under current user account. To avoid "can't verify" question mark in the rpm -V output, just execute rpm as root: $ sudo rpm -V httpd .....UG.. /var/www .....UG.. /var/www/cgi-bin .M...UG.. /var/www/html See that "..?...... /usr/sbin/suexec" gone? :-) By default rpm performs a bunch of tests, each denoted by dot in the case of rpm metadata and installed item match, or "what's wrong" attribute otherwise:
The output can also have an attribute marker: c %config configuration file. d %doc documentation file. g %ghost file (i.e. the file contents are not included in the package payload). l %license license file. r %readme readme file.That is it from me, read man rpm for more info. |
I did post What's inside rpm? on how to explore rpms via linux command line. That works well for single files, enough to create adhoc scripts. I have started looking for some sort of web-based "Repo Browser", or "rpm Registry" software in a form of a web-app or a web-server to install on a local network and explore local and remote yum repositories. Unfortunately nothing did pop up in my searches. Here is what I am looking for, my list of desired features:
If someone knows a software product which satisfy most of these requirements, your input is very welcome in comments, or via the Contact form. |
Here is how to check what is inside rpm without install, or before you install: General info on rpm (author, description) rpm -qip your.rpm
Install / uninstall scripts: rpm --scripts -qp your.rpm
List of rpm files and their attributes: rpm -qlvp your.rpm
Check contents of files to be installed via the rpm package: rpm2cpio your.rpm | more Extract files from an rpm without install: rpm2cpio your.rpm > your.cpio
cpio -idmv < your.cpio Here is what you can do on already installed rpms (note, you most likely won't see target architecture and ".rpm" extensions on installed rpms): Check if "your_rpm" is installed: rpm -qa | grep your_rpm
General info on rpm (author, description) rpm -qi your_rpm
Install / uninstall scripts of already installed rpm: rpm --scripts -q your_rpm
List of installed rpm files and their attributes: rpm -qlv your_rpm |
Here are some ballpark figures for code inspection size and approximate time to keep the management happy. Recommended size of code per inspection or review - 200 LOC/h; each inspection or review session shall be no longer than 90 minutes Good reads: |
Have to count all records for a given month of a certain year in PostgreSQL table. The column being selected with is of type 'timestamp without time zone'. Let's call the column 'fdt', and count records for October 2012. There are at least 3 solution options: 1.SELECT COUNT(*) FROM table WHERE date_part('month', fdt) = 10 AND date_part('year', fdt) = 2012 ; 2.
SELECT COUNT(*) FROM table WHERE EXTRACT(MONTH FROM fdt) = 10 AND EXTRACT(YEAR FROM fdt) = 2012; 3. SELECT COUNT(*) FROM table WHERE fdt >= '2012-10-01' AND fdt < '2012-11-01';
Third option is, in general, faster than the first two. For the same data options 1. and 2. count 22806 records in ~80 ms, and option 3 ~60ms. |
jQuery “Add Bookmark” plugin – abookmark - seems like a decent jQuery plugin.
Using it with button is the same as with 'a' link:
<script type="text/javascript" src="http://YOUR_SITE/jquery.min.js"></script>
<script type="text/javascript" src="http://YOUR_SITE/jquery.abookmark.min.js"></script> <input type="button" id="btn_bookmark" value="Bookmark" title="Save to browser's bookmarks."/> <script> $(document).ready( function () { $('#btn_bookmark').abookmark(); }); </script>
It is cool it understands button's "disabled" property. |
Old good technology of HTML image maps + jQuery = totally awesome maps. Totally awesome jQuery plugin maphilight: image map mouseover highlighting Here is some info on the HTML map - HTML <map> Tag, Creating HTML Image Maps |