If you are trying to configure and unconfigure LUNs on a Solaris host, you may be suprised to find that the default ‘cfgadm -al’ output doesn’t display the LUNs on your system. To view the LUNs on a Solaris host, you need to use cfgadm’s show_SCSI_LUN option:

$ cfgadm -al -o show_SCSI_LUN

Ap_Id                          Type         Receptacle   Occupant     Condition
c3                             fc-fabric    connected    configured   unknown
c3::50060161082006e2,0         disk         connected    configured   unknown
c3::50060161082006e2,1         disk         connected    configured   unknown
c3::50060161082006e2,2         disk         connected    configured   unknown
c3::50060161082006e2,3         disk         connected    configured   unknown
c3::50060161082006e2,5         disk         connected    configured   unknown
c3::50060169082006e2,0         disk         connected    configured   unknown
c3::50060169082006e2,1         disk         connected    configured   unknown
c3::50060169082006e2,2         disk         connected    configured   unknown
c3::50060169082006e2,3         disk         connected    configured   unknown
c3::50060169082006e2,5         disk         connected    configured   unknown
c4                             fc-fabric    connected    configured   unknown
c4::50060160082006e2,0         disk         connected    configured   unknown
c4::50060160082006e2,1         disk         connected    configured   unknown
c4::50060160082006e2,2         disk         connected    configured   unknown
c4::50060160082006e2,3         disk         connected    configured   unknown
c4::50060160082006e2,5         disk         connected    configured   unknown
c4::50060168082006e2,0         disk         connected    configured   unknown
c4::50060168082006e2,1         disk         connected    configured   unknown
c4::50060168082006e2,2         disk         connected    configured   unknown
c4::50060168082006e2,3         disk         connected    configured   unknown
c4::50060168082006e2,5         disk         connected    configured   unknown

Posted by matty, filed under Solaris Utilities. Date: May 30, 2006, 10:39 am | 3 Comments »

If you have ever had a moment when you couldn’t recall a word from memory, but knew something about the word, you probably wandered to one of the numerous online dictionaries to find the name. If you happen to have a Solaris box handy, you can avoid the web and use the look utility to find the word. Look is run with a string that you want to match to a word, and it uses the word list in /usr/share/lib/dict/words during the comparison. The following examples show this nifty utility in action:

$ look liti
litigant
litigate
litigious

$ look oth
Othello
other
otherwise
otherworld
otherworldly

Posted by matty, filed under Solaris Utilities. Date: May 28, 2006, 11:56 pm | No Comments »

I have been spending a bit of my time reading up on VOIP protocols. While searching the ‘net for good SIP/RTP/RTCP documentation, I came across the following nifty SIP tutorial:

http://www.geocities.com/intro_to_multimedia/SIP/index.html

This tutorial is extremely well written, and definitely one of the best I have found so far!

Posted by matty, filed under Links. Date: May 28, 2006, 2:32 pm | No Comments »

This is a nifty write up on AMD Opteron frequency scaling and the issues associated with TSC drift:

http://lkml.org/lkml/2005/11/4/173

Posted by matty, filed under Hardware. Date: May 28, 2006, 2:26 pm | No Comments »

Internet advertising has become big business, and we see the effects of it in almost every page we view. The ad content typically comes from one or more well known ad servers, and some folks have come up with some clever ways (e.g., hosts files, DNS integration, etc.) to minimize the “ad effect” in the content we view. I have been using Mike’s host file for quiet some time, but for some reason OS X (actually lookupd) doesn’t handle large hosts files real well. Since OS X would get bogged down during DNS resolution, I decided to merge all of the ad domains into DNS to centrally fix the problem for the clients I support.

This was super easy to do, and only required two steps (assuming you are already running bind). The first step is to add one “zone” statement to named.conf for each ad domain you want to nix. The following example shows the named.conf entry you would add for the ad domain adservers.com:

zone "adservers.com"
{
       type master; notify no; file "master/null.zone";
};

You can get a comprehensive list of the well known ad server domains from the ad blocking website. Once you retrieve the list, you can merge the domains into the named.conf using a combination of shell utilities, or you can download the Perl script (updateads.pl) I wrote to automate this process. The Perl script grabs the latest host file from the ad blocking website, formats the data, and spits out several lines that can be appended to named.conf:

$ updateads.pl |more

// *** Added domains on Thu May 25 13:53:34 2006 *** //

zone "ad1.com" { type master; notify no; file "master/null.zone"; };
zone "ad2.com" { type master; notify no; file "master/null.zone"; };
zone "ad3.com" { type master; notify no; file "master/null.zone"; };
[ ..... ]

Once you add all of the domains to named.conf, you need to create a zone file with one wildcard A record (this record is what is used to remove the ad servers, since the wildcard record will translate all entries in a given domain to 127.0.0.1). I am currently using the following zone file (with different domain names) to implement my ad blocking solution:

