iamjerryyeung

Saturday, January 29, 2005

DB2:type4:driver

Listing 1 Use of the legacy/CLI JDBC driver (db2java.zip), a JDBC-type driver to interact with DB2import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Type2ExampleLegacy {
public static void main(String[] args)
{
try
{
// load the DB2 Driver
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
// establish a connection to DB2
Connection db2Conn =
DriverManager.getConnection
("jdbc:db2:phoneDB","db2admin","db2admin");
// use a statement to gather data from the database
Statement st = db2Conn.createStatement();
String myQuery = "SELECT * FROM PHONENUMBERS";
// execute the query
ResultSet resultSet = st.executeQuery(myQuery);
// cycle through the resulSet and display what was grabbed
while (resultSet.next())
{
String name = resultSet.getString("name");
String phoneNumber = resultSet.getString("phonenumber");
System.out.println("Name: " + name);
System.out.println("Phone Number: " + phoneNumber);
System.out.println("-------------------------------");
}
// clean up resources
resultSet.close();
st.close();
db2Conn.close();
}
catch (ClassNotFoundException cnfe)
{
cnfe.printStackTrace();
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
}
}

Sunday, January 23, 2005

fwsm

http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/mod_icn/fwsm/fwsm_2_3/fwsm_cfg/examples.htm

Saturday, January 22, 2005

accesslist

http://www.delmar.edu/Courses/ITSC1391/Sem3/6ACLs.htm

pix:firewall

CIS 373 – Network Design and Implementation
Assignment 11 – Firewall access control lists (ACLs)
Due by Friday, 19 Nov 2004 (but if you try and don’t do well, there will be a process for recovery).

You might find one or more of the following documents useful:

http://www.networkclue.com/routing/Firewalls/index.php
http://www.networkclue.com/routing/Firewalls/breakdown.php
http://www.networkclue.com/routing/Cisco/access-lists/index.php
http://www.networkclue.com/routing/Cisco/access-lists/editing.php
http://www.networkclue.com/routing/Cisco/access-lists/advanced.php
http://www.giac.org/practical/GSEC/Nancy_Navato_GSEC.pdf
http://www.enterastream.com/whitepapers/cisco/pix/pix-practical-guide.html
and perhaps
http://www.ja.net/CERT/JANET-CERT/prevention/cisco/cisco_acls.html
and also
http://www.delmar.edu/Courses/ITSC1391/Sem3/6ACLs.htm

http://www.humboldt.edu/~aeb3/cis373/f04/373Assignment11Fall04.doc

java:garbage collection

http://www-106.ibm.com/developerworks/ibm/library/i-gctroub/

Heapbase marks the base of the heap, while heaptop is the absolute maximum the heap can grow to. The difference, heaptop - heapbase, is decided by the command-line parameter -Xmx. This and other command-line parameters are documented in the developerWorks article on verbosegc and command-line parameters. The heaplimit pointer can go up, when the heap can expand, or down, as the heap shrinks. The heaplimit can never exceed heaptop, and can never go below the initial heap size specified using -Xms. The size of the heap at any time is heaplimit - heapbase.
The heap is expanded when the ratio of free heap to total heap falls below the value specified by -Xminf (minf is the minimum free). It gets shrunk if the ratio of free heap to total heap exceeds the value specified by -Xmaxf (maxf is the maximum free). The defaults for -Xminf and -Xmaxf are 0.3 and 0.6, respectively, so the JVM tries to maintain a heap that is between 30 and 60 percent free at all times. The parameters -Xmine (mine is the minimum expansion size) and -Xmaxe (maxe is the maximum expansion size) control the amount of expansion of the heap. These four parameters have no effect on fixed-size heaps (JVM started with -Xms value equal to -Xmx value, implying HeapLimit = HeapTop), because fixed-size heaps do not expand or shrink.
When a Java thread makes a request for a piece of storage, and the JVM is unable to locate a large enough chunk of storage to satisfy the request, an allocation failure (AF) is said to have occurred. This is when garbage collection becomes unavoidable. Garbage collection involves collecting all the "unreachable" references so that the space consumed by them can be reused. It is carried out by the thread that makes an allocation request, and is a Stop-The-World (STW) mechanism; all other threads of the Java application are suspended while garbage collection is going on (except the garbage collection helper threads).
IBM implementation uses a garbage collection algorithm called mark-sweep-compact (MSC), which is named after three distinct phases.

pix:firewall:flow

http://www.enterastream.com/whitepapers/cisco/pix/pix-practical-guide.html
1. A packet is entering an interface and PIX evaluates the security level for the source and destination interfaces. A low-to-high is allowed only if there is an access-list/conduit that allows the connection and a high-to-low is allowed by default unless a specific access-list/outbound denies it.
2. The packet enters is checked against the statefull session table. If it is part of an already established flow is passed forward in order to be routed out and eventually translated if specified. If the packet is identified as part of a new session it is checked against the access-list applied to the inbound interface (or against the conduits for versions earlier than 6.3)
3. As the packet passed the inbound security check is passed to ASA that performs the inbound network translation (destination NAT).
4. ASA creates an entry in the statefull session table and the timers are started for that session. The packet gets routed out to the interface designated by the routing table.
5. At the exit interface eventual source translation is performed - if specified by using global statements and nat groups
6. The packet is delivered out to the next hop router or to the final destination if it is present in the local firewall’s subnets.

PIX-OS later than 5.3
Access lists are the newly recommended security enforcement mechanism.An access list is applied to an interface and checks all traffic with no difference between the direction of traffic as outbound (high-to-low security) and inbound (low-to-high security).
Access lists are statefull and are part of the ASA engine.
The access list is applied only when a packet enters the firewall through an interface.
No checking is performed when it exits the firewall using the destination interface.
The flow is defined only once in the access-list that applies for the interface where the flow enters the firewall.
We can make a comparison with Checkpoint FW1/NG which has the option to check a flow when it enters and also when it exits the firewall. This increases the security but downgrades the processing speed.
Some of the features of ACLs in the new PIX-OS ver 6.3 and later:
1. Accept comments (remarks) so that each statement that is part of an ACL can be commented for a more readable security policy (essential feature for a firewall administrator that was missing in the previous PIX versions)
2. Statements are numbered permitting insertion of new statements at any desired position.
3. Accepts TCP/UDP port ranges.
4. Introduces the use of groups of objects for an easier management.
The ACL statements are checked in a sequential order exactly as they have been defined.
All hits that qualify for a specific statement are logged. In order to log all dropped traffic visibly specify the implied #deny ip any any statement at the end of the ACL.
An ACL becomes active and assigned to an interface when it is associated with it using access groups.
The matching policy is the first pattern match is chosen to drop or allow the data flow. For improved performance define the most used statements first.

Important: for security reasons PIX does not use the native VLAN. When define the VLAN interfaces do not use the native VLAN. PIX treats the trunk link a little bit differently than a regular router that performs trunking. It just does the tagging/de-tagging operation.
Configuration summary:

On the physical interface define the VLAN as logical interfaces.
At least one VLAN has to be defined as physical in order to instruct PIX to perform tagging on the physical interface. The other VLANs are defines as logical interfaces


1. As observed in the above example, PIX architecture requires individual static statements for each pair of interfaces in order allow access to that translated IP. The static statement is essential in “publishing” the local host to that specific interface and making it accessible through that interface.
2. It is mandatory to define a “transparent” static translation when you access any host from a lower security interface to higher security interface. The static translation could be called transparent because there is no real address translation; it is only an IP address publishing in order to allow the access.
Example:
In order to access the server 10.0.0.100 situated behind the inside interface from the dmz02 interface you have to define a “transparent” static translation as follows:
#static(inside,dmz02) 10.0.0.100 10.0.0.100 netmask 255.255.255.255
You can observe that the global and local IPs is one and the same and no real translation is done. This is mandatory and is part of PIX’s specific architecture. It brings an additional level of security by the fact that even you might have the access lists/conduits to allow the access, it will not work unless you specifically designate which host(s) are published for access.
This transparent static is required only for inbound transactions from a lower security to a higher security interface. No specific statics are required when you access from a higher security to a lower security interface, unless you want to do explicit source address translation.

cisco:access-list

http://www.giac.org/practical/Tamara_Bowman_GCFW.doc

Access Lists – Basics
Cisco access lists are order dependent. The router will start with the first rule and compare the packet with each rule until it reaches a match. Once the match is reached the packet is processed according to that rule. Put more specific rules before general rules. Such as, rules for specific hosts prior to rules for networks and rules for networks prior to rules for all hosts. One of the most common mistakes in an access list is incorrect placement of the access rule so that it is never matched. A quick way to see if a rule in the access list is being matched is to enter the command “show access-list” at the enable prompt of the router. The number following each statement is the number of times the rule has been matched.

Friday, January 21, 2005

database:version:mysql

15.13 Implementation of Multi-Versioning
Because InnoDB is a multi-versioned database, it must keep information about old versions of rows in the tablespace. This information is stored in a data structure called a rollback segment after an analogous data structure in Oracle.
Internally, InnoDB adds two fields to each row stored in the database. A 6-byte field indicates the transaction identifier for the last transaction that inserted or updated the row. Also, a deletion is treated internally as an update where a special bit in the row is set to mark it as deleted. Each row also contains a 7-byte field called the roll pointer. The roll pointer points to an undo log record written to the rollback segment. If the row was updated, the undo log record contains the information necessary to rebuild the content of the row before it was updated.
InnoDB uses the information in the rollback segment to perform the undo operations needed in a transaction rollback. It also uses the information to build earlier versions of a row for a consistent read.

http://www.sourcekeg.co.uk/www.mysql.com/doc/mysql/en/InnoDB_Multi-Versioning.html

Tuesday, January 18, 2005

radius:microsoft

http://www.giac.org/practical/GCWN/Damon_Martin.pdf

Sunday, January 16, 2005

university:network processor

http://www.cs.ucr.edu/~bhuyan/CS260/LECTURE1.ppt

Thursday, January 13, 2005

cim policy

http://www.faqs.org/rfcs/rfc3060.html

Sunday, January 09, 2005

BPDU mac address

http://www.cisco.com/warp/public/473/127.html

when BPDU for STP (spanning tree protocol) is used,
the source mac address is the port mac address assigned by
cat 6k.

CatOS command: show port mac-address 2/7
IOS command: show interface fastEthernet 4/1

The reason of having diff mac address for each port for BPDU
is to detect any problem on the etherchannel where multi
ports are grouped into a channel and treated as a single port
in STP.

device configuration CIM

http://www.tml.hut.fi/~tpv/opiskelijat/kanninen.pdf

Friday, January 07, 2005

mac address for cat 6k

http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a00801c9b4e.shtml#topic1

BIA (Burn-in-address) is used for all the interfaces of cat 6k.
User cannot have different mac address for each L3 interface.
Cat 6k allows user to change the mac address under an interface vlan x,
once it is changed, all the interfaces will pick up the new mac address.

Show module will also display the range of mac address assigned to the ports
of the module. The address is used for Layer 2 (BPDU bridge/spanning tree).
The interface must be configured as "switch port"

mac address for cat 6k

http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a00801c9b4e.shtml#topic1

CIMOM SNIA

Doc: SNIA CIM Object Manager
Architecture and Developers Guide
from sun

mac address to port mapping

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801c9199.shtml