Monday, October 1, 2012

Understanding RHEL daemons (RedHat)

http://magazine.redhat.com/2007/03/09/understanding-your-red-hat-enterprise-linux-daemons/

acpid

This is the daemon for the Advanced Configuration and Power Interface (ACPI). ACPI is an open industry standard for system control related actions, most notably plug-and-play hardware recognition and power management, such as startup and shutdown and putting systems into low poser consumption modes.

You'll probably never want to shut down this daemon, unless you are explicitly instructed to do so to debug a hardware problem.

Learn more:
http://www.acpi.info

anacron

One of the problems with living on a laptop, as so many of us do these days, is that when you set up a cron job to run, you can't always be sure that your laptop will be running at the time that the job should run. anacron (the name refers to its being an "anachronistic cron") gets around this problem by scheduling tasks in days. For example, anacron will run a job if the job has not been run in the specified number of days.

When are you safe not running anacron? When your system is running continuously. Should you simply stop cron from running if you have anacron running? No; anacron is able to specify job intervals in days, not hours and seconds.

Learn more:
http://anacron.sourceforge.net

apmd

This is the daemon for the Advanced Power Management (APM) BIOS driver. The APM hardware standard and apmd are being replaced by ACPI and acpid. If your hardware supports ACPI, then you don't need to run apmd.

atd

This is the daemon for the at job processor (at enables you to run tasks at specified times). You can turn off this daemon if you don't use it.

autofs

This daemon automatically mounts disks and file systems that you define in a configuration file. Using this daemon can be more convenient that explicitly mounting removable disks.

Learn more:
http://freshmeat.net/projects/autofs


Avahi-daemon and avahi-dnsconfd

The Avahi website defines Avahi as: 'a system which facilitates service discovery on a local network. This means that you can plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to, or find files being shared…' Avahi is a Zeroconf implementation. Zeroconf is an approach that enables users to create usable IP networks without having special configuration servers such as DNS servers.
A common use of the avahi-daemon is with Rhythmbox, so you can see music that is made available to be shared with others. If you're not sharing music or files on your system, you can turn off this daemon.

Learn more:
http://avahi.org
http://zeroconf.org


more ...here...

Sunday, September 30, 2012

Prevent an upstart / lightdm / gdm service from running at boot on Ubuntu


You can use an override:

    sudo echo "manual" >> /etc/init/lightdm.override  

To start lightdm on command:

    sudo start lightdm  

To restore your system so that lightdm is always started on boot:

    sudo rm /etc/init/lightdm.override  

For more information, the upstart cookbook is your friend:

Overview of RPM commands

Source: http://www.idevelopment.info/data/Unix/Linux/LINUX_RPMCommands.shtml

Purpose
Description / Example
Install an RPM Package
RPM packages have file naming conventions like foo-2.0-4.i386.rpm, which include the package name (foo), version (2.0), release (4), and architecture (i386). Also notice that RPM understands FTP and HTTP protocols for installing and querying remote RPM files.
rpm -ivh foo-2.0-4.i386.rpm  rpm -i ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm  rpm -i http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm
Un-install an RPM Package
To un-install an RPM package, we use the package name foo, not the name of the original package file foo-2.0-4.i386.rpm above.
rpm -e foo
Upgrade an RPM Package
To upgrade an RPM package, RPM automatically un-installs the old version of the foo package and installs the new package. It is safe to always use rpm -Uvhto install and upgrade packages, since it works fine even when there are no previous versions of the package installed! Also notice that RPM understands FTP and HTTP protocols for upgrading from remote RPM files.
rpm -Uvh foo-1.0-2.i386.rpm  rpm -Uvh ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm  rpm -Uvh http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm
Query all Installed Packages
Use RPM to print the names of all installed packages installed on your Linux system.
rpm -qa
Query an RPM Package
Querying an RPM package will print the package name, version, and release number of the package foo only if it is installed. Use this command to verify that a package is or is not installed on your Linux system.
rpm -q foo
Display Package Information
RPM can display package information including the package name, version, and description of the installed program. Use this command to get detailed information about the installed package.
rpm -qi foo
List Files in Installed Package
The following command will list all of files in an installed RPM package. It works only when the package is already installed on your Linux system.
rpm -ql foo
Which package owns a file?
Use the following command to determine which installed package a particular file belongs to.
rpm -qf /usr/bin/mysql
For example:
    # rpm -qf /usr/bin/mysql  mysql-3.23.52-3