; File: null.zone
; Last modified: 07-10-2005

$TTL    86400   ; one day

@       IN      SOA     ns.mydomain.com      hostmaster.mydomain.com. (
                        2005071005       ; serial number YYYYMMDDNN
                        28800   ; refresh  8 hours
                        7200    ; retry    2 hours
                        864000  ; expire  10 days
                        86400 ) ; min ttl  1 day
                NS      ns.mydomain.com.

                A       127.0.0.1

*               IN      A       127.0.0.1

I have found that using this technique speeds up the time it takes to render a page, enhances privacy, and will also cut down on the amount of traffic consumed by your site. Tis good stuff!

Posted by matty, filed under DNS & BIND. Date: May 27, 2006, 3:01 pm | 5 Comments »

Periodically I find that I need to split a file into several pieces. There are a number of utilities that can be used to split a file, but I have grown to adore csplit. Csplit can split files based on regular expressions, or by quantity. The following example uses csplit to split /etc/services into a series of 10-line files:

$ csplit -f services.bak.00 /etc/services 10 {10}

172
208
225
372
408
188
450
392
256
325
434
521

$ ls -la service*

-rw-r--r--   1 root     root         172 May 24 12:36 services.bak.0000
-rw-r--r--   1 root     root         208 May 24 12:36 services.bak.0001
-rw-r--r--   1 root     root         225 May 24 12:36 services.bak.0002
-rw-r--r--   1 root     root         372 May 24 12:36 services.bak.0003
-rw-r--r--   1 root     root         408 May 24 12:36 services.bak.0004
-rw-r--r--   1 root     root         188 May 24 12:36 services.bak.0005
-rw-r--r--   1 root     root         450 May 24 12:36 services.bak.0006
-rw-r--r--   1 root     root         392 May 24 12:36 services.bak.0007
-rw-r--r--   1 root     root         256 May 24 12:36 services.bak.0008
-rw-r--r--   1 root     root         325 May 24 12:36 services.bak.0009
-rw-r--r--   1 root     root         434 May 24 12:36 services.bak.0010
-rw-r--r--   1 root     root         521 May 24 12:36 services.bak.0011

Tis good stuff!

Posted by matty, filed under Solaris Utilities. Date: May 24, 2006, 9:22 pm | No Comments »

This link will tell you.

Posted by matty, filed under Apple. Date: May 24, 2006, 7:06 pm | No Comments »

I found myself needing to partition a LUN on one of the Windows servers I support, and was curious how to perform this operation from a shell prompt. After a bit of googling, I came across the diskpart utility. This nifty little utility allows you to view devices, create and destroy volumes, and modify partition tables. The syntax for the commands available to diskpart can be viewed by running the “help” subcommand:

C:\Bin>diskpart

DISKPART> help

Microsoft DiskPart version 5.1.3565

ADD         - Add a mirror to a simple volume.
ACTIVE      - Marks the current basic partition as an active boot partition.
ASSIGN      - Assign a drive letter or mount point to the selected volume.
BREAK       - Break a mirror set.
CLEAN       - Clear the configuration information, or all information, off the
              disk.
CONVERT     - Converts between different disk formats.
CREATE      - Create a volume or partition.
DELETE      - Delete an object.
DETAIL      - Provide details about an object.
EXIT        - Exit DiskPart
EXTEND      - Extend a volume.
HELP        - Prints a list of commands.
IMPORT      - Imports a disk group.
LIST        - Prints out a list of objects.
INACTIVE    - Marks the current basic partition as an inactive partition.
ONLINE      - Online a disk that is currently marked as offline.
REM         - Does nothing. Used to comment scripts.
REMOVE      - Remove a drive letter or mount point assignment.
REPAIR      - Repair a RAID-5 volume.
RESCAN      - Rescan the computer looking for disks and volumes.
RETAIN      - Place a retainer partition under a simple volume.
SELECT      - Move the focus to an object.

To view the physical devices connected to a system, you can use the diskpart “list disk” subcommand:

C:\Bin>diskpart

DISKPART> list disk

  Disk ###  Status      Size     Free     Dyn  Gpt
  ——–  ———-  ——-  ——-  —  —
  Disk 0    Online        28 GB      0 B

To view a device’s partition table, you can select a disk and run the “list partition” subcommand:

C:\Bin>diskpart

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  ————-  —————-  ——-  ——-
  Partition 1    Primary             28 GB    32 KB

You can also list the volumes available to the system with the “list volume” subcommand:

C:\Bin>diskpart

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       CD-ROM          0 B
  Volume 1     C                NTFS   Partition     28 GB  Healthy    System

Windows has some awesome utilities buried in the Windows folder, and the new shell should make automating tasks on Windows platforms a TON easier. Shibby!

Posted by matty, filed under Uncategorized. Date: May 23, 2006, 8:20 pm | No Comments »

« Previous Entries