Archive for December, 2008

Linux Sysadmin : How to determine remaining disk space from the Linux command line

Saturday, December 27th, 2008

From the command line, type:

df -h

Full DF command set.

–Joab Jackson





Shell: Pattern Matching in Bash

Saturday, December 27th, 2008

Here is the basic procedure (in Bash) for comparing two strings to see if they match:



case $string in
$pattern) echo "Match" ;;
*) echo "No match";;


Using the case statement, and assuming $pattern has already been handed to the shell, the next input ($string) will be compared with $pattern to see if they match.

If they do, the line will type out “match.”

If not, the case statement will execute the second line of the script, which basically says if the line is anything(*) then it will type out “no match.”

With the case operation, the second line here executes if the first line doesn’t execute (because the string does not match)

From Linux.com (“Patterns in string processing in shell scripts“)

–Joab Jackson





Linux Sysadmin: Steps to building a server, Ubuntu 8.10–Hard drives, Network, DNS

Monday, December 8th, 2008

MOUNTING HARD DRIVES

/dev/sdb1 /home/[where you want to mount the file]
/dev/sdc1 etc…

NETWORK CONFIGURATION:
1. In /etc/network/interfaces type:

iface eth1 inet static
address 192.168.0.[etc]
netmask 255.255.255.0
gateway 192.168.0.1

DNS servers manually in /etc/resolv.conf, which should look something like this:

search mydomain.example
nameserver 192.168.0.1
nameserver 4.2.2.2

(NOTE: Comcast usually supplies DNS numbers during DHCP)
(https://help.ubuntu.com/7.10/server/C/network-configuration.html)

(To check, ping from other machines)
–Joab Jackson