Diario

Wednesday, March 29, 2006

Alternative grep and find

For Unix systems:

find . -name \*.c xargs grep foo"

For Linux:

grep -r pattern *

Friday, February 10, 2006

Getting WebSite Information

Reading the list messages from IPLUG, I found a peculiar command.

wget -S --spider http://www.elcomercioperu.com.pe

It getting the information of a website, it's very important when you need know about the webserver information.

Monday, January 16, 2006

[Yum] Enable checking packages via GPG

The yum meesage show me this:

You have enabled checking of packages via GPG keys. This is a good thing.However, you do not have any GPG public keys installed. You need to downloadthe keys for packages you wish to install and install them.You can do that by running the command: rpm --import public.gpg.key

Don't worry, you only need go to:
/usr/share/doc/centos-release-4
and simply do:
rpm --import RPM-GPG-KEY-centos4

[Yum] Enable checking packages via GPG

The yum meesage show me this:

You have enabled checking of packages via GPG keys. This is a good thing.However, you do not have any GPG public keys installed. You need to downloadthe keys for packages you wish to install and install them.You can do that by running the command: rpm --import public.gpg.key

Don't worry, you only need go to:
/usr/share/doc/centos-release-4
and simply do:
rpm --import RPM-GPG-KEY-centos4

Thursday, December 29, 2005

Gateway based Iptables

You only create this file named gateway.sh and put into /etc/rc.local
cat gateway.sh
#!/bin/bashecho 1 > /proc/sys/net/ipv4/ip_forward
iptables --flushiptables --table nat --flushiptables --delete-chainiptables --table nat --delete-chain
# Set up IP FORWARDing and Masqueradingiptables --table nat --append POSTROUTING --out-interface eth2 -j MASQUERADEiptables --append FORWARD --in-interface eth0 -j ACCEPT

Thursday, November 10, 2005

How use library flags in CPAN shell Installation

For example:

o conf makepl_arg
LIBS=-ldbinstall Compress::Zlib

Partition AdvFS in Tru64

For example, using an good BMT:

mkfdmn -t advfs -p 57600 -x 2048 /dev/rz10c data2_domain
addvol -p 57600 -x 2048 /dev/rz9c data2_domain
mkfset data2_domain data2
mkdir /data2
mount /data2
balance data2_domain

Add this line in fstab
data2_domain#data2 /data2 advfs rw 0 0

Array Disk Fixed

When the array disk is shutdownof bad way, the controller can't find the disks
These are the commands by fix the problem:
Login to console, and type the follow:

clear this invalid_cache nodestroy_unflushed_data
shutdown this_controller
#if the array disks can't shutdown, then execute:
show units full
#if the show: write-protect mode, or data-safety, inoperative, etc. Execute:
clear lost_data
#For our case is unit is d100 and d200
#then exec again the command. Finally execute shutdown
shutdown this_controller

Wednesday, October 26, 2005

Problem using Digital Raid Array HSZ70

Today, in the morning Marco solved our problem. Our array disk didn't work!!. The steps for recover are the following:

This controller has an invalid cache module
HSZ> dshp
%CER--HSZ> --13-JAN-1946 04:48:32 (time not set)-- Invalid cache -- CLI command-

set reduced. Type SHOW THIS_CONTROLLER. Please see user guide to determine-
corrective action
HSZ> dshp
^
Command syntax error at or near here
This controller has an invalid cache module
Invalid cache -- CLI command set reduced. Type SHOW THIS_CONTROLLER. Please-
see user guide to determine corrective action
HSZ> sho this
%CER--HSZ> --13-JAN-1946 04:48:36 (time not set)--

