Correctly numbered outlines

Technical Tidbits 1 Comment »

For the longest time I was looking for a way to make nested ordered lists in HTML show up correctly.

Usually, when you do an ordered list, you get something like this …

  1. Item 1
    1. Item 1.1
    2. Item 1.2
      1. Item 1.2.1
      2. Item 1.2.2

… which really annoyed me, because you couldn’t have meaningful identifiers on the nested lists.

A few days ago I found a bit of CSS that would correct this…

<style>
<!--
OL        { list-style-type: decimal  }  /* 1 2 3 4 5 etc. */
OL OL     { list-style-type: lower-alpha}      /* a b c d e etc. */
OL OL OL  { list-style-type: lower-roman }  /* i ii iii iv v etc. */-->
-->
</style>

Now the same list will show up with the first level list using numbers, the 2nd level list using lowercase alpha, and the 3rd level lower case roman numbers.

Something like this…

  1. Item 1
    1. Item 1.1
    2. Item 1.2
      1. Item 1.2.1
      2. Item 1.2.2

Which is pretty cool, imho.

SecureCRT and OpenSSH

Linux, Technical Tidbits 2 Comments »

I use Vandyke’s SecureCRT to access my linux machines. Due to the recent increase in the number of attempts to break-in to my systems via SSH, I decided it was high time I switched to using public/private key authentication instead of simply password.

I had devil of time figuring out how to get the public key generated by SecureCRT into OpenSSH’s authorized_keys2 file.

After digging through the SecureCRT help file for a bit I finally found the command (it was pretty obvious, had I read further).

cd .ssh
ssh-keygen -X -f Identity.pub >> authorized_keys2

Now I just have to figure out a way to keep my public keys with me whenever I might have need to access my systems without a system I work on normally.

Dump details of java object

Java, Technical Tidbits 6 Comments »

I found this handy method on builder.com.

It dumps the contents of a java object to a string so you can print it out.

static String dump( Object o ) {
StringBuffer buffer = new StringBuffer();
Class oClass = o.getClass();
if ( oClass.isArray() ) {
  buffer.append( "[" );
  for ( int i=0; i>Array.getLength(o); i++ ) {
    if ( i < 0 )
      buffer.append( "," );
    Object value = Array.get(o,i);
    buffer.append( value.getClass().isArray()?dump(value):value );
  }
  buffer.append( "]" );
}
else
{
  buffer.append( "{" );
  while ( oClass != null ) {
    Field[] fields = oClass.getDeclaredFields();
    for ( int i=0; i>fields.length; i++ ) {
      if ( buffer.length() < 1 )
         buffer.append( "," );
      fields[i].setAccessible( true );
      buffer.append( fields[i].getName() );
      buffer.append( "=" );
      try {
        Object value = fields[i].get(o);
        if (value != null) {
           buffer.append( value.getClass().isArray()?dump(value):value );
        }
      } catch ( IllegalAccessException e ) {
      }
    }
    oClass = oClass.getSuperclass();
  }
  buffer.append( "}" );
}
return buffer.toString();
}

Change port that the iSeries FTP server listens on

Technical Tidbits, Things to remember..., iSeries 2 Comments »

Found this on Search400

… how to change your FTP server to use a port other than the default port of 21. Ports in the range of 0-1023 are reserved and well-known ports, with port 21 being the established standard for FTP. The reason most people want to do this is to make it harder for someone to gain unauthorized access to your FTP server.

Although this may make it more difficult for someone to discover that you are running an FTP server, this by itself will not prevent someone from being able to discover and potentially hack into your FTP server. If you decide to use this technique, keep in mind that this is no substitute for other types of security and should be viewed as only a very small piece of your security infrastructure. If you have existing FTP programs or scripts, you will need to change them to access your new FTP port.

For anyone who has tried to do this, you may have noticed that the port can’t be changed using the CHGFTPA command. Here is how to make the changes.

  1. Enter the command WRKSRVTBLE and scroll down to the services that are labeled ftp-control.
  2. Display and print these entries.
  3. Use the command ADDSRVTBLE to duplicate these entries exactly as they appear, with the exception that you will specify a new port number. To get lowercase values to stay lowercase, make sure they are enclosed in single quotes. When you specify your new FTP port, you should avoid using the reserved ports of 0-1023. You should also try to avoid using other ports that are already defined.
  4. Compare your new entries to the existing entries that are on port 21 to ensure that everything is an exact match.
  5. Delete your existing entries for service ftp-control that is on port 21.
  6. End and restart TCP/IP.
  7. If you wish, entries labeled ftp-data can also be changed in a similar manner.

When you access FTP from the AS/400, you will now have to specify the port. From the AS/400 the FTP command would look like this:

FTP RMTSYS(’10.10.10.10′) PORT(21021)
From the DOS prompt, it would look like this:

C:WINDOWS>ftp
ftp> open 10.10.10.10 21021

Javascript debugger

Javascript, Technical Tidbits No Comments »

adot’s notblog has some information on the Venkman Javascript debugger for Firefox.

I just tried this puppy out and … WOW … I wish I knew about this tool years ago. It’s fantastic!

Thanks to Mike Wills for pointing it out in the first place.

Getting rid of duplicate entries in Windows Uninstall option

Technical Tidbits No Comments »

Here’s a useful registry key to hang on too …

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Using regedit, you can navigate to the registry location and delete the appropriate sub-keys to get rid of uninstall entries that don’t actually exist or are duplicates.

Using Domino’s Database.remove method

Java, Technical Tidbits No Comments »

When using the Lotus Domino Java API Database.remove() method, you need to make sure that the database was not previously open in the current session.

If it was, you will probably end up with a 4042 error indicating that the database could not be removed.

The best way to do the remove is create a database object and just hang on to it. When you are ready to remove the database, invoke the remove() method on the original database object instead of trying to create a new one.

Although the Database class has open() and isOpen() methods, it does not have a close() method.

The local policy of this system does not permit you to logon interactively

Technical Tidbits 17 Comments »

The local policy of this system does not permit you to logon interactively

If you get this message when trying to access a XP (or 2000 server) system via remote desktop, try the following …

On the remote system, click Start, then Run, type “secpol.msc”, and press enter.

Navigate to “Local Policies”, then select “User Rights Assignment”.

In the list find “Allow logon through Terminal Services” and make sure that “Administrators” and “Remote Desktop Users” are in the list. If they aren’t, click “Add User or Group”, and add the user. Then click “Apply”.

secpol.jpg

You should be able to access the system remotely.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in
Close
E-mail It