linux


Ok, I always forget and have to google it so here it is….

http://perl.about.com/od/packagesmodules/qt/perlcpan.htm

There are several ways to get Perl modules from CPAN installed on your unix-based system. Keep in mind that there is always more than one way to do it with Perl, and this is no different. Before embarking upon any installation, it’s a good idea to download the module, unzip it and check out the documentation. In general, though, most modules are installed in the same method.
The simplest way to get Perl modules installed is to use the CPAN module itself. If you are the system administrator and want to install the module system-wide, you’ll need to switch to your root user. To fire up the CPAN module, just get to your command line and run this:

perl -MCPAN -e shell

If this is the first time you’ve run CPAN, it’s going to ask you a series of questions - in most cases the default answer is fine. Once you find yourself staring at the cpan> command prompt, installing a module is as easy as install MODULE::NAME - for example, to install the HTML::Template module you’d type:

cpan> install HTML::Template

CPAN should take it from there and you’ll wind up with the module installed into your Perl library.
Let’s say you’re on your system command line and you just want to install a module as quickly as possible - you can run the Perl CPAN module via command line perl and get it installed in a single line:

perl -MCPAN -e ‘install HTML::Template’

As I mentioned earlier, it’s always advisable to download a module yourself, especially if you’re having problems installing with CPAN. If you’re on the command line, you can use something like wget to grab the file. Next you’ll want to unzip it with something like:

tar -zxvf HTML-Template-2.8.tar.gz

This will unzip the module into a directory, then you can move in and poke around - look for the README or INSTALL files. In most cases, installing a module by hand is still pretty easy, though (although not as easy as CPAN). Once you’ve switched into the base directory for the module, you should be able to get it installed by typing:

perl Makefile.PL
make
make test
make install

Just installed Fedora Core 9 and discovered the method I had been using to setup a tty console has changed.  Originally, I would add the following to the /etc/inittab file:

co:2345:respawn:/sbin/agetty -t 60 19200 ttyS0 vt102

After adding this line I would then issue the command init q to re-read the inittab file and start the agetty session.

Well, I see that there is now a /etc/events.d directory which contains various script files for configuring various things including the serial console via the file serial.  At first I thought I would need to create a file ttyS0 which would then be added to the run list by issuing the command initctl start ttyS0.  I was partially correct by doing this, and it seemed to work, but I kept getting a login screen after logging in.  As it turns out, the existing file ’serial’ is already setup for tty access to a console.  So, I just had to stop and remove the ttyS0 process.

Upon further investigation, I see that this new init process is called upstart which is a replacement for the Sys V init process and is published by Ubunto.

This brings up an interesting thought concerning qmail.  Most qmail installs use the daemontools to start and stop processes.  This new method for starting and stopping processes in FC9 is very similar to daemontools.

At least on HP-UX and Solaris, when you create a user and give them a password, you can use the command “passwd -f username” to force the user to change their password on initaly login. Linux on the other hand does not have this feature although after searching around, it appears that you can do this but with multiple steps. I’ve pulled this directly from a centos online manual: http://www.linuxtopia.org/online_books/centos_linux_guides/centos_enterprise_linux_sysadmin_guide/s1-users-cmd-line.html

If a system administrator wants a user to set a password the first time the user log in, the user’s initial or null password can be set to expire immediately, forcing the user to change it immediately after logging in for the first time.

To force a user to configure a password the first time the user logs in at the console, follow these steps. Note, this process does not work if the user logs in using the SSH protocol.

  1. Lock the user’s password — If the user does not exist, use the useradd command to create the user account, but do not give it a password so that it remains locked.If the password is already enabled, lock it with the command:
    usermod -L username
  2. Force immediate password expiration — Type the following command:
    chage -d 0 username

    This command sets the value for the date the password was last changed to the epoch (January 1, 1970). This value forces immediate password expiration no matter what password aging policy, if any, is in place.

  3. Unlock the account — There are two common approaches to this step. The administrator can assign an initial password or assign a null password.
    Warning Warning
    Do not use the passwd command to set the password as it disables the immediate password expiration just configured.

    To assign an initial password, use the following steps:

    • Start the command line Python interpreter with the python command. It displays the following:
      Python 2.2.2 (#1, Dec 10 2002, 09:57:09)
      [GCC 3.2.1 20021207 (Red Hat Enterprise Linux 4 3.2.1-2)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>>
    • At the prompt, type the following (replacing password with the password to encrypt and salt with a combination of exactly 2 upper or lower case alphabetic characters, digits, the dot (.) character, or the slash (/) character such as ab or 12):
      import crypt; print crypt.crypt("password","salt")

      The output is the encrypted password, similar to 12CsGd8FRcMSM.

    • Type [Ctrl]-[D] to exit the Python interpreter.
    • Cut and paste the exact encrypted password output, without a leading or trailing blank space, into the following command:
      usermod -p "encrypted-password" username

    Instead of assigning an initial password, a null password can be assigned using the following command:

    usermod -p "" username
    Caution Caution
    While using a null password is convenient for both the user and the administrator, there is a slight risk that a third party can log in first and access the system. To minimize this threat, it is recommended that the administrator verifies that the user is ready to log in when the account is unlocked.

    In either case, upon initial log in, the user is prompted for a new password.