set reduced. Type SHOW THIS_CONTROLLER. Please see user guide to determine-
corrective action
HSZ> s
Controller:
HSZ70 ZG81915037 Firmware V70Z-0, Hardware H01
Not configured for dual-redundancy
Device Port SCSI address 7
Time: NOT SET
Host port:
SCSI target(s) (1, 2, 3, 4)
Preferred target(s) (1, 2, 3, 4)
TRANSFER_RATE_REQUESTED = 20MHZ
Host Functionality Mode = A
Command Console LUN is disabled
Cache:
128 megabyte write cache, vers
Cache is INVALID. Cache containing unflushed data
has been removed from this controller
Unknown unflushed data in cache
CACHE_FLUSH_TIMER = DEFAULT (10 seconds)
CACHE_UPS
Mirrored Cache:
Not enabled
This controller has an invalid cache module
Invalid cache -- CLI command set reduced. Type SHOW THIS_CONTROLLER. Please-
see user guide to determine corrective action
HSZ> clear this invalid_cache destroy_unflushed_data
%CER--HSZ> --13-JAN-1946 04:49:10 (time not set)

set reduced. Type SHOW THIS_CONTROLLER. Please see user guide to determine-
corrective action
HSZ> clear this invali
HSZ> sho this
Controller:
HSZ70 ZG81915037 Firmware V70Z-0, Hardware H01
Not configured for dual-redundancy
Device Port SCSI address 7
Time: NOT SET
Host port:
SCSI target(s) (1, 2, 3, 4)
Preferred target(s) (1, 2, 3, 4)
TRANSFER_RATE_REQUESTED = 20MHZ
Host Functionality Mode = A
Command Console LUN is disabled
Cache:
128 megabyte write cache, version 4
Cache is GOOD
No unflushed data in cache
CACHE_FLUSH_TIMER = DEFAULT (10 seconds)
CACHE_UPS
Mirrored Cache:
Not enabled
HSZ> sho unit
LUN Uses
--------------------------------------------------------------

D100 R1
D200 R2
HSZ> sho d100
LUN Uses
--------------------------------------------------------------

D100 R1
Switches:
RUN NOWRITE_PROTECT READ_CACHE
WRITEBACK_CACHE
MAXIMUM_CACHED_TRANSFER_SIZE = 1024
ACCESS_ID = ALL
State:
INOPERATIVE
Unit has lost data
PREFERRED_PATH = THIS_CONTROLLER
WRITE_PROTECT - DATA SAFETY
Size: NOT YET KNOWN
HSZ> clear lost_Data d100

%EVL--HSZ> --13-JAN-1946 04:51:11 (time not set)-- Instance Code: 026B0064
Template: 81.(51)
Power On Time: 3. Years, 262. Days, 0. Hours, 3. Minutes, 54. Seconds
Controller Model: HSZ70
Serial Number: ZG81915037 Hardware Version: H01(47)
Firmware Version: V70Z
Informational Report
Unit Number: 100.(0064)
Unit Software Version: 1.(01) Unit Hardware Version: 49.(31)
Retry Level: 1. Retries: 1.
Port: 255. Target: 255. LUN: 255.
SCSI Device Type: 0.(00)
Device ID: "" Device Serial Number: ""
Device Firmware Revision Level: ""
SCSI Command Opcode: 0.(00)
Sense Data Qualifiers: 0.(00)
SCSI Sense Data:
Error Code: 112.(70) {current command execution}
Information field is valid
Segment: 0.(00)
Sense Key: 6.(06) UNIT ATTENTION
ILI: 0 EOM: 0 FM: 0
Information: 00000000
Additional Sense Length: 0.(00)
Command-Specific Information: 00000000
ASC: 160.(A0) ASCQ: 7.(07)
FRU: 0.(00) Sense-Key Specific: 000000
Instance Code: 026B0064
HSZ> clear lost_Data d200

%EVL--HSZ> --13-JAN-1946 04:52:02 (time not set)-- Instance Code: 026B0064
Template: 81.(51)
Power On Time: 3. Years, 262. Days, 0. Hours, 4. Minutes, 45. Seconds
Controller Model: HSZ70
Serial Number: ZG81915037 Hardware Version: H01(47)
Firmware Version: V70Z
Informational Report
Unit Number: 200.(00C8)
Unit Software Version: 1.(01) Unit Hardware Version: 53.(35)
Retry Level: 1. Retries: 1.
Port: 255. Target: 255. LUN: 255.
SCSI Device Type: 0.(00)
Device ID: "" Device Serial Number: ""
Device Firmware Revision Level: ""
SCSI Command Opcode: 0.(00)
Sense Data Qualifiers: 0.(00)
SCSI Sense Data:
Error Code: 112.(70) {current command execution}
Information field is valid
Segment: 0.(00)
Sense Key: 6.(06) UNIT ATTENTION
ILI: 0 EOM: 0 FM: 0
Information: 00000000
Additional Sense Length: 0.(00)
Command-Specific Information: 00000000
ASC: 160.(A0) ASCQ: 7.(07)
FRU: 0.(00) Sense-Key Specific: 000000
Instance Code: 026B0064
HSZ> sho unit
LUN
--------------------------------------------------------------

