Enabling VNC Server on MAC OS X Leopard

Recently I needed to troubleshoot some issues using a GUI web browser from an outside connection. This link shows how to enable vnc server on your mac using the command line. After doing that, and configuring port forwarding on my firewall I was all set.

Continue reading » · Rating: · Written on: 12-29-09 · No Comments »

Configuring A Cisco 2600 Series Router as a Terminal Server

I have a small lab I put together to help bash around new ideas, it consists of:

  • 2 Cisco 2611s
  • 2 Cisco 3500 XLs

Recently I’ve been jumping between devices using a single console cable… and that got old pretty quick.  I was able to pickup a NM-16A Async module which provides 16 more lines to my 2600.  To use this card I also needed a Cisco octal cable.

cisco-nm-async-16cab_oct_async

Steps:

1) After inserting the card and screwing in the octal cable you can verify that there is added line capacity:

Router_A#show version | i line
16 terminal line(s)

2) Before you proceed you will need to find out what line numbers your new NM-16A uses, in my case it was 33-48:

Router_A#show line
Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
* 0 CTY - - - - - 6 0 0/0 -
33 TTY 9600/9600 - - - - - 2 1 35/106 -
34 TTY 9600/9600 - - - - - 4 19 0/0 -
35 TTY 9600/9600 - - - - - 0 0 0/0 -
36 TTY 9600/9600 - - - - - 0 0 0/0 -
37 TTY 9600/9600 - - - - - 0 0 0/0 -
38 TTY 9600/9600 - - - - - 0 0 0/0 -
39 TTY 9600/9600 - - - - - 0 0 0/0 -
40 TTY 9600/9600 - - - - - 0 0 0/0 -
41 TTY 9600/9600 - - - - - 0 0 0/0 -
42 TTY 9600/9600 - - - - - 0 0 0/0 -
43 TTY 9600/9600 - - - - - 0 0 0/0 -
44 TTY 9600/9600 - - - - - 0 0 0/0 -
45 TTY 9600/9600 - - - - - 0 0 0/0 -
46 TTY 9600/9600 - - - - - 0 0 0/0 -
47 TTY 9600/9600 - - - - - 0 0 0/0 -
48 TTY 9600/9600 - - - - - 0 0 0/0 -
65 AUX 9600/9600 - - - - - 0 0 0/0 -

3) You need to create a loopback to be used to telnet to each of the lines:

interface Loopback0
ip address 126.0.0.1 255.255.255.255
no ip redirects
end

4) Next you need to configure the lines of this card with your preferred settings:

line 33 48
no flush-at-activation
transport preferred telnet
transport input all
stopbits 1
flowcontrol hardware

5) Finally, it’s nice to add ip hosts on the router for ease of use. Note that the tcp port number for our new lines are named with 20xx where “xx” is the actual line number. For example, our first line is “33″ so you need to connect to port “2033.” After this is done plug the rollover cable coming from the octal cable labeled “1″ into the console port of the device you want to manage. In my scenario, cable “1″ == line 33 == port 2033, cable “2″ == line 34 == port 2034, etc…


ip host r2 2033 126.0.0.1
ip host s1 2034 126.0.0.1

You should now have a console server in which you can “reverse” telnet into other devices connected through the octal cable.

You should be able to issue commands such as “telnet r2″ and be dropped into a console session.

To return to the router press “control + shift + 6 +x.”

To disconnect the session type “disconnect <connection number>” or “disconnect <hostname> .”

Here is the relevant configuration parameters:

ip host r2 2033 126.0.0.1
ip host s1 2034 126.0.0.1
interface Loopback0
ip address 126.0.0.1 255.255.255.255
no ip redirects
line 33 48
exec-timeout 0 0
no flush-at-activation
logging synchronous
no exec
notify
transport preferred telnet
transport input all
stopbits 1
flowcontrol hardware

A big thank you to Gerry Murray for initial guidance and introducing me to this.

Continue reading » · Rating: · Written on: 12-07-09 · No Comments »

New phone, New Development, New Instructions

I recently won a Motorola Droid phone in the “claw event” promotion held by Verizon.  That being said I wanted to take a stab at some development on it.  I was trying to use the SimpleCursorAdaptor method to bind results from sqlite to a listview.. and it just wasn’t happening.

To create the database I had a line like this:

private static final String DATABASE_CREATE =
             "create table decks (id integer primary key autoincrement, "
             + "name text not null);";

My application would throw an exception and I had no idea why until I wrote  a simple debug method.  It’s the equivalent of  “alert();” in javascript.

public void createAlert(String message){
      AlertDialog alertDialog = new AlertDialog.Builder(this).create();
      alertDialog.setTitle("Message");
      alertDialog.setMessage(message);
      alertDialog.setButton("OK", new DialogInterface.OnClickListener(){
      public void onClick(DialogInterface dialog, int which){
                    return; }
      });
      alertDialog.show();
}

I simply threw my code in a java try-catch and received the error: “column _id does not exist.”  Did you catch that?  I didn’t declare my column name with an underscore.

I guess it is always good to read the documentation.

Adapter that exposes data from a Cursor to a ListView widget. The Cursor must include a column named “_id” or this class will not work.

Now why would I post this lame crap? Because after googling the problem… it seems that a lot of beginners are running into this issue.

Continue reading » · Rating: · Written on: 12-01-09 · 1 Comment »