Valid
	XHTML 1.1! Valid CSS!
Created 2008-03-15   Modified 2009-04-11
Chelton Evans

images/book_uni.gif Unix Admin home

Bash
Core
Determine Disk Usage
My Linux Development Box
Mac Share Point
Cron Jobs
fedora
network
ubuntu
ssh
Apache

Core

Fedora 9 has Applications > System Tools > System Monitor
Mac has Applications > Utilities > Activity Monitor

top -o cpu - looks at what processing are consuming the computer, it is the most important variable - for example if a process has gone wrong and is running at 60% when it normally is 5%.

top -o cpu -n 5 - first 5
top -o th -n 5 - threads
top -o time
top -o ptr
- ports
# yum install livecd-tools
top -cd

top has the advantage of updating in real time compared with ps.

ps -aux | sort +2n -3 | tail -5   sorts numerically on the 3rd to the 4th field the cpu time on Fedora 9.

nmap for port scanning
On my mac
# /usr/local/bin/nmap -sS <ip address>

static addresses for servers with router that support dynamic ip only > configure the dynamic range and manually assign ip addresses to computers outside the dynamic range.

$ uptime how long has server been running
# shutdown -r now shutdown and reboot
mount look at disks mounted
programs in /bin /sbin /usr/sbin

Determine Disk Usage

# cd /
# du -h > /tmp/temp.txt
# awk '$1~/G/ {print $0}' /tmp/temp.txt

# cat /var/log/secure | grep sudo
# cat /var/log/mail.log | grep def
# cat /var/log/mail.log | grep error

Implemented in a function
Example :
  # cd /
  # diskusage G > temp2.txt
  # vi temp2.txt

# 1: <G,M,K,B>
function diskusage
{
    du -h > /tmp/disk.txt
    awk '$1~/'$1'/ {print $0}' /tmp/disk.txt
}

My Linux Development Box

Log 2011-01-06

Getting validate on Fedora 12. Installing Perl Modules
Did # install Bundle::CPAN
Probably needed to only do
install Bundle::W3C::Validator

Log 2010-12-09

Installing W3C Markup Validator on Ubuntu

Log 2010-05-16

Getting OpenGL working on F12 virtualization.

Computer fluxion:
F12 -
# xterm, apt-get, g++
# yum install mesa*
# yum install libXmu*

Log 2010-04-03

# yum install livecd-tools
# yum install yum-utils

Vertualized F12 on Mac with Parallels 5.0
Downloading F12 to install on Eee PC.

# yum install liveusb-creator
# yum --enablerepo=rawhide update syslinux

Log 2009-12-28

connected 100mb ether0 to 192.168.0.0 255.255.255.0 network - this was wireless router.
Through "Network Configuration" (possibly through Network Device Control) made active eth0
checked # /sbin/route -nee to find gateway 0 was recognized as 192.168.0.1
turned Firefox browser online in File menu - tested internet google page alive
System > Administration > Update System

Log prior 2009-12-28

Fedora 9 install with full updates as they released it without its features!
# yum list available > /tmp/temp.txt
# yum install gftp
# yum install mathml-fonts
# yum install vim-X11
  gvim
# yum install xcdroast

OpenGL
# yum install mesa-demos
# yum install mesa-libGLw
# yum install mesa-libOSMesa
# yum install freeglut-dev

Had to update system a couple of times to get this working. ie javac
# yum install java-1.6.0-openjdk*

Setup NTL.

vlc http://www.videolan.org/vlc/download-fedora.html
# rpm -ivh http://download1.rpmfusion.org/free/fedora/   rpmfusion-free-release-stable.noarch.rpm
# yum install vlc

Perl Slurp Module
#yum install perl-CPAN
#cpan
cpan> force install File::Slurp

Installing dot
Graphviz - fedora
downloaded graphviz-fedora.repo saved in /etc/yum.repos.d/
# yum install 'graphviz*'

# yum install CGAL*
# yum install OpenSceneGraph*
# yum install openvrml*
# yum install archimedies*
# yum install Inventor*
# yum -y install GraphicsMagick*
# yum -y install ImageMagick*

Mac Share Point

Mounting a mac share point from another mac server.

Using afp
mkdir /Volumes/N1
/sbin/mount_afp afp://username:password/mountpoint /Volumes/N1
...   umount /Volumes/N1

Some programs get confused with ACL's on the file system. NFS sharepoint mount instead.
/sbin/mount -t nfs -ow 192.168.1.1:Volumes/mountpoint /Volumes/N1

On the mac server
Workgroup Manager > Sharing > in Share Points > Access tab > select the mountpoint directory > gave everyone access (can restrict after working) - internal network not exposed to the net
Workgroup Manager > Sharing > in Share Points > Protocols tab > NFS Export Settings > unchecked mapping users to nobody.
Choose subnet and enter the network address and subnet: to restrict nfs to that network.

Mounting nfs on a Mac

/sbin/mount -t nfs -ow 192.168.10.10:Volumes/mydir/backup /Volumes/backup

Adding a Route on a Mac

/sbin/route add -net 172.10.10.0 172.10.20.250 -netmask 255.255.255.0
permanent by adding above line to /etc/rc.common

Look at routing table
netstat -rn

Cron Jobs

To edit cron jobs
# crontab -e min hr day month dayofmonth cmd
10 18 * * * /Users/admin/Desktop/scripts/myscript.sh
6.10pm every day run myscript.sh

# crontab -l to display
# crontab -e
1,21,41 * * * * bash /Users/admin/Desktop/scripts/myscript.sh

For example if I wanted to create a symlink to a tempory file after startup on a Mac OS X, test for the symlinks non-existance, then create if apps temp file exists.

Linux

file browsers
xfe - hung in Ubuntu !#!, vifm - vi like file manager
tkdesk