D100 R1
D200 R2
HSZ> sho d100
LUN Uses
--------------------------------------------------------------

D100 R1
Switches:
RUN NOWRITE_PROTECT READ_CACHE
WRITEBACK_CACHE
MAXIMUM_CACHED_TRANSFER_SIZE = 1024
ACCESS_ID = ALL
State:
ONLINE to this controller
Not reserved
PREFERRED_PATH = THIS_CONTROLLER
Size: 214957065 blocks
HSZ> restart this

%LFL--HSZ> --13-JAN-1946 04:52:16 (time not set)-- Last Failure Code: 20080000
Power On Time: 3. Years, 262. Days, 0. Hours, 4. Minutes, 58. Seconds
Controller Model: HSZ70
Serial Number: ZG81915037 Hardware Version: H01(47)
Firmware Version: V70Z(70)
Informational Report
Instance Code: 0102030A
Last Failure Code: 20080000 (No Last Failure Pa

Additional information is available in Last Failure Entry: 2.

Copyright Digital Equipment Corporation 1993, 1997. All rights reserved.
HSZ70 Firmware version V70Z-0, Hardware version H01

Last fail code: 20080000

Press " ?" at any time for help.


HSZ>

%EVL--HSZ> --13-JAN-1946 04:32:44 (time not set)-- Instance Code: 0102030A (not
yet reported to host)
Template: 1.(01)
Power On Time: 3. Years, 262. Days, 0. Hours, 4. Minutes, 59. Seconds
Controller Model: HSZ70
Serial Number: ZG81915037 Hardware Version:
Firmware Version: V70Z(70)
Informational Report
Instance Code: 0102030A
Last Failure Code: 20080000 (No Last Failure Parameters)
HSZ> sho unit
LUN Uses
--------------------------------------------------------------

D100 R1
D200 R2
HSZ> sho d100
LUN Uses
--------------------------------------------------------------

D100
Switches:
RUN NOWRITE_PROTECT READ_CACHE
WRITEBACK_CACHE
MAXIMUM_CACHED_TRANSFER_SIZE = 1024
ACCESS_ID = ALL
State:
ONLINE to this controller
Not reserved
PREFERRED_PATH = THIS_CONTROLLER
Size: 214957065 blocks
HSZ> sho r1
Name Storageset Uses Used by
------------------------------------------------------------------------------

R1 raidset DISK10000 D100
DISK20000
DISK30000
DISK40000
Switches:
POLICY (for replacement) = BEST_PERFORMANCE
RECONSTRUCT (priority) = NORMAL
CHUNKSIZE = 256 blocks
State:
RECONSTRUCT 2% complete
DISK10000 (member 0) is RECONSTRUCTING 2% complete
DISK20000 (member 1) is RECONSTRUCTING 2% complete
DISK30000 (member 2) is RECONSTRUCTING 2% complete
DISK40000 (member 3) is RECONSTRUCTING 2% complete
Size: 214957065 blocks
HSZ>

Friday, August 19, 2005

Velocity Network Interface Card Setup in Digital Unix 4.0F

In Digital Unix v4.oF the NIC's can be setup in the ">>>" shell.

You should shutdown your server and fllow the next steps:
1. Show the NIC's avaliable
>>> show ew*
2. Enable the ethernet velocity to: 100 Full Duplex.
>>> set ewa0_mode FastFD
3. Or for auto mode:
>>> set ewa0_mode AutoNegotiate
4. Startup your server
>>> b (ENTER)

Excluding device files in a tar command

From man page of tar:

tar --exclude=/dev -cvf root.tar /

Yeah, it work.