List Files in RPM File
Use RPM to query a (possibly) un-installed RPM file with the use of the the "-p" option. You can use the "-p" option to operate on an RPM file without actually installing anything. This command lists all files in an RPM file you have in the current directory. Also note that RPM can query remote files through the FTP and HTTP protocols.
rpm -qpl kernel-2.4.20-18.10.1.i686.rpm  rpm -qpl ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm  rpm -qpl http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm
Verify an Installed Package
Use RPM to list all files that do NOT pass the verify tests (done on size, MD5 signature, etc).
rpm --verify mysql
Where a file does NOT pass, the output is listed using the following codes that signify what failed:
S File size  M Mode (includes permissions and file type)  5 MD5 sum  L Symlink   D Device   U User   G Group   T Mtime
Take for example the following:
# rpm --verify mysql  S.5....T c /etc/my.cnf
This example indicates that file /etc/my.cnf failed on:
File size  MD5 Sum  Modified Time
However, the "c" tells us this is a configuration file so that explains the changes. It should still be looked at to determine what the changes were.
Check an RPM Signature Package
RPM can be used to check the PGP signature of specified packages to ensure its integrity and origin. Always use this command first before installing a new RPM package on your system. Also, GnuPG or Pgp software must be already installed on your system before you can use this command.
rpm --checksig foo

How do you uninstall programs installed using make?



In case if you were wondering how one would go about uninstalling something that was installed with ./configure -> make -> make install. Makefiles don't seems to have a 'remove' section, and make does not seem to have a built in 'sudo make remove <program>' feature.

Your options are
  1. To search the application install folder for a file that may have a comprehensive list of binaries and its locations
  2. Run following command inside the installer directory
    • Su to root and then type #make uninstall
    • $sudo make uninstall

Saturday, September 29, 2012

wireshark change menu fonts xquartz osx

  1. Edit the pre-gtkrc and gtkrc files included in the Wireshark installation. 
    • Open up these files in your favorite text editor, which are located inside/Applications/Wireshark.app/Contents/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0
    • Search for the entry in each configuration file named "gtk-font-name"  
    • Set it to whatever font you want.  NOTE: OpenType fonts don't seem to display as well as TrueType fonts do, 
    • For this example, I've changed this value to "Verdana 10" from the theme default
  2. Enable Font Smoothing
      • Go to /Applications/Wireshark.app/Contents/Resources/etc/fonts 
      • Adding the following text:
          <match target="font">
              <edit mode="assign" name="autohint">
              <bool>true</bool>
              </edit>
          </match>

  3. Restart / Start the wireshark

Friday, September 28, 2012

Installing PUPPET on Red Hat, CentOS and Fedora

To get the latest releses of Puppet, you will need to add the EPEL repository.
 
 
(EPEL is a volunteer-based community from the Fedora project to create a repo of high-quality add-on packages for RHEL and clones)
Further details can be found at http://fedoraproject.org/wiki/EPEL/FAQ#hotouse
 
 
To Install the PUPPET MASTER on Redhat based system
 
1. Install pre-requisit library
 
      root@host# yum install ruby ruby-libs ruby-shadow
 
2a. Install Puppet Master (Server)
 
      root@host# yum install puppet puppet-server facter
 
 
2.b. Install Puppet Agent(Client)
       root@host# yum install puppet facter
 
 

Wednesday, September 26, 2012

Bash Script Template for writing bash utilities

The following code can serve as a template for creating a bash utility.  The purpose of this wrapper utility is to checkout a file, edit in an editor and check the file back in. 


The following is the command usage

root@host# ./rcwrapper [-c "comment goes here"] filename1 [filename2 filename3 ...]

 


#!/bin/bash

#########################

## Author: Nirav Doshi ##

## Date: Sept 25, 2012 ##

## Purpose:

##      Facilitate checkout, edit 

## and checkin process for code viewing, 

##      and editing.

#############################


export EDITOR=vim


while [ $# -gt 0 ]; do  #until run out of parameters

case "$1" in


   -c)

# Move the cursor to next argument which has comment information

shift


# set the comment value

if [ -n "$1"#compare if -c is passed with an argument

then

COMMENT=$1

echo "comment is \"$COMMENT\""

else

COMMENT="no comment supplied"

echo $COMMENT

fi

;;


*)

# Check out the file from repository

echo "CO -c \"$COMMENT\" $1"

# Calls the Editor program varriable along with filename

$EDITOR $1


# Checking file into the repository

echo "CI -c \"$COMMENT\" $1"

;;


esac

 shift

done