• Increase font size
  • Default font size
  • Decrease font size
Tag:how to

  PSTree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.

PSTree can take a user name as an argument and display all running processes of that specific user. PSTree is part of psmisc rpm package and is installed by default on Fedora 8 with X.

PSTree usage:

Basic tree process 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pstree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tree process of specific user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pstree root
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tree process with numerical sorting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pstree -n
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tree process showing ASCII characters to draw the process tree
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pstree -A
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tree process displaying PIDS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pstree -p
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From:http://techgurulive.com/2008/09/18/how-to-display-a-tree-of-linux-processes/

 

 1. Plan the layout of the filesystem with the new drive 

2. Partition the new hard drive 
3. Format the new partitions 
4. Test the new space 
5. Copy data from old to new partition (optional) 
6. Edit /etc/fstab 
7. Reboot 
8. Remove old data (optional)

Here is the details about each one.

1. Plan the new filesystem. Where would you like to use the new space? Do

df

to print a summary of free/used space on each of the existing mounted partitions. Do

du

on selected directories to find their size.

For example, I would consider using new hard drive space in one of the following mount points:

/usr/local 
/home 
/home/share/downloads 
/usr/local/mp3s 
/usr/local/dos_data

Here is Details.

/usr/local is suposed to survive any upgrade of Linux. It is nice to have it on a separate partition because I can even reformat other partitions without affecting my local contents stored in /usr/local. I surely want it of the type "ext2" or perhaps "reiserfs".

/home contains user data. Surely, it is the data that deserves the most care. It is obviously supposed to survive any upgrade of Linux. Wow, obviously I want it on a separate partition. The type is normally "ext2" or "raiserfs".

/usr/local/mp3s is a non-standard Linux directory. I may keep my MP3 (music) files there. Those tend to be large.

/usr/local/dos_data. Another non-standard directory. If I dual boot, I would consider making an extra partion of the type "DOS FAT32" or similar so as to share files between MS Windows and Linux transparently (both ways). I would configure all the Windows-based programs to use this "drive" as the default location for all user-generated files. I could even have "mp3s", "cds" and other such directories in this location. The serious drawback of this approach--MS Windows may insist on messing up with this partion on re-install.

2. Partition the new hard drive. For example, if my new harddrive is the slave on the second IDE interface (perhaps the "fourth" IDE drive), I could use:

cfdisk /dev/hdd

or the more old-fashioned (and standard) tool:

fdisk /dev/hdd

If your drive is not "hdd" adjust the above command as needed.

hda -- first ide master (whole disk) 
hdb -- first ide slave 
hdc -- second ide master 
hdd -- second ide slave 
sda -- first scsi (whole disk) 
sdb -- second scsi (whole disk) 
... 
sdp -- sixteenth scsi (whole disk)

For other disks, consult /usr/src/Linux/Documentation/devices.txt.

Most of the time,  Linux partitions to be of the type ext2 ("Linux").

Partitioning can be tricky--if you never have done it, read man fdisk and man cfdisk. It is very easy to delete a partition with all your data. Make sure you know which disk you are working with!

fdisk or cfdisk does not make any changes to the hard drive until I write the new partition layout. So if I make a bad mistake, I can always quit without writing. I write the layout to the drive only when I am completely done.

3. Format each partition. For example, to format the first partition, while checking for bad blocks (-c), I would do:

mkfs -c -t ext2 /dev/hdd1

4. Test the new partitions around. Mount the new partitions manually (the mount directory must exist and be empty). Copy a bunch of files to each partition. View/edit a couple of random files. Delete them all.

5. Copy data. Optional--only if you would like to move data from an old partition to a new partition. Go to the single-user mode (init 1). Mount the new partition manually. Copy the data from the old partition to the new partition. Careful with the old data, you probably don't want to lose it if you made a mistake, so I wouldn't delete it yet--I rename the top level directory appropriately. E.g.,

cp -R /usr/local/ /mnt/hdd1/ 
mv /usr/local/ /usr/local.old.backup_of_2005-04-21

6. Edit the file /etc/fstab. Modify it to reflect your new filesystem layout. Perhaps, insert the mountpoint for the new partition(s) or modify any old mountpoints as needed. For example, if moving /usr/local to its own partition, I would need to add to add a line like this:

/dev/hdd1 /usr/local ext2 defaults 1 2

7. Reboot and test. The alternative to reboot is to unmount old and mount new mount points. For example:

umount /usr/local 
mount -a

but hard reboot may be a more rigorous test of the new layout.

8. Remove old data. After a few days, when I have the confidence everything is really working fine

From:http://www.debianhelp.co.uk/newharddisk.htm

 

 uname -a should give you all the information you want

