SysAdmin Blog, TechTips and Reviews

Unix SysAd's Technology Blog




Archives Posts

Unlock locked user account in HP-UX

October 15th, 2009 by elizar

I know nothing about HP UX (yeah, except SAM). That’s why, just now, when there’s a request to just make a trace route from an HPUX server to another server, I have to login and do execute the command. I couldn’t log in as my user id so i logged in as root instead from the console.

I check grep’d my account the walah! It was there! I reset the password, open an ssh terminal and tried to login. unsuccessful, that’s why i knew then that it is locked.

Here’s how to unlock a locked user account in HP UX in command line.

In HP-UX 11.xx if user account is locked, you can unlock the account by running SAM. But running SAM takes some time usually 2-3 minutes on heavily loaded HP-UX servers. You can unlock the locked user account from command line by running following command:

1. Login as root or use sudo from your account, if there is no sudo installed just use su – root :

$sudo su –

*******

2. Run this command to unlock the locked HP-UX user account:

#/usr/lbin/modprpw –l –k johnm

Running modprpw will unlock the locked user account in HP-UX from command line.without running SAM

NOTE: modprpw is HP-UX command only and wouldn’t work in Solaris,AIX and any Linux servers

That info was ‘borrowed’ from here…. thanks!

Archives Posts

Send Break on SPARC Enterprise T5120 – Send Break on ILOM

October 15th, 2009 by elizar

Send Break on SPARC Enterprise T5120 – well it for the T5000 series I guess, the newer ones. Or “Sending Break onan ILOM..

“->” = ILOM
“sc>” = ALOM

.. and since this particular server has the “->” prompt we’re using the ILOM.

From ILOM to Solaris:
-> start /SP/console

From ALOM to Solaris:
sc> console

And of course.. Enter “#.” to return to ALOM / ILOM !!

Send Break on ILOM

set /HOST send_break_action=break
and then
start /SP/console

c)ontinue, s)ync, r)eset? s

bada bing! bada boom!

Archives Posts

Configure Virtual Hosting in Apache Web Server

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

All About Arlo Gilbert

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

Filed under Uncategorized, Unix having 14 Comments »

Archives Posts

vi Search and Replace… The Basics, Dummy’s Reference

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… :D

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

Filed under Linux, Solaris, Tips, Unix having 2 Comments »

Archives Posts

About the /proc and -xdev parameter for ‘find’

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.

Filed under Commands, Tips, Unix having No Comments »

Archives Posts

Difference Between NFS, DNS, NIS+, and NIS

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.

Filed under Unix having 1 Comment »

Archives Posts

UNIX Quick Tip: Changing The Time Stamp Of A File

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!

Filed under Linux, Tips, Unix having No Comments »

Archives Posts

Monitoring User Logins In UNIX

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 »

Filed under Tips, Unix having 3 Comments »

Archives Posts

Loop Kill Mutiple PID On Bourne Shell

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.

Filed under Linux, Scripting, Solaris, Unix having 4 Comments »

« Previous Entries