Two for Tuesday

Got a couple links I will need to use for a client tomarrow:

  • X cygwin — Cygwin is a tool that provides some Unix functionality on windows. XCygwin adds an X server to the cygwin package, allowing for remote connections to Unix machines GUI enviroments.
  • FTP Install of Suse — Installing Suse via FTP is very useful but takes a little configuration know-how. I threw together a quick how-to on setting up an FTP install server for Suse, complete with firewall configuration. It also includes some information on using the install server as a general purpose FTP server as well.

Smart SUSE

Any of you who have started using OpenSuse regularly, are probably familiar with the SMART package manager. SMART is very similar to apt and yum (thankfully it closer to apt in both speed and intelligence.) The SMART link above points to a susewiki article telling you how to install and configure SMART. Suse uses yast (great for system configuration but god awful for package management) and as such it takes some work to get SMART running. The article is fairly straightforward; so I decided to make it easier to do by creating a shell script to do the work for you.

smart_install.sh simply needs to be downloaded, made executable (chmod 755 install_script.sh), and run from the command line as root (su -c ./smart_install.sh). Answer yes to any questions and your done. Here is what you will get: a working SMART setup, the default package repositories, a KDE service menu for any RPM packages, a system tray applet to monitor for package updates, and a working SMART GUI for installing new applications.

Currently the script works for Suse 10.2 on 64bit and 32bit systems. I will add more Suse versions if there seems to be interest.

Getting In Deep with RPM

RPM is easily the most comprehensive packaging system for Linux.  The breadth of functionality and features in RPM continues to amaze me at times. Lately I have been working on getting some packages ported from our existing Redhat ES 3 infrastructure to Suse.  As a quick side note; we are not happy with Suse lately but at least they do not intentionally break KDE and ignore their volunteer community.  While RPM could, in theory, be used as a general package infrastructure for all RPM based system; the reality is something else entirely.  Packages from Redhat have required significant changes for me to get them working on Suse (the opposite is entirely true as well.)

A couple tools that have made porting easier have been perl.req and perl.prov.  Located in the /usr/lib/rpm on Suse 9, these two scripts take a list of files and return (through stdout) all required/provided perl packages for those files. Packages are only listed once and are presented in alphabetical order.

The GROUPS file for handling software categories in RPM is located in the /usr/share/doc/packages/rpm/ directory; while the RPM macros file (which is surprisingly similar to Redhat’s) is located in the normal installation directory of /usr/lib/rpm/macros. Here is a link to the January, 2005 edition of Suse Package Conventions.  I have downloaded a version in pdf form that can probably be found in my documents web page (see the VAULT side panel.)

A couple of Perl specific macros that only exist in Suse (and make building RPM packages much easier) are %perl_process_packlist, which does a bunch of cleanup work to the perl modules being built, and %perl_make_install, which handles different prefix installs depending on which version of Suse is being used. %perl_make_install is especially nice if you are trying to build a RPM for older and newer versions of suse in the same build environment.

RPM also provides similar macros (and requires/provides scripts) for Python. See the macros files for more details. Finally, the bible for all things rpm is Maximum RPM from rpm.org. The default macros like setup, prep, and patch are all defined there and are identical between distributions.

Misc. Linux Commands

  • finger – Prints user information in a human readable format.
  • pwconv – creates a shadow entry for an existing passwd user. Even if shadow entry is missing. Check out grpconv, pwunconv, and grpunconv for related functionality.
  • pwck – Check integrity of passwd file.
  • hwinfo – Program generates and displays a list of specific information about the devices installed on your system. (Suse specific?)
  • iostat – Display CPU and IO system statistics.
  • id – Print UID and GID information.
  • cut – Remove sections for each line of a file. (ex: cat /etc/group | cut -d: -f1,3)
  • newgrp – Log into a different group. UID stays the same but rights are changed to reflect new group membership. User must be a member of said group or a group password must be set for this to work. sg is an alias to the newgrp command.
  • passwd – Make changes to a users password. Actually this is a commonly used (i.e not misc) command but two options it has that I didn’t expressly know about. -l will lock a user account (when issued as root) and -S will display users password information (expiration date, warn before lock days, maximum number of allowed days with same password, etc.)
  • chage – Print or change a user accounts password information (expiration date, warn days, etc..)
  • wall – Sends a message to all system users. Root messages are the only ones displayed if user has blocked user-to-user messages.

Quick Links: RSS & Mailman

I need a place to store these links.  We are using mailman at work to do anouncement mail-lists and wanted to extend it to auto-generate RSS feeds for those same announcements.  These are a couple of examples of that functionality that other people have already done: