rpm -qa --queryformat '%10{size}-%{name}-%{version}\n' | sort -k1,1n
You might also be interested in fslint:
yum install fslint
It lists packages by size, and it will autoselect dependencies for packages you want to delete
Red Hat, Fedora, Gnome, KDE, MySQL, PostgreSQL, PostGIS, Slony, Zarafa, Scalix, SugarCRM, vtiger, CITADEL,OpenOffice, LibreOffice,Wine, Apache, hadoop, Nginx Drupla, Joomla, Jboss, Wordpress, WebGUI, Tomcat, TiKi WiKi, Wikimedia, SpamAssassin, ClamAV, OpenLDAP, OTRS, RT, Samba, Cyrus, Dovecot, Exim, Postfix, sendmail, Amanda, Bacula, DRBD, Heartbeat, Keepalived, Nagios, Zabbix, Zenoss,
rpm -qa --queryformat '%10{size}-%{name}-%{version}\n' | sort -k1,1n
yum install fslint
total 10 | ||||||
drwxrwxrwx | 4 | rajat | team | 122 | Dec 12 18:02 | Projects |
-rw-rw-rw- | 1 | rajat | team | 1873 | Aug 23 08:34 | test |
-rw-rw-rw- | 1 | rajat | team | 1234 | Sep 12 11:13 | datafile |
Type and
|
# of | Files's | File's | Size in | Date of last | Filename |
Permission field
|
Links
|
Owner
|
Group
|
Bytes
|
modification
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drwxrwxrwx
|
4
|
rajat
|
team
|
122
|
Dec 12 18:02
|
Projects
|
-rws--x--x 1 root root 14024 Sep 9 2010 donefile -rwxr-sr-x 1 root mail 12072 Aug 16 2010 lockfileThe files donefile and lockfile are located in the directory "/usr/bin". The "s" takes the place of the normal location of the execute bit in the file listings above. This special permission mode has no meaning unless the file has execute permission set for either the group or other as well. This means that in the case of the lockfile, if the other users (world execute) bit is not set with permission to execute, then the user ID bit set would be meaningless since only that same group could run the program anyhow. In both files, everyone can execute the binary. The first program, when run is executed as though the program is the root user. The second program is run as though the group "mail" is the user's group.
drwxrwxrwt 13 root root 4096 Apr 15 08:05 tmpEveryone can read, write, and access the directory. The "t'' indicates that only the user (and root, of course) that created a file in this directory can delete that file.
chmod u+x myfile | Gives the user execute permission on myfile. |
chmod +x myfile | Gives everyone execute permission on myfile. |
chmod ugo+x myfile | Same as the above command, but specifically specifies user, group and other. |
chmod 400 myfile | Gives the user read permission, and removes all other permission. These permissions are specified in octal, the first char is for the user, second for the group and the third is for other. The high bit (4) is for read access, the middle bit (2) os for write access, and the low bit (1) is for execute access. |
chmod 764 myfile | Gives user full access, group read and write access, and other read access. |
chmod 751 myfile | Gives user full access, group read and execute permission, and other, execute permission. |
chmod +s myfile | Set the setuid bit. |
chmod go=rx myfile | Remove read and execute permissions for the group and other. |
chown Jerry test1 | Changes the owner of the file test1 to the user Jerry. |
chgrp Jerry test1 | Changes the file test1 to belong to the group "jerry". |
666 Default Permission for text file -022 Minus the umask value ----- 644 Allowed PermissionsTherefore the umask value is an expression of the permissions the user, group and world will not have as a default with regard to reading, writing, or executing the file. The umask value here means the group the file belongs to and users other than the owner will not be able to write to the file. In this case, when a new text file is created it will have a file permission value of 644, which means the owner can read and write the file, but members of the group the file belongs to, and all others can only read the file. A long directory listing of a file with these permissions set is shown below.
-rw-r--r-- 1 root workgrp 14233 Apr 24 10:32 textfile.txtA example command to set the umask is:
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.
# yum install mysql-server mysql php-mysql php-pear php-common
php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP
php-mysql httpd
# mysqladmin -u root password NEWPASSWORD
# mysql -u root -p -e 'create database cacti'
# mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'catipass; mysql> FLUSH privileges; mysql> \q
# yum install net-snmp-utils php-snmp net-snmp-libs
# vi /etc/snmp/snmpd.conf
com2sec local localhost public group MyRWGroup v1 local group MyRWGroup v2c local group MyRWGroup usm local view all included .1 80 access MyRWGroup "" any noauth exact all all none syslocation Unknown (edit /etc/snmp/snmpd.conf) syscontact Root (configure /etc/snmp/snmp.local.conf) pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820statSave and close the file. Turn on snmpd service:
# /etc/init.d/snmpd start
# chkconfig snmpd on
# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.10.10.9.108 = INTEGER: 2 IP-MIB::ipAdEntIfIndex.67.yy.zz.eee = INTEGER: 3 IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
# yum install cacti
# rpm -ql cacti | grep cacti.sql
/var/www/cacti/cacti.sqlType the following command to install cacti tables (you need to type the cacti user password):
# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7g/cacti.sql
# vi /etc/cacti/db.php
/* make sure these values refect your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "cactipass"; $database_port = "3306";Save and close the file.
# vi /etc/httpd/conf.d/cacti.conf
# # Cacti: An rrd based graphing tool # Alias /cacti /usr/share/cacti Directory /usr/share/cacti
Order Deny,Allow Deny from all Allow from 10.0.0.0/8
Directory
Another option is create /usr/share/cacti/.htaccess file and password protect the directory. Finally, restart httpd:
# service httpd restart
# vi /etc/cron.d/cacti
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1Save and close the file.
http://your.example.com/cacti/
http://your.server.ip.address/cacti/