Archives Posts
August 19th, 2008 by elizar
When we say or mention the word Web Server, the first thing that comes to our mind is Apache, right? (if you don’t then what are you doing here reading this? :-))
Apache is the most well known open source web server there is! Open source?? Make that the most wildly used webserver on the internet, period!
It is believed (and i know they made a survey or study about it) that Apache takes 90% of all web servers in the internet. Most web hosting company, and I’ve once worked in one, use Apache.
This post will talk about how to setup Apache for Virtual Hosting
Read the rest of this entry »
Archives Posts
April 28th, 2008 by elizar
Who in heaven is Arlo Gilbert? Yep, using ‘heaven’ is perfect for describing this man for he do sometimes tries to conquer heaven. He’s into planes you see.
Anyway, you’re probably Googling about Arlo Gilbert as you read this post. Well, let me save you a few minutes and introduce you to Mr. Gilbert in one fast minute.
He is the following:
- The Man is from Austin, Texas
- Arlo Gilbert is a high school drop out… and a proud one (don’t do that boys and girls)
- A family man! So there’s a Mrs. Gilbert and two little Arlo Gilberts (daughters)
The reason why we feature this brilliant man is that he has successfully launched online startups and been doing it for 10 years now. Remember, high school dropout and no training in marketing or any business related studies… Brilliant indeed.
What caught my attention while reading his ‘About’ page was his current project - the iCall. It’s a VOIP startup company. I was wondering if iCall was developed by Arlo Gilbert or if it uses Asterisk?
.
.
.
Tekken Philippines
Archives Posts
March 13th, 2008 by elizar
Yep, this is a dummy’s reference… I keep on forgetting the syntax so I might as well put it here for my own reference…
vi is the one, if not the most popular text editor available for a System Administrator on a UNIX and UNIX-like machines.
It has two modes, command and editor mode.
Here are some syntax in using the Search and Replace in ‘vi’.
Search:
The most basic and most easily remembered command for searching is vi is slash or ‘/’ followed by the character being searched. That’s for forward searching. For backward, vi use ‘?’ followed by the string being searched.
To go to the next occurrance of the string being searched, vi use ‘n’ command. Doesn’t matter if your searching forward (from up, down) or backward, from down to top.
Example:
(you have to be in command mode… press ESC first)
/search_string
?search_string
Search and Replace
For search and replace, use the syntax
:%s/original/replaced/g
Make sense?
Any command that begins with a “:” is called a line mode command and performs its duty on the line the cursor is currently on.
The above syntax serves my purpose now… If I want to replace text in certain ranges.. syntax can be found here
Archives Posts
November 20th, 2007 by elizar
/proc is a pseudo-filesystem used to access process information from the kernel. It doesn’t use any storage space and uses little memory. On Linux, you can sometimes make modifications to the running kernel by modifying “files” in /proc.
If / is full, run a command similar to the following to sort all files in the / file system by size:
find / -xdev -ls | sort -n -k 7
“-xdev” limits the find command to the root file system.
This will only look for files found in the root and will not includes those partitions that are defined in /etc/vfstab | /etc/fstab file, those listed when `df -k` is executed:
/dev/md/dsk/d0 2058319 1016097 980473 51% /
/dev/md/dsk/d3 2058319 1801793 194777 91% /var
etc .. etc..
Thanks Brandon!
Brandon H. - Senior UNIX Systems Engineer for an application services provider in Minneapolis, MN.
Archives Posts
November 11th, 2007 by elizar
NFS, DNS, NIS and NIS+… that’s a lot of acronyms!
Network File System
NFS is Sun’s Networked File System, and by now, more or less, the de facto method of sharing file systems between computers.
Domain Name Service
DNS is the Domain Name Service, which is the way information about hostnames and addresses are shared across the Intenet.
Network Information (Name) Service
NIS stands for Network Information Name Service. It was original called Yellow Pages, which is why many of the commands for NIS start with yp (such as ypbind, ypcat, etc.) NIS was developed by Sun, and is, like NFS, more or less the default way of sharing system information between UNIX machines.
NIS+
NIS+ is Sun’s re-implementation of NIS. It attempts to address some of the problems with NIS, but the implementers of NIS+ have made a series of bad choices in the design of NIS+, so it has seen only limited usage compared to the other types of services you asked about.
Archives Posts
November 1st, 2007 by elizar
This tip is a give away. Everyone knows this, but for those who doesn’t or forgot… here’s refresher…
Here’s a typical output of a file listing using `ls -l` on a directory:
[root@unix-box icons]# ls -l | more
total 636
-rw-r–r– 1 elizar root 246 Aug 26 2005 a.gif
-rw-r–r– 1 elizar root 242 Aug 26 2005 alert.black.gif
-rw-r–r– 1 elizar root 279 Aug 26 2005 alert.black.png
-rw-r–r– 1 elizar root 247 Aug 26 2005 alert.red.gif
-rw-r–r– 1 elizar root 298 Aug 26 2005 alert.red.png
-rw-r–r– 1 elizar root 2326 Aug 26 2005 apache_pb.gif
-rw-r–r– 1 elizar root 1385 Aug 26 2005 apache_pb.png
-rw-r–r– 1 elizar root 293 Aug 26 2005 a.png
When using the -l (dash ‘el’) option of ls, the output will display a more detailed listing of the files. Here you’ll see the file properties/permission (-rw-r–r–) the number of links, the owner of the file, the group of the user, file size, the date/time stamp and finally the file name. That’s 7 column.
Changing The Time Stamp Of A File
To change the time stamp of a file (the 6th column in the `ls -l` listing), we use the UNIX command touch.
From the Man Pag:
NAME
touch - change file timestamps
SYNOPSIS
touch [OPTION]… FILE…
touch [-acm] MMDDhhmm[YY] FILE… (obsolescent)
There are many options for the touch command, but the one I use fairly often is the -t option
-t STAMP; use [[CC]YY]MMDDhhmm[.ss]
Example:
[root@unix-box icons]# touch -t 200607161201 a.gif
[root@unix-box icons]# ls -l | more
total 636
-rw-r–r– 1 elizar root 246 Jul 16 2006 a.gif
-rw-r–r– 1 elizar root 242 Aug 26 2005 alert.black.gif
Other options that you may find useful are -a (change access time only) -m (modification time only) and others. Consult the man page for more details
Cheers!
Archives Posts
October 28th, 2007 by elizar
Here are some of the commands and files that you may want to check out if you want to monitor your users’ login activity on a Unix box (BSD/Solaris)
The concerned files (Solaris):
- /var/adm/utmp(x)
- /var/adm/wtmp(x)
- /var/adm/lastlog
The Commands:
- users*
- who
- w
- ac*
- last
- *may not be available in Solaris?
All sample outputs show on this post are from: `uname -a`
SunOS unixbox 5.9 Generic sun4u sparc SUNW,Ultra-5_10
Read the rest of this entry »
Archives Posts
October 8th, 2007 by elizar
Just want to document it here. A colleague request to kill multiple PID owned by different users. They don’t have any special privilege to kill process other than their own.
Here’s a simple for…loop script that will look for and kill each PID it found.
#!/bin/sh -x
ps -ef | grep nobody | awk ‘{print $2}’ > /tmp/PID
filePID=”/tmp/PID”
for PID in `cat $filePID`
do
kill -9 $PID
done
#
Line 1, tells which shell will execute the script
Line 2, gets all the PID to be killed and store them on a file.
Line 3, assigns a variable for the file
Line 4 to 7 is the for…do loop which basically gets each line on the file, store the value on $PID and then kill whatever value is in it on line 6.
Yucky script. Post a better one.
Thanks.
Archives Posts
October 1st, 2007 by elizar
fsck is the command used in UNIX for checking filesystem for any inconsistencies, usually caused by abnormal shutdown. These abnormal shutdown may be caused by some hardware failure or power failure.
fsck also has options to repair filesystem as well.
Syntax:
fsck [ -F fstype] [-V] [-yY] [-o options] special
-F fstype type of file system to be repaired ( ufs , vxfs etc)
-V verify the command line syntax but do not run the command
-y or -Y Run the command in non interactive mode - repair all errors encountered without waiting for user response.
-o options Three options can be specified with -o flag
b=n where n is the number of next super block if primary super block is corrupted in a file system .
p option used to make safe repair options during the booting process.
f force the file system check regardless of its clean flag.
Most *NIX machines has fsck, but special attention should be made when dealing with Sparc hardware or Solaris UNIX in general.
When doing fsck, make sure that you are checking the ‘raw’ device and not just the logical disk.
Check this out to determine the raw device of a solaris server. We’ll post more of the topic soon.
Archives Posts
September 19th, 2007 by elizar
There are many shells available for the UNIX operating system. Among them are sh (bourne), csh (C), tsch (korn) and bash (bourne again) Shells.
With all these shells, sometimes we can mix all the syntax when assigning values to a variables. Here’s is another review so you wont forget:
C Shell (csh) or Korn (tcsh):
hostname# setenv LD_LIBRARY_PATH /usr/local/lib
hostname# setenv MYVAR /usr/mydir
$PATH before and after:
hostname# echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
hostname# setenv PATH ${PATH}:/usr/local/local/bin
hostname# echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/local/bin
For Bash (bash), Bourne (sh) or Korn (tcsh):
EDITOR=vi
export EDITOR
Study the syntax and let’s discuss…