uname -l

 
[root@HCMRTG_BY cron]# uname -a
Linux HCMRTG_BY_YaoBin 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux
 

 

 

 SSL uses port 443 for requests for secure pages. If your browser just sits there for a long time when you attempt to access a secure page over your Apache proxy, then the proxy may not be configured to handle SSL. You need to instruct Apache to listen on port 443 in addition to any of the ports on which it is already listening:

    Listen 80
    Listen 443

Then set the security proxy in your browser to 443. That might be it!

If your proxy is sending requests to another proxy, then you may have to set the directive ProxyRemote differently. Here are my settings:

    ProxyRemote http://nicklas:80/ http://proxy.mayn.franken.de:8080
    ProxyRemote http://nicklas:443/ http://proxy.mayn.franken.de:443

Requests on port 80 of my proxy nicklas are forwarded to proxy.mayn.franken.de:8080, while requests on port 443 are forwarded to proxy.mayn.franken.de:443. If the remote proxy is not set up to handle port 443, then the last directive can be left out. SSL requests will only go over the first proxy.

Note that your Apache does NOT have to be set up to serve secure pages with SSL. Proxying SSL is a different thing from using it.

 

 

 Sooner or later, you'll want to reset your log files (access_log and error_log) because they are too big, or full of old information you don't need.

access.log typically grows by 1Mb for each 10,000 requests.

Most people's first attempt at replacing the logfile is to just move the logfile or remove the logfile. This doesn't work.

Apache will continue writing to the logfile at the same offset as before the logfile moved. This results in a new logfile being created which is just as big as the old one, but it now contains thousands (or millions) of null characters.

The correct procedure is to move the logfile, then signal Apache to tell it to reopen the logfiles.

Apache is signaled using the SIGHUP (-1) signal. e.g.

mv access_log access_log.old
kill -1 `cat httpd.pid`

Note: httpd.pid is a file containing the process id of the Apache httpd daemon, Apache saves this in the same directory as the log files.

Many people use this method to replace (and backup) their logfiles on a nightly or weekly basis.

 

 

 

1. Power on the virtual machine.

2. Select VM > Install VMware Tools.

The remaining steps take place inside the virtual machine, not on the host computer.

3. Be sure the guest operating system is running in text mode. You cannot install VMware Tools while X is running.

4. As root (su -), mount the VMware Tools virtual CD-ROM image, change to a working directory (for example, /tmp), uncompress the installer, then unmount the CD-ROM image.

Note: You do not use an actual CD-ROM to install VMware Tools, nor do you need to download the CD-ROM image or burn a physical CD-ROM of this image file. The VMware Workstation software contains an ISO image that looks like a CD-ROM to your guest operating system. This image contains all the files needed to install VMware Tools in your guest operating system.

Note: Some FreeBSD distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands below. You still must untar the VMware Tools installer to /tmp.

mount /cdrom

cd /tmp

Untar the VMware Tools tar file:

tar zxf /cdrom/vmware-freebsd-tools.tar.gz
umount /cdrom

5. Run the VMware Tools installer.

Using the tar installer

cd vmware-tools-distrib
./vmware-install.pl

6. Log out of the root account.

exit

7. Start X and your graphical environment

8. In an X terminal, launch the VMware Tools background application.

vmware-toolbox &

Note: You may run VMware Tools as root or as a normal user. To shrink virtual disks, you must run VMware Tools as root (su -).

Note: In a FreeBSD 4.5 guest operating system, sometimes VMware Tools does not start after you install VMware Tools, reboot the guest operating system or start VMware Tools on the command line in the guest. An error message appears:

Shared object 'libc.so.3' not found.

The required library was not installed. This does not happen with full installations of FreeBSD 4.5, but does occur for minimal installations. To fix the problem of the missing library, take the following steps:

1. Insert and mount the FreeBSD 4.5 installation CD or access the ISO image file.

2. Change directories and run the installation script.

cd /cdrom/compat3x
./install.sh

 

 
 #uname -a

Linux HCMRTG_BY_YaoBin 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux

 

[root@]# cat /proc/version

Linux version 2.6.18-92.el5 (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-41)) #1 SMP Tue Apr 29 13:16:12 EDT 2008

 

 

 # mysqladmin -u username -p create databasename

That mysqladmin command shows all you need to do to create the Drupal database. I named my Drupal database drupaldb, and created the database using the MySQL root user account, so my command looked like this:

# mysqladmin -u root -p create abdb
 

 Usage: /usr/bin/groups [OPTION]... [USERNAME]...

 
  --help      display this help and exit
  --version   output version information and exit
 
Same as id -Gn.  If no USERNAME, use current process.
 
Report bugs to .
[root@]# groups apache
apache : apache
 

 The userdel command is used to remove the user's record from the /etc/passwd and /etc/shadow used in the login process. The command has a single argument, the username.

 

Usage: userdel [options] LOGIN

Options:

  -f, --force                   force removal of files, even if not owned by user

  -h, --help                    display this help message and exit

  -r, --remove                  remove home directory and mail spool

 

[root@]# userdel paul
 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »