slackbash script

Other talk about Salix
Post Reply
User avatar
fredg
Posts: 232
Joined: 3. Oct 2009, 16:50
Location: Lyon, France
Contact:

slackbash script

Post by fredg »

Hi,

I have found these admin scripts and think that it may be usefull for some of you too:
They are available in the slkbuild repo in a all-in-one pkg: slackbash

Quoted from http://slackbash.tuxfamily.org/

Scripts

freepkgs.awk This script lists the free packages on a Slackware box. Free packages are those upon which no other package depends. For example, xkill is a free package. You can remove it without breaking any other package. The script only determines dependencies of binaries and .so libs. It does not detect scripting language dependencies. Runtime on a 533Mhz Pentium with 507 pkgs: 22 minutes. On a 1Ghz, 128MbRAM, 733pkgs: 4 min 8 sec.

pruneXpkgs.sh one of my scripts for thinning out useless packages. Using the output of freepkgs.awk, it runs through the packages starting with "x" (most are X11 packages), shows you the man page or the Slack file list, and gives you the option to remove or ignore. Out of 95 such packages, I found 33 where I didn't have any doubt about their uselessness on my laptop.

footprint.sh
: I use this script to give me the footprint of /, /home, /tmp and a pkg count. You'll want to alter this one to suit your own installation.

missing_libs.sh
: This script is a fork and reduction of Sasha Alexandr's orphans.sh. It identifies missing library dependencies on a Slackware system. Analyzes installed libs against /var/log/packages. Self-built or manually Installed libs not reliably analyzed. On my 533Mhz PIII w/501 pkgs: 38 min 43 sec. On a 1600Mhz with 768MbRAM and 504 pkgs: 1 min 40 sec. On a 1Ghz, 128MbRAM, 733pkgs: 7 min 55 sec.

nipkg.awk
finds all files which are on the box but not in the listings of /var/log/packages. You can adjust the excluded directories to suit yourself. The script does not yet parse /var/log/scripts (which it should) or /var/log/removed* (which it might-should, as they say in Texas). On a 533Mhz, 180MbRAM box found 984 files in 14 seconds. On a 1Ghz, 128MbRAM, 733pkgs: 1 min 28 sec.

postpkg: Slackware's run-control scripts are designed for servers. Chances are, your laptop or other single user box is not a server. Postpkg takes those elements of rc.M which update caches and puts them in a script to run after using pkgtools or adding other software. If it's in postpkg, take it out of rc.M. Then take out all the other stuff you will never use in there. And then amaze yourself with the new faster boot. Then add a call to this script at the end of installpkg, removepkg, and slackpkg. NOTE: changing a rc script is serious; don't bite yourself in the butt with this one.

pruneXf86video.sh: A pre-13.37 script. After that, you don't have an xorg.conf. An anal-retentive script for those who don't like unused packages on their box. This script removes all the video driver packages except the one in xorg.conf (don't use it if you have multiple drivers in that file) and some basic ones like vesa.

purgeXprotos.sh: another anal-retentive script. If you develop X11 pieces or applications, you might not want to remove these *proto-* packages. But I don't, so I did. Actually, I do sometimes. So I've altered the script to keep the xproto package which is often the only one you need.

scripting_pkgs.sh
: a first stab at identifying which packages use Python, Perl, Ruby or Lua. You can see what you think.

sd.sh: examines the files in /var/log/packages and lists any missing library dependencies and then lists package requirements for the libs which are not missing. Does not check for scripting language requirements yet; it just parses ldd output.

++
djemos
Salix Warrior
Posts: 1464
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: slackbash script

Post by djemos »

Thanks, fredg.
Very useful scripts.
User avatar
gapan
Salix Wizard
Posts: 6355
Joined: 6. Jun 2009, 17:40

Re: slackbash script

Post by gapan »

Yes, these look very nice. Thanks Fred. :)
Image
Image
Post Reply