Unpublished Source Code

Recently while stumbling my way through Solaris I came across a command I’m not familiar with. /usr/bin/true is a shell script which when run will return true (execute successfully.)

Now, this code clearly goes back a bit into UNIX history and I was amused to see exactly how the developers coded it. With that in mind, and against all copyrights and rights reservations I now present the complete and unabridged code for /usr/bin/true:

bash-2.03$ more /usr/bin/true
#!/usr/bin/sh
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved

# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
# The copyright notice above does not evidence any
# actual or intended publication of such source code.

#ident "@(#)true.sh 1.6 93/01/11 SMI" /* SVr4.0 1.4 */

Why on earth would you copyright this? Perhaps even more impressive is the point that this is version 1.6! What did previous versions of this look like? And why such a big deal about this being unpublished source code? Hell, it’s not even source code, let alone published.

Well, if you’re curious, this script is all comments, therefore when it is run it does nothing… Of course it does nothing quite successfully, therefore returning ‘true’ for the purposes of evaluating conditions.

I do have to give the developers of this credit for simplicity. I’m sure if it weren’t for the lawyers this could have been a one line file.

unix, solaris, source code, programming, development, opensource

Changing Video Settings on SunBlade 100

To change the display resolution or refresh rate on a SunBlade 100 or similar Sun hardware isn’t as easy as it sounds. Or at least it’s not obvious. These directions are for an M64 type graphics accelerator. The steps are similar for other Sun graphics accelerators, but the command will be different (maybe ffbconfig). Check your hardware documentation for details.

These coommands should be run as root. I recommend running these commands via ssh from another system. If you accidentally change the resolution to something that is not supported you won’t be able to see so well to change it back.

To change video settings you’ll first want to find out what the card and display are capable of.

m64config -res ?

This will print the resolution and refresh rate options you have. Where three numbers are listed this represents the horizontal and vertical resolution and refresh rate respectively.

The current configuration will be shown with a [3] next to it. Write down the current resolution and refresh rate. There are a lot to choose from and you’ll want to know you can get back to one that works.

Configurations marked with a [2] are not supported by the video card and will probably not work.

To change the settings run this command with the desired resolution/refresh rate. The now forces the system to change these settings immediately rather than at next refresh.

m64config -res 1024x768x75 now

Your monitor should click and flicker and with luck will then come back at the new resolution. If it doesn’t you can change it back to the old settings by running the m64config command with the orignal settings. You did write the old setting down like I told you to right?

solaris, sun, unix, system administration, sysadmin

Getting Hardware Information in Solaris

Here’s a quick way to find out what hardware is installed in your Solaris system, including RAM, CPUs, PCI cards, and external devices. The output will usually include the size of each memory chip in the system.

The one trick to using this command is to make sure you use the backtick instead of a single quote around the uname -i. The backtick is typically shift tilde and forces the command between the backticks to be executed and substituted in to that part of the command.

/usr/platform/`uname -i`/sbin/prtdiag

prtdiag actually displays system diagnostic information. I’ve used this on Solaris 7 through 10. The best parts is you do not even need to be root to execute this.

For more info on prtdiag check out the man page.

solaris, sun, unix, system administration, sysadmin

Oracle Prefers Solaris 10

It looks like Oracle is re-aligning themselves with Sun Solaris as their preferred 64-bit platform. In the March issue of Oracle Magazine they have a short announcement on the topic:

Oracle has chosen the Solaris 10, Sun Microsystems’ multiplatform, open source operating system, as its preferred development and deployment platform for most 64-bit architectures. Solaris 10 will be used throughout Oracle’s development organization, and Oracle will release and ship 64-bit versions of all Oracle products on Solaris prior to, or simultaneously with, release on other operating systems.

Check out the whole article here or sign up to get your free copy of Oracle Magazine.

Thanks to Jon G. for sending this on to me.

oracle, database, database administration, dba, systems administration, sysadmin, solaris, sun, sun microsystems, UNIX, open source, 64-bit

EditPlus for SQL Editing and More

EditPlus in actionWhile there are many text editors out there offering a broad set of features my favorite right now is EditPlus.

EditPlus is a Windows shareware application designed for text, HTML, Java, PHP, etc. It’s very thin requiring little (nearly no) load time and has many great features such as:

  • Syntax hilighting for many languages
  • EditPlus on Windows right-click
  • FTP and SFTP integration
  • Templates
  • Line Numbering
  • Column Selection
  • Optional Spell Checker

The list of features is long and every revision brings more. Check out the Features page for more.

I’ve been using the Oracle 9iR2 syntax file from the user files section of EditPlus.com and it seems to pick up all the SQL and PL/SQL syntax I use, although many other syntax files exist and you could always make your own.

As mentioned above, EditPlus is shareware. A single user license is only $30, and with discounts for buying in bulk there is no reason not to pay, but for now, download it, try it, and see why you can’t live without it.

Thanks to Zach for showing this to me a couple years ago.

text, text editing, editing, editor, edit, sql, plsql, pl/sql, sftp, ftp, notepad, wordpad, oracle, unix, php, perl, programming, database programming, dba, database administration, systems administration, c, c++, java, javascript, css, html