IPNLINUX COMMUNITY VERSION 2 http://www.ipnlinux.org/ IPNLINUX COMMUNITY VERSION 2 (c) 2009 www.ipnlinux.org Fri, 06 Aug 2010 16:30:00 -0500 http://www.textmotion.org MATERIAL PARA EL CURSO DE PROGRAMACIÓN DE MAQUINAS PARALELAS http://www.ipnlinux.org/?module=blog&action=view&id=16&title=material-para-el-curso-de-programacion-de-maquinas-paralelas http://www.ipnlinux.org/?module=blog&action=view&id=16&title=material-para-el-curso-de-programacion-de-maquinas-paralelas <!--begin photo--><div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/palabras.txt"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a> <span class="photo-description">base de datos para ordenar o procesar</span> </div><!--end photo--> jaalvarez@ipn.mx (unknown) Fri, 06 Aug 2010 16:30:00 -0500 GETTING THE IP, MAC AND NAME OF A LAN DEVICES http://www.ipnlinux.org/?module=blog&action=view&id=15&title=getting-the-ip-mac-and-name-of-a-lan-devices http://www.ipnlinux.org/?module=blog&action=view&id=15&title=getting-the-ip-mac-and-name-of-a-lan-devices <p><meta> <title></title> <meta name="GENERATOR" content="OpenOffice.org 3.2 (Linux)"> <style type="text/css"> <!-- @page { margin: 2cm } @page:first { size: 21cm 29.7cm; margin-left: 4.4cm; margin-right: 4.4cm; margin-top: 2cm; margin-bottom: 4cm } P { margin-bottom: 0.21cm } --> </style> <p style="margin-bottom: 0cm"><font size="3"></font></p><p style="text-align: center"><span>undefined<font size="3"></p> <p></font> undefined undefined<sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> I.S.C. Juan Alberto Antonio Velázquez </span> undefined undefined<sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX">Alanís García Teresa, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX">Cruz Cruz Laura, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Martínez Solano Cristhian, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Montoya García Oscar, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Sánchez Ávila José Carlos, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Yessenia Sánchez Torres, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Serrano Avelino Pascual Jesús, </span><sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Pérez Alva Iliana, </span> undefined undefined</p> <p>undefined undefined<sup><font style="font-size: 5pt" size="1"><span lang="es-MX">1</span></font></sup><span lang="es-MX"> Tecnológico de Estudios Superiores de Jocotitlán </span> undefined undefined<span lang="es-MX">Carretera Toluca-Atlacomulco, km. 44.8 Ejido de San Juan y San Agustín CP. 50700, Jocotitlán México</span></span></p><p style="margin-bottom: 0cm"><span lang="es-MX"> </span></p> <p style="margin-bottom: 0cm" lang="es-MX"></p> <p></p> <p style="margin-bottom: 0cm" lang="es-MX"></p> <p></p> <p style="margin-left: 0.5cm; margin-right: 0.44cm; text-indent: 0.4cm; margin-bottom: 0cm" lang="es-MX"></p> <p></p> <p style="margin-left: 0.5cm; margin-right: 0.44cm; text-indent: 0.4cm; margin-bottom: 0cm"> <font style="font-size: 11pt" size="2"><b>Abstract</b></font><font style="font-size: 11pt" size="2">. The MAC, IP address and network name are network Ids, which allow proper communication of computers in a network. The IP address identifies a logical and hierarchical, to an interface of a device within a network using IP protocol. The MAC (Media Access Control) is a 48-bit identifier that uniquely corresponds to an Ethernet network, also known as the physical address. This project describes how to obtain these addresses and the names of network devices, also are described the state of the TCP, ICMP and UDP protocols of the computer where is running the application. </font></p> <p style="margin-left: 0.5cm; margin-right: 0.44cm; text-indent: 0.4cm; margin-bottom: 0cm"></p> <p></p> <p style="margin-left: 0.5cm; margin-right: 0.44cm; text-indent: 0.4cm; margin-bottom: 0cm"> <font style="font-size: 11pt" size="2"><span lang="es-MX"><b>Resumen.</b></span></font><font style="font-size: 11pt" size="2"><span lang="es-MX"> La dirección MAC, dirección IP y el nombre de red son identificadores de red, que permiten la comunicación correcta de las computadoras en una red. La dirección IP identifica, de manera lógica y jerárquica, a una interfaz de un dispositivo dentro de una red que utilice el protocolo IP. La dirección MAC (control de acceso al medio) es un identificador de 48 bits que corresponde de forma única a una Ethernet de red, conocida también como la dirección física. En este proyecto se describe como obtener estas direcciones así como el nombre de los dispositivos de red, también se describen el estado de los protocolos TCP, ICMP y UDP del ordenar donde se ejecuta la aplicación.</span></font></p> <p style="margin-bottom: 0cm"></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm" lang="es-MX" align="CENTER"></p> <p></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm" align="CENTER"></p> <p></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm" align="CENTER"><b>INTRODUCTION</b></p> <p style="margin-bottom: 0cm"><b>This article talks about how get the address MAC and the IP (Internet protocol) of LAN devices, it shows too the hostname of every one of the devices.</b></p> <p style="margin-bottom: 0cm"><font size="3">This small application tries to capture the status of some network protocols, like IP, TCP, ICMP and UDP. </font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font size="3">The program was developed using some commands which are nast and netstat and implemented in java. These commands provide us the necessary information to obtain the requirements which we describe in this article. </font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm"><b>MAC ADDRESS </b></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>The MAC address is a unique value associated with a network adapter. MAC addresses are also known as hardware addresses or physical addresses. They uniquely identify an adapter on a LAN. </b></font></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>MAC addresses are 12-digit hexadecimal numbers (48 bits in length). By convention, MAC addresses are usually written in one of the following two formats:</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm" align="CENTER"><font style="font-size: 11pt" size="2"><b>MM:MM:MM:SS:SS:SS</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>The first half of a MAC address contains the ID number of the adapter manufacturer. These IDs are regulated by an Internet standards body (see sidebar). The second half of a MAC address represents the serial number assigned to the adapter by the manufacturer. In the example:</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm" align="CENTER"><font style="font-size: 11pt" size="2"><b>00:A0:C9:14:C8:29</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>The prefix 00A0C9 indicates the manufacturer is Intel Corporation.</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>Whereas MAC addressing works at the data link layer, IP addressing functions at the network layer (layer 3). It's a slight oversimplification, but one can think of IP addressing as supporting the software implementation and MAC addresses as supporting the hardware implementation of the network stack. </b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm"></p> <p></p> <p style="text-indent: 0.4cm; margin-bottom: 0cm"><b>IP ADDRESS</b></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">An Internet Protocol (IP) address is a numerical label that is assigned to devices participating in a computer network that uses the Internet Protocol for communication between its nodes. An IP address serves two principal functions: host or network interface identification and location addressing. Its role has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A route indicates how to get there.</font></p> <p style="margin-bottom: 0cm" align="CENTER"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">IP addresses specify the locations of the source and destination nodes in the topology of the routing system. For this purpose, some of the bits in an IP address are used to designate a subnetwork. The number of these bits is indicated in CIDR notation, appended to the IP address; e.g., 208.77.188.166/24.</font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>NAST</b></font></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">The Network Analyzer Sniffer Tool or nast is a packet capturing program that displays the captured information in various ways depending on the command line options you specify.</font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>IP</b></font></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">Network layer protocol in the TCP/IP stack offering a connectionless internetworking service. IP provides features for addressing, type-of-service specification, fragmentation and reassembly and security. </font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>TRANSMISSION CONTROL PROTOCOL (TCP)</b></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">TCP is the protocol used as the basis of most internet services. It is used in conjuction with the internet protocol (IP). It allows for reliable communication, ensuring that packets reach their intended destinations </font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>INTERNET CONTROL MESSAGING PROTOCOL (ICMP)</b></font></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2">Internet messaging protocol. Network layer internet protocol that reports errors and provides other information relevant to IP packet processing.</font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><font style="font-size: 11pt" size="2"><b>USER DATAGRAM PROTOCOL (UDP) </b></font></p> <p style="margin-bottom: 0cm"><a name="_GoBack"></a><font style="font-size: 11pt" size="2">A connectionless transport layer protocol in the transmission Control Protocol/Internet Protocol (TCP/IP) stack. UDP is a simple protocol that exchanges datagrams without acknowledgments or guaranteed delivery, and requires that error processing and retransmission be handle by other protocols.</font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><b>CODE </b></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">package redes;</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import java.io.*;</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import java.util.*;</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import java.util.logging.Level;</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import java.util.logging.Logger;</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import javax.swing.*;</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">import java.net.*;</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">public class Caddress extends JFrame {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">String SRes="“,SAux=”";</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">int IAux=0;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">InetAddress IAddress;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">boolean BEstado=false;</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private void initComponents() {</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LTitulo = new javax.swing.JLabel();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BObtener = new javax.swing.JButton();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BSalir = new javax.swing.JButton();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">jScrollPane1 = new javax.swing.JScrollPane();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">TARes = new javax.swing.JTextArea();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LNombre = new javax.swing.JLabel();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LDireccion = new javax.swing.JLabel();</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">setBackground(new java.awt.Color(51, 102, 255));</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LTitulo.setFont(new java.awt.Font(“Comic Sans MS”, 1, 18));</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1"><span lang="es-MX">LTitulo.setText(“DIRECCIONES IP”);</span></font></p> <p style="margin-bottom: 0cm" lang="es-MX" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1"><span lang="es-MX">BObtener.setText(“OBTENER”);</span></font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BObtener.addActionListener(new java.awt.event.ActionListener() {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">public void actionPerformed(java.awt.event.ActionEvent evt) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BObtenerActionPerformed(evt);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">});</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BSalir.setText(“SALIR”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BSalir.addActionListener(new java.awt.event.ActionListener() {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">public void actionPerformed(java.awt.event.ActionEvent evt) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">BSalirActionPerformed(evt);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">});</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">TARes.setColumns(20);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">TARes.setRows(5);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">jScrollPane1.setViewportView(TARes);</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LNombre.setFont(new java.awt.Font(“Comic Sans MS”, 1, 12));</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LNombre.setText(“MAC”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LDireccion.setFont(new java.awt.Font(“Comic Sans MS”, 1, 12));</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">LDireccion.setText(“IP NOMBRE”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">getContentPane().setLayout(layout);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">layout.setHorizontalGroup(</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createSequentialGroup()</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(20, 20, 20)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createSequentialGroup()</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(BObtener, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(BSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addContainerGap(23, javax.swing.GroupLayout.PREFERRED_SIZE))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createSequentialGroup()</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(21, 21, 21)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LNombre)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(130, 130, 130)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LDireccion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(43, 43, 43))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createSequentialGroup()</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(66, 66, 66)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addContainerGap(91, Short.MAX_VALUE))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">layout.setVerticalGroup(</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createSequentialGroup()</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(16, 16, 16)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LTitulo)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(18, 18, 18)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LNombre)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(LDireccion))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(BObtener)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addComponent(BSalir))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">.addGap(12, 12, 12))</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">);</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">pack();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}// &lt;/editor-fold&gt;//GEN-END:initComponents</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private void BObtenerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BObtenerActionPerformed</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">// TODO add your handling code here:</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Process proc=null;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">proc = Runtime.getRuntime().exec(“nast -m”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">catch (IOException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">InputStream is=proc.getInputStream();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">int size;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">String s;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">int exCode = proc.waitFor();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">catch (InterruptedException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">StringBuffer ret=new StringBuffer();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">while ((size = is.available()) != 0) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">byte[] b = new byte[size];</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">is.read(b);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">s = new String(b);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">ret.append(s);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">} catch (IOException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">//protocolos</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Process proc2=null;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">proc2 = Runtime.getRuntime().exec(“netstat -s”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">catch (IOException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">InputStream is2=proc2.getInputStream();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">int exCode = proc2.waitFor();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">catch (InterruptedException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">StringBuffer ret2=new StringBuffer();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">size=0;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">s="";</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">try {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">while ((size = is2.available()) != 0) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">byte[] b = new byte[size];</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">is2.read(b);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">s = new String(b);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">ret2.append(s);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">} catch (IOException ex) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">int Ipos=ret.indexOf(“=”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">ret.delete(0, Ipos+60);</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Ipos=ret.indexOf(“This”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">ret.delete(Ipos-4,ret.length());</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">while(ret.indexOf(“(”) &gt; 0 &amp;&amp; ret.indexOf(“)”) &gt; 0)</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">{</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">ret.delete(ret.indexOf(“(”),ret.indexOf(“)”)+1);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">//ret.insert(ret.indexOf(“)”),“ ”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">try</font></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">{</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">String SAux=ret.toString();</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">String SDir[]=SAux.split(“\\s+”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">String Aux="";</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">for(int x=1;x&lt;SDir.length;x=x+2)</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">{</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">System.out.println(SDir[x]+“&gt;\n”);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1"><span lang="es-MX">Aux+=SDir[x-1]+“\t”+SDir[x]+“\t ”;</span></font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">InetAddress IAddress = InetAddress.getByName(SDir[x]);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">Aux+=IAddress.getHostName()+“\n”;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">TARes.setText(“\n”+Aux+“\n”+ret2.toString());</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">}catch(Exception e){}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}//GEN-LAST:event_BObtenerActionPerformed</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private void BSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BSalirActionPerformed</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">System.exit(0); // TODO add your handling code here:</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}//GEN-LAST:event_BSalirActionPerformed</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">/**</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">* @param args the command line arguments</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">*/</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">public static void main(String args[]) {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">java.awt.EventQueue.invokeLater(new Runnable() {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">public void run() {</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">new Caddress().setVisible(true);</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">});</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">// Variables declaration - do not modify//GEN-BEGIN:variables</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JButton BObtener;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JButton BSalir;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JLabel LDireccion;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JLabel LNombre;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JLabel LTitulo;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JTextArea TARes;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">private javax.swing.JScrollPane jScrollPane1;</font></p> <p style="margin-bottom: 0cm" align="LEFT"> <font style="font-size: 8pt" size="1">// End of variables declaration//GEN-END:variables</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"><font style="font-size: 8pt" size="1">}</font></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" lang="es-MX"></p> <p></p> <p style="margin-bottom: 0cm" lang="es-MX" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm; page-break-before: always"><span lang="es-MX">References</span></p> <p style="margin-bottom: 0cm"><span lang="es-MX">[1]COMO PROGRAMAR EN JAVA</span></p> <p style="margin-bottom: 0cm"> DEITEL AND DEITEL</p> <p style="margin-bottom: 0cm">ED PEARSON EDUCACION</p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"><span lang="es-MX">[2]GUIA DEL PRIMER AÑO CCNA 1 Y2</span></p> <p style="margin-bottom: 0cm"><span lang="es-MX">3ª EDICION</span></p> <p style="margin-bottom: 0cm"><span lang="es-MX">ED CISCO</span></p> <p style="margin-bottom: 0cm" lang="es-MX"></p> <p></p> <p style="margin-bottom: 0cm"><span lang="es-MX">[3]GUIA Y PROTOLOS DE ENRUTAMIENTO</span></p> <p style="margin-bottom: 0cm">JOHNSON ALLAN</p> <p style="margin-bottom: 0cm">ED TRILLAS</p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm; page-break-before: always" align="LEFT"></p> <p></p> <p style="margin-bottom: 0cm" align="LEFT"></p> <p></p> </meta></meta></p> jaalvarez@ipn.mx (unknown) Fri, 18 Jun 2010 07:13:49 -0500 OBTENCION DE IP Y MAC ADDRESS DE UN CONJUNTO DE COMPUTADORAS http://www.ipnlinux.org/?module=blog&action=view&id=14&title=obtencion-de-ip-y-mac-address-de-un-conjunto-de-computadoras http://www.ipnlinux.org/?module=blog&action=view&id=14&title=obtencion-de-ip-y-mac-address-de-un-conjunto-de-computadoras <p><meta> <title></title> <meta name="GENERATOR" content="OpenOffice.org 3.2 (Linux)"> <style type="text/css"> <!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } A:link { so-language: zxx } --> </style> <p style="margin-bottom: 0cm" align="CENTER"> <meta> <title></title> <meta name="GENERATOR" content="OpenOffice.org 3.2 (Linux)"> <style type="text/css"> <!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> </style> &lt;/p&gt;<p style="margin-bottom: 0cm; text-align: center" align="JUSTIFY"><font color="#1f497d"><font face="Arial, serif"><font style="font-size: 9pt" size="2">Gustavo Fabián Gregorio, David Melitón Prisciliano, Antonio Rojas Benito, Julio Cesar Medina Jiménez, Mario Alberto Venegas de la Cruz, Uriel Romero Montiel, Esperanza Mondragón Alvarado, Juan Antonio Mauro. y Jesús Antonio Álvarez Cedillo</font></font></font></p><font face="Arial, serif"><font size="2"></p> <p>INTRODUCCION</font></font> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">El poder manejar programas en Ubuntu y en Windows hoy en día es un privilegio, sin embargo hay que tener muy en claro las diferencias de cada sistema operativo en este articulo les mostramos un ejemplo donde obtenemos la ip y la Mac address tanto en Windows como en Ubuntu, realizado en la plataforma net beans.</font></font></p> <p style="margin-bottom: 0cm"></p> <p></p> <p style="margin-bottom: 0cm" align="CENTER"><font face="Arial, serif"><font size="2">DEFINICIONES</font></font></p> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">Dirección IP: Una </font></font><font face="Arial, serif"><font size="2"><b>dirección IP</b></font></font><font face="Arial, serif"><font size="2"> es un número que identifica de manera lógica y jerárquica a una interfaz de un dispositivo (habitualmente una computadora) dentro de una red que utilice el protocolo IP (</font></font><font face="Arial, serif"><font size="2"><i>Internet Protocolo</i></font></font><font face="Arial, serif"><font size="2">), que corresponde al nivel de red del protocolo TCP/IP. </font></font><font face="Arial, serif"><font size="2"><i>Dicho</i></font></font><font face="Arial, serif"><font size="2"> número no se ha de confundir con la dirección MAC que es un número hexadecimal fijo que es asignado a la tarjeta o dispositivo de red por el fabricante, mientras que la dirección IP se puede cambiar. Esta dirección puede cambiar 2 ó 3 veces al día; y a esta forma de asignación de dirección IP se denomina una </font></font><font face="Arial, serif"><font size="2"><i>dirección IP dinámica</i></font></font><font face="Arial, serif"><font size="2"> (normalmente se abrevia como </font></font><font face="Arial, serif"><font size="2"><i>IP dinámica</i></font></font><font face="Arial, serif"><font size="2">).</font></font></p> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">Mac address: En redes de ordenadores la </font></font><font face="Arial, serif"><font size="2"><b>dirección MAC</b></font></font><font face="Arial, serif"><font size="2"> (siglas en inglés de </font></font><font face="Arial, serif"><font size="2"><b>Media Access Control</b></font></font><font face="Arial, serif"><font size="2"> o </font></font><font face="Arial, serif"><font size="2"><i>control de acceso al medio</i></font></font><font face="Arial, serif"><font size="2">) es un identificador de 48 bits (6 bloques hexadecimales) que corresponde de forma única a una Ethernet de red. Se conoce también como la dirección física en cuanto identificar dispositivos de red. Es individual, cada dispositivo tiene su propia dirección MAC determinada y configurada por el IEEE (</font></font><font face="Arial, serif"><font size="2"><b>los últimos 24 bits</b></font></font><font face="Arial, serif"><font size="2">) y el fabricante (</font></font><font face="Arial, serif"><font size="2"><b>los primeros 24 bits</b></font></font><font face="Arial, serif"><font size="2">) utilizando el OUI. La mayoría de los protocolos que trabajan en la capa 2 del modelo OSI usan una de las tres numeraciones manejadas por el IEEE: </font></font><font face="Arial, serif"><font size="2"><b>MAC-48, EUI-48, y EUI-64</b></font></font><font face="Arial, serif"><font size="2"> las cuales han sido diseñadas para ser identificadores globalmente únicos. No todos los protocolos de comunicación usan direcciones MAC, y no todos los protocolos requieren identificadores globalmente únicos.</font></font></p> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">NetBeans: a plataforma NetBeans permite que las aplicaciones sean desarrolladas a partir de un conjunto de </font></font><a href="http://es.wikipedia.org/wiki/Componentes_de_software"><font color="#00000a"><font face="Arial, serif"><font size="2">componentes de software</font></font></font></a><font face="Arial, serif"><font size="2"> llamados </font></font><font face="Arial, serif"><font size="2"><i>módulos</i></font></font><font face="Arial, serif"><font size="2">. Un módulo es un archivo Java que contiene clases de java escritas para interactuar con las APIs de NetBeans y un archivo especial (manifest file) que lo identifica como módulo. Las aplicaciones construidas a partir de módulos pueden ser extendidas agregándole nuevos módulos. Debido a que los módulos pueden ser desarrollados independientemente, las aplicaciones basadas en la plataforma NetBeans pueden ser extendidas fácilmente por otros desarrolladores de software.</font></font></p> <p style="margin-bottom: 0cm" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">El siguiente programa muestra como se puede obtener la IP y la Mac de una red de computadoras usando el Netbeans en Linux al momento que se corre el programa este puede capturar los dos protocolos que se han dicho y el código es el siguiente:</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.io.BufferedInputStream;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.io.IOException;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.io.InputStream;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.net.InetAddress;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.text.ParseException;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">import java.util.StringTokenizer;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">public final class DireccionMac {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static String getMacAddress() throws IOException {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String os = System.getProperty(“os.name”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> try {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (os.startsWith(“Windows”)) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return windowsParseMacAddress(windowsRunIpConfigCommand());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } else if (os.startsWith(“Linux”)) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return linuxParseMacAddress(linuxRunIfConfigCommand());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } else {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> </span></font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1">throw new IOException(“Sistema operativo desconocido: ” + os);</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> </font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">}</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } catch (ParseException ex) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> ex.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throw new IOException(ex.getMessage());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static String linuxParseMacAddress(String ipConfigResponse)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throws ParseException {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String localHost = null;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> try {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> localHost = InetAddress.getLocalHost().getHostAddress();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } catch (java.net.UnknownHostException ex) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> ex.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throw new ParseException(ex.getMessage(), 0);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, “\n”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String lastMacAddress = null;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> while (tokenizer.hasMoreTokens()) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String line = tokenizer.nextToken().trim();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> boolean containsLocalHost = line.indexOf(localHost) &gt;= 0;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (containsLocalHost &amp;&amp; lastMacAddress != null) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return lastMacAddress;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> int macAddressPosition = line.indexOf(“HWaddr”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (macAddressPosition &lt;= 0)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> continue;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String macAddressCandidate = line.substring(macAddressPosition + 6)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> .trim();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (linuxIsMacAddress(macAddressCandidate)) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> lastMacAddress = macAddressCandidate;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> </span></font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1">continue;</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> }</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> }</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> ParseException ex = new ParseException(</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> “Imposible obtener la dirección MAC ” + localHost + “ desde [”</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> </font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">+ ipConfigResponse + “]”, 0);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> ex.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throw ex;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static boolean linuxIsMacAddress(String macAddressCandidate) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (macAddressCandidate.length() != 17)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return false;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return true;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static String linuxRunIfConfigCommand() throws IOException {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> Process p = Runtime.getRuntime().exec(“ifconfig”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> InputStream stdoutStream = new BufferedInputStream(p.getInputStream());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> StringBuffer buffer = new StringBuffer();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> for (;;) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> int c = stdoutStream.read();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (c == -1)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> break;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> buffer.append((char) c);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String outputText = buffer.toString();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> stdoutStream.close();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return outputText;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static String windowsParseMacAddress(String ipConfigResponse)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throws ParseException {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String localHost = null;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> try {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> localHost = InetAddress.getLocalHost().getHostAddress();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } catch (java.net.UnknownHostException ex) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> ex.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throw new ParseException(ex.getMessage(), 0);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> StringTokenizer tokenizer = new StringTokenizer(ipConfigResponse, “\n”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String lastMacAddress = null;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> while (tokenizer.hasMoreTokens()) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String line = tokenizer.nextToken().trim();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (line.endsWith(localHost) &amp;&amp; lastMacAddress != null) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return lastMacAddress;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> int macAddressPosition = line.indexOf(“:”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (macAddressPosition &lt;= 0)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> continue;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String macAddressCandidate = line.substring(macAddressPosition + 1)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> .trim();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (windowsIsMacAddress(macAddressCandidate)) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> lastMacAddress = macAddressCandidate;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> </span></font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1">continue;</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> }</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> }</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> ParseException ex = new ParseException(</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> “Imposible obtener dirección MAC desde [” + ipConfigResponse</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> </font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">+ “]”, 0);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> ex.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> throw ex;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static boolean windowsIsMacAddress(String macAddressCandidate) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (macAddressCandidate.length() != 17)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return false;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return true;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> private final static String windowsRunIpConfigCommand() throws IOException {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> Process p = Runtime.getRuntime().exec(“ipconfig /all”);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> InputStream stdoutStream = new BufferedInputStream(p.getInputStream());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> StringBuffer buffer = new StringBuffer();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> for (;;) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> int c = stdoutStream.read();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> if (c == -1)</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> break;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> buffer.append((char) c);</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> String outputText = buffer.toString();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> stdoutStream.close();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> return outputText;</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" lang="en-US" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> public final static void main(String[] args) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> try {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> System.out.println(“Sistema Operativo : ”</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> + System.getProperty(“os.name”));</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> </span></font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1">System.out.println(“Dirección IP : ”</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"> </font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US">+ InetAddress.getLocalHost().getHostAddress());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> System.out.println(“Dirección Física (MAC): ” + getMacAddress());</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> } catch (Throwable t) {</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> t.printStackTrace();</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> }</span></font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1"><span lang="en-US"> </span></font></font><font face="Arial, serif"><font style="font-size: 8pt" size="1">}</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"><font face="Arial, serif"><font style="font-size: 8pt" size="1">}</font></font></p> <p style="margin-bottom: 0cm; line-height: 100%" align="JUSTIFY"></p> <p></p> <p style="margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">Conclusiones:</font></font></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">Con el desarrollo del programa nos pudimos dar cuenta que cada computadora tiene una dirección IP que es un numero que identifica de manera lógica a una interfaz de un dispositivo que se encuentra dentro de una red que utilice el protocolo IP este número puede crear una red dentro de internet conectándolo con alguna otra computadora con el mismo número IP, en este programa que se muestra anteriormente realiza la obtención de la dirección IP y la MAC address al momento de ejecutarlo en la plataforma de NetBeans captura los dos protocolos mostrándolos en la pantalla, en otro caso en el sistema operativo Ubuntu o Linux entrando desde lugares, terminal aparece un cuadro en el que para saber cuál es la dirección en la red por medio del IP se le da la instrucción.</font></font></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"></p> <p></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">#ifconfig </font></font></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"></p> <p></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">y automáticamente te manda el resultado que en ese momento se encuentra en la red WLAN que puede cambiar varias veces al día aquí mismo te muestra la MAC en una red LAN que es individual , cada dispositivo tiene su propia dirección MAC determinada y configurada, después para conectar dos o más computadoras en red con este número lo insertas en las computadoras donde dice http: e introduces el numero:</font></font></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"></p> <p></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"><font face="Arial, serif"><font size="2">http://[ la dirección IP que dice la WLAN]</font></font></p> <p style="margin-left: 0.64cm; margin-bottom: 0cm" align="JUSTIFY"></p> <p></p></p> <p></meta></meta></p></meta></meta></p> jaalvarez@ipn.mx (unknown) Fri, 18 Jun 2010 00:10:00 -0500 Install Mono 2.4 on Ubuntu http://www.ipnlinux.org/?module=blog&action=view&id=13&title=install-mono-2-4-on-ubuntu http://www.ipnlinux.org/?module=blog&action=view&id=13&title=install-mono-2-4-on-ubuntu <p></p> <p>Ubuntu ships with Mono pre-installed, but due to the rapid release cycles on the Mono project, the version that ships with Ubuntu is</p> <p>often outdated by the time the Ubuntu release ships. Due to the impressive release schedule of Mono, you do really need to keep up</p> <p>with the new releases as every new release dramatically improves the entire framework.</p> <p>Unfortunately for Ubuntu users, there are no dedicated Ubuntu packages for download from the Mono Project web site, which means that</p> <p>you best bet is be to compile the project yourself. While I know that most Linux newbies find that concept intimidating, it actually</p> <p>isn't nearly as hard as it sounds.</p> <p>To that end, I'll walk you through compiling and installing the latest release of Mono (version 2.4 at time of writing) on Ubuntu.</p> <p>Note that these instructions should also work on newer versions of Mono.</p> <p>These instructions were created by installing Mono 2.4 on an absolutely fresh installation of Ubuntu. For those Windows users wishing</p> <p>to try this out at home, I would suggest installing Ubuntu on a Virtual PC 2007 virtual machine. Arcanecode has an excellent post on</p> <p>getting this to work first time.</p> <p>IMPORTANT: If you're installing on a VPS, make sure that you have at least 400 MB of RAM available, or otherwise the mono compilation</p> <p>process will fail.</p> <p>WARNING</p> <p>Following these instructions will result in all your pre-installed Mono applications being removed from your Ubuntu box. In most cases</p> <p>the only way to get them back is going to be by installing them from source too (not always a bad idea).</p> <p>If you'd like to play with Mono 2.4, but keep things like F-Spot and Beagle, I would suggest rather using the instructions</p> <p>provided by Jan Dzik.</p> <p>Update: I now have a script that automates the install, see this post: Mono Compile &amp; Install Script</p> <p>Installing Mono</p> <p>Open a terminal window if you're using the Ubuntu GUI or log on using SSH if you're accessing a remote server.</p> <p>All these instructions assume that you have root privileges, so if you're not logged in as root, enter the following and</p> <p>enter you password when prompted.</p> <p>$ sudo bash</p> <p>First you need to remove the version of Mono that is pre-installed with Ubuntu.</p> <p>$ apt-get remove mono-common</p> <p>That will remove all the extra packages that are installed with mono as they all depend on it. Be aware that it will also remove</p> <p>applications like f-spot and beagle, which will have to be re-installed after the mono upgrade if you wish to use them.</p> <p>Next, create a folder for the source code you're about to compile:</p> <p>$ mkdir /src</p> <p>Then change to the src directory:</p> <p>$ cd /src</p> <p>Make sure that your /etc/apt/sources.list file has the universe and multiverse repositories included. If you installation didn't</p> <p>have any internet connectivity, there may be a chance that the installer disabled those repositories due to being unable to verify</p> <p>them. If that is the case, do the following:</p> <p>$ nano /etc/apt/sources.list</p> <p>Remove the # characters from the universe and multiverse entries and save the file (a Nano Basics Guide is available for people new</p> <p>to nano). I personally just enable everything.</p> <p>Refresh the apt-get database.</p> <p>$ apt-get update</p> <p>You now need to install some Mono build dependencies (and some optional enhancements):</p> <p>$ apt-get install build-essential pkg-config libglib2.0-dev bison libcairo2-dev libungif4-dev libjpeg62-dev libtiff4-dev gettext</p> <p>Download libgdiplus:</p> <p>$ wget <a href="http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.tar.bz2">http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.tar.bz2</a></p> <p>$ tar -xvf libgdiplus-2.4.tar.bz2</p> <p>$ cd libgdiplus-2.4/</p> <p>Now we can compile libgdiplus and install it:</p> <p>$ ./configure --prefix=/usr/local; make; make install</p> <p>Now go make yourself a snack, especially if you're doing this on a VM <img src="http://www.ipnlinux.org/media/emoticons/default/tongue.png" width="16" height="16" /></p> <p>After the compilation finally finishes, we need to make sure the new packages are visible to the system:</p> <p>$ sh -c “echo /usr/local/lib &gt;&gt; /etc/ld.so.conf”</p> <p>$ /sbin/ldconfig</p> <p>Now change back to the /src folder and download the latest release of mono (about 17 MB):</p> <p>$ cd /src</p> <p>$ wget <a href="http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.tar.bz2">http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.tar.bz2</a></p> <p>Extract the compressed file, change into the mono folder and compile:</p> <p>$ tar -xvf mono-2.4.tar.bz2</p> <p>$ cd mono-2.4</p> <p>$ ./configure --prefix=/usr/local; make; make install</p> <p>You can go make yourself a gourmet meal at this point as the compilation process takes a seriously long time (ok, maybe not that</p> <p>long, but us generation X/Y types don't really have the patience for C++ compilation).</p> <p>Add mono to the bash path:</p> <p>$ nano ~/.bashrc</p> <p>And add the following lines at the end:</p> <p>PATH=/usr/local/bin:$PATH</p> <p>LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH</p> <p>PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH</p> <p>In order for the changes to take effect, you need to either close and open your terminal again, or simply type:</p> <p>$ bash</p> <p>to start a new instance of bash command line.</p> <p>To check your new mono version, type:</p> <p>$ mono -V</p> <p>You should see the following:</p> <p>Mono JIT compiler version 2.4 (tarball Wed Apr 1 04:49:16 CDT 2009)</p> <p>Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com</p> <p>TLS: __thread</p> <p>GC: Included Boehm (with typed GC)</p> <p>SIGSEGV: altstack</p> <p>Notifications: epoll</p> <p>Architecture: amd64</p> <p>Disabled: none</p> <p>Congratulations, you have a working copy of the latest Mono released installed on your Ubuntu machine!</p> <p>Installing XSP</p> <p>XSP is the Mono web server that Apache delegates to (via mod_mono) when serving ASP.NET pages on Linux. In order</p> <p>to run ASP.NET pages</p> <p>you will need to compile and build the XSP web server.</p> <p>Change to your /src directory, download the XSP sources, unzip them and compile:</p> <p>$ cd /src</p> <p>$ wget <a href="http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.tar.bz2">http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.tar.bz2</a></p> <p>$ tar -xvf xsp-2.4.tar.bz2</p> <p>$ cd xsp-2.4/</p> <p>$ ./configure --prefix=/usr/local; make; make install</p> <p>Once the compilation is done, we can test the XSP server. Change to the XSP test installation folder and run the XSP server:</p> <p>$ cd /usr/local/lib/xsp/test</p> <p>$ xsp2</p> <p>You should see something like the following:</p> <p>xsp2</p> <p>Listening on address: 0.0.0.0</p> <p>Root directory: /root</p> <p>Listening on port: 8080 (non-secure)</p> <p>Hit Return to stop the server.</p> <p>Open your browser and point it to <a href="http://localhost:8080">http://localhost:8080</a> (or your domain/ip if you're doing this remotely). You should see the XSP test page.</p> <p>Installing Mod_Mono</p> <p>Mod_mono is the name of the apache2 module that links the XSP server and apache. This allows for apache to handle all incoming</p> <p>requests and hand them off to the XSP process in order to server your ASP.NET pages. You only need to install Mod_mono if you</p> <p>plan on using Apache2 to serve web pages. You will also need to have apache2 (and it's development files) pre-installed to</p> <p>compile mod_mono.</p> <p>Install apache2 and the necessary build dependencies:</p> <p>$ apt-get install apache2 apache2-threaded-dev</p> <p>Once that's done, we can compile mod_mono.</p> <p>Change to our source directory, download the mod_mono sources, unzip them and compile:</p> <p>$ cd /src</p> <p>$ wget <a href="http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.4.tar.bz2">http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.4.tar.bz2</a></p> <p>$ tar -xvf mod_mono-2.4.tar.bz2</p> <p>$ cd mod_mono-2.4/</p> <p>$ ./configure --prefix=/usr/local; make; make install</p> <p>We need to include the mod_mono.conf file in the apache2 configuration file, so open the apache2.conf file in a text editor:</p> <p>$ nano /etc/apache2/apache2.conf</p> <p>Scroll to the bottom of the file and include the following line:</p> <p>Include /etc/apache2/mod_mono.conf</p> <p>Now lets copy the test content from XSP to our apache2 public folder to we can have an ASP.NET application with which to test the</p> <p>mod_mono installation:</p> <p>$ cp -r /usr/local/lib/xsp/test /var/www/test</p> <p>When you compile Mod_mono from source, the necessary apache2 configuration files are not created for you, so we will have to do them manually.</p> <p>Firstly, create the mod_mono.load file with a text editor:</p> <p>$ nano /etc/apache2/mods-available/mod_mono.load</p> <p>Add the following line to the file:</p> <p>LoadModule mono_module /usr/lib/apache2/modules/mod_mono.so</p> <p>Next we create the mod_mono.conf file:</p> <p>$ nano /etc/apache2/mods-available/mod_mono.conf</p> <p>Add the following to the file:</p> <p>AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx</p> <p>DirectoryIndex index.aspx</p> <p>include /usr/local/lib/mono/2.0/mono-server2-hosts.conf</p> <p>Next, create the mono-server2-hosts.conf file:</p> <p>$ nano /usr/local/lib/mono/2.0/mono-server2-hosts.conf</p> <p>And add the following:</p> <p>&lt;IfModule mod_mono.c&gt;</p> <p>MonoUnixSocket /tmp/.mod_mono_server2</p> <p>MonoServerPath /usr/local/lib/mono/2.0/mod-mono-server2.exe</p> <p>AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx</p> <p>MonoApplicationsConfigDir /usr/local/lib/mono/2.0</p> <p>MonoPath /usr/local/lib/mono/2.0:/usr/local/lib</p> <p>&lt;/IfModule&gt;</p> <p>Configure Apache2 Virtual Hosts</p> <p>The virtual hosts configuration really requires a tutorial on its own, but for now I'll just show you how to make the test application</p> <p>the default site on your apache2 server.</p> <p>Edit the default virtual host file for apache2:</p> <p>$ nano /etc/apache2/sites-enabled/000-default</p> <p>Replace the contents of the file with the following (you may want to backup the file first):</p> <p>&lt;VirtualHost *&gt;</p> <p>ServerName www.local.com</p> <p>ServerAdmin webmaster@localhost</p> <p>DocumentRoot /var/www/test</p> <p>DirectoryIndex index.html index.aspx</p> <p>MonoDocumentRootDir “/var/www/test”</p> <p>MonoServerPath rootsite “/usr/local/bin/mod-mono-server2”</p> <p>MonoApplications rootsite “/:/var/www/test”</p> <p>&lt;Directory /var/www/test&gt;</p> <p>MonoSetServerAlias rootsite</p> <p>SetHandler mono</p> <p>AddHandler mod_mono .aspx .ascx .asax .ashx .config .cs .asmx</p> <p>&lt;/Directory&gt;</p> <p>&lt;/VirtualHost&gt;</p> <p>Now restart apache2:</p> <p>$ /etc/init.d/apache2 restart</p> <p>Now open your browser and navigate to <a href="http://localhost/.">http://localhost/.</a> You should see the XSP test web app appear.</p> <p>Restart Errors</p> <p>When you restart apache2 using the command above, you are likely to see an error message similar to the following:</p> <ul><li>Restarting web server apache2 </li></ul> <p>[Fri Nov 06 00:41:41 2009] [crit] (13)Permission denied: Failed to attach to existing dashboard, and removing dashboard</p> <p>file '/tmp/mod_mono_dashboard_XXGLOBAL_1' failed (Operation not permitted). Further action impossible.</p> <p>This is quite normal and will not affect the operation of your Mono websites.</p> <p>References:</p> <ul><li>https://help.ubuntu.com/community/MonoFromSource</li> <li><a href="http://docs.codehaus.org/display/BOO/Boo+on+Ubuntu">http://docs.codehaus.org/display/BOO/Boo+on+Ubuntu</a></li> <li><a href="http://go-mono.com/sources-stable/">http://go-mono.com/sources-stable/</a> </li> <li><a href="http://www.mono-project.com/Compiling_Mono">http://www.mono-project.com/Compiling_Mono</a> </li> <li><a href="http://www.mono-project.com/Mod_mono">http://www.mono-project.com/Mod_mono</a> </li> <li><a href="http://ubuntuforums.org/archive/index.php/t-288029.html">http://ubuntuforums.org/archive/index.php/t-288029.html</a> </li></ul> jaalvarez@ipn.mx (unknown) Tue, 12 Jan 2010 17:29:28 -0600 Calificaciones semestre agosto -diciembre 2009 http://www.ipnlinux.org/?module=blog&action=view&id=11&title=calificaciones-semestre-agosto-diciembre-2009 http://www.ipnlinux.org/?module=blog&action=view&id=11&title=calificaciones-semestre-agosto-diciembre-2009 <!--begin photo--><div style="text-align: center" class="photo block-center"><span></span><h3><span><span></span></span></h3><span><h3><span></span></h3></span></div><p style="text-align: center"><span><div class="photo block-center" style="text-align: center"><span><h3><span>Feliz navidad a todos , estas son sus calificaciones.</span></h3></span><div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/calif1.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a> </div>TEORIA DE LENGUAJES <div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/calif2.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a> </div> PROGRAMACION PARALELA</p> <p></div> </span></p> jaalvarez@ipn.mx (unknown) Fri, 18 Dec 2009 12:36:00 -0600 Creación de la PC http://www.ipnlinux.org/?module=blog&action=view&id=10&title=creacion-de-la-pc http://www.ipnlinux.org/?module=blog&action=view&id=10&title=creacion-de-la-pc <p>By tognu.</p> <p><span style="display: none"> </span> <div><font style="font-family: tahoma; font-size: 10pt"> <div> </div></font></div></p> <p><div class="ecxMsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt">1.- En el principio Dios creó el Bit y el Byte.</p> <p>2.- Y había dos Bytes en la Palabra; y nada más existía. Y Dios separó el Uno del Cero y vio que era bueno.</p> <p>3.- Y Dios dijo: que se hagan los Datos; y así pasó. Y Dios dijo: Dejemos los Datos en sus correspondientes sitios. Y creó los diskettes, los HDD, los CD/DVD y las Flash.</p> <p>4.- Y Dios dijo: Que se hagan las PC, así habrá un lugar para poner los disquetes, los HDD, etc. Así Dios creó a las PC, y les llamó hardware.</p> <p>5.- Pero aún no había software. Pero Dios creó los programas; grandes y pequeños… y les dijo: Iros, multiplicaros y llenad toda la memoria.</p> <p>6.- Y Dios dijo: crearé el programador; y el programador creará nuevos programas y gobernará las PC, los programas y los datos.</p> <p>7.- Y Dios creó al programador; y lo puso en el Centro de Datos; y Dios le enseñó al programador el directorio y le dijo: Puedes usar todos los volúmenes y sub-directorios, pero NO USES WINDOWS.</p> <p>8.- Y Dios dijo: no es bueno que el programador esté sólo, cogió un hueso del cuerpo del programador y creó una criatura que miraría al programador y le admiraría, y amaría las cosas que el programador hiciese. Y Dios llamó a la criatura 'El Usuario'.</p> <p>9.- Y el programador y el usuario fueron dejados en el desnudo DOS y eso era bueno.</p> <p>10.- Pero Bill era más listo que todas las otras criaturas de Dios, y Bill le dijo al usuario: ¿Te dijo Dios realmente que no ejecutaras todos los programas?</p> <p>11.- Y el usuario respondió: Dios nos dijo que podíamos usar cualquier programa, pero que no usáramos Windows.</p> <p>12.- Y Bill le dijo al usuario: ¿Cómo puedes hablar de algo que ni siquiera has probado? En el momento en que ejecutes Windows serás igual a Dios, serás capaz de crear cualquier cosa que quieras con el simple toque del ratón.</p> <p>13.- Y el usuario vio que los frutos del Windows eran más bonitos y fáciles de usar. Y el usuario vio que todo conocimiento era inútil, ya que Windows podía reemplazarlo.</p> <p>14.- Así el usuario instaló Windows en su PC; y le dijo al programador que era bueno.</p> <p>15.- Y el programador inmediatamente empezó a buscar nuevos controladores. Y Dios le preguntó: ¿qué buscas? y el programador respondió: Estoy buscando nuevos controladores, porqué no puedo encontrarlos en el DOS. Y Dios dijo: ¿quién te dijo que necesitabas nuevos controladores? , ¿acaso ejecutaste Windows? y el programador dijo: fue Bill quien nos lo dijo…</p> <p>16.- Y Dios le dijo a Bill: por lo que hiciste, serás odiado por todas las criaturas. Y el usuario siempre estará descontento contigo. Y siempre venderás Windows.</p> <p>17.- Y Dios le dijo al usuario: por lo que hiciste, el Windows te decepcionará y se comerá todos tus recursos; y tendrás que usar malos programas; y siempre permanecerás bajo la ayuda del programador.</p> <p>18.- Y Dios le dijo al programador: por haber escuchado al usuario nunca serás feliz. Todos tus programas tendrán errores y tendrás que corregirlos y corregirlos hasta el final de los tiempos.</p> <p>19.- Y Dios les echó a todos del Centro de Datos y bloqueó la puerta con una clave de acceso. Y eso no fue bueno.</p> <p>20.- Y desde entonces Dios no descansa, ni ve progresos en las PC con Windows.</span></font></div> <div class="ecxMsoNormal"><font face="Times New Roman" size="3" color="#000000"><span style="color: black; font-size: 12pt"> </span></font> </div></p> jaalvarez@ipn.mx (unknown) Sat, 12 Dec 2009 13:49:28 -0600 INSTALL CUDA 2.3 ON UBUNTU 9.10 http://www.ipnlinux.org/?module=blog&action=view&id=9&title=install-cuda-2-3-on-ubuntu-9-10 http://www.ipnlinux.org/?module=blog&action=view&id=9&title=install-cuda-2-3-on-ubuntu-9-10 <p><meta> <title></title> <meta name="GENERATOR" content="OpenOffice.org 3.1 (Unix)"> <style type="text/css"> <!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } --> </style> <p style="margin-bottom: 0.5cm">BY TOGNU</p> <p style="margin-bottom: 0.5cm"></p> <p><font color="#ff0000"><b>1.</b></font> Open a terminal and paste the following commands to add the Launchpad repository:</p> <p><b>-Ubuntu Karmic Koala</b></p> <pre style="margin-bottom: 0.5cm"><code><b><span style="color: rgb(0, 0, 0)">sudo add-apt-repository ppa:nvidia-vdpau/ppa</span></b></code></pre><p></p> <p><b>-Ubuntu Jaunty Jackalope, Intrepid Ibex, Hardy Heron:</b></p> <pre><code><span style="color: rgb(0, 0, 0); font-weight: bold">sudo sh -c “echo 'deb <a href="http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu">http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu</a> UBUNTU_VERSION main' &gt;&gt; /etc/apt/sources.list”</span></code></p> <p><code><span style="color: rgb(0, 0, 0)"></span><span style="font-weight: bold; color: rgb(0, 0, 0)"><span>sudo sh -c “echo 'deb-src <a href="http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu">http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu</a> UBUNTU_VERSION main' &gt;&gt; /etc/apt/sources.list”</span></span></code></pre><p></p> <p>In the two lines above, replace UBUNTU_VERSION with your Ubuntu version (in lowercase: jaunty, intrepid or hardy).</p> <p><font color="#ff0000"><b>2.</b></font> Import the GPG key (skip this for Karmic Koala if you used the add-apt-repository command):</p> <pre style="margin-bottom: 0.5cm"><code><b><span style="color: rgb(0, 0, 0)">sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767</span></b></code></pre><p></p> <p><font color="#ff0000"><b>3.</b></font> Now you can install the Nvidia 190.xx stable drivers:</p> <pre style="margin-bottom: 0.5cm"><code><b><span style="color: rgb(0, 0, 0)">sudo apt-get update &amp;&amp; sudo apt-get install nvidia-190-modaliases nvidia-glx-190</span></b></code></pre><p></p> <p>or 185.xx:</p> <pre style="margin-bottom: 0.5cm"><code><b><span style="color: rgb(0, 0, 0)">sudo apt-get update &amp;&amp; sudo apt-get install nvidia-185-modaliases nvidia-glx-185</span></b></code></pre><p></p> <p></p> <p>Install the drive using envyng</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="font-weight: bold; color: rgb(0, 0, 0)">sudo apt-get install envyng-core;</p> <p>envyng -t</span></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"></p> <p></p> <p style="margin-left: 0.53cm; margin-right: 0.53cm"></p> <p></p> <p style="margin-left: 0.53cm; margin-right: 0.53cm">use the option 1 Install the Nvidia driver,now the option 0 and restart you computer.</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm"></p> <p>The new driver its showed</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm"></p> <p>well, now open a terminal and put in</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="font-weight: bold; color: rgb(0, 0, 0)">sudo apt-get install build-essential libglut3-devsudo</p> <p>sudo apt-get install mesa-common-dev freeglut3-dev glutg3-dev libglut3</p> <p></span></p> <p></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"> Furthermore we also need to get 3 more packages namely</p> <p>sudo apt-get install libxmu-dev</p> <p>sudo apt-get install libxmu-headers</p> <p>sudo apt-get install libxi-dev</p> <p>These can be installed with sudo apt-get in a terminal or by finding them in synaptic.</p> <p>With these downloaded and installed we can continue and install the Nvidia driver. Note that this is on a fresh install and there are more steps to be taken if you are doing it with an older Nvidia driver already installed. There are already posts on the forum about that so I wont go into that here.</p> <p></p> <p style="margin-left: 0.53cm; margin-right: 0.53cm"></p> <p>Next we need to install the toolkit. To do this we open a terminal and type in</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="font-weight: bold; color: rgb(0, 0, 0)">chmod +x ./cudatoolkit_2.3_linux_64_ubuntu9.04.run</p> <p>sudo ./cudatoolkit_2.3_linux_64_ubuntu9.04.run</span></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"> You get to pick your install directory, here I will assume its in the default.</p> <p>The next step is to add the necessary environment variables. In a terminal type in this. (Just type or copy it in one line at a time!)</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="color: rgb(0, 0, 0); font-weight: bold">echo "# CUDA stuff</p> <p>PATH=\$PATH:/usr/local/cuda/bin</p> <p>LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib64</p> <p>export PATH</p> <p>export LD_LIBRARY_PATH" &gt;&gt; ~/.bashrc</span></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"> Like the toolkit installer says, if you run a 32 bit version you must leave out the 64 part.</p> <p>Next we install the SDK. In a terminal type in the following.</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="color: rgb(0, 0, 0); font-weight: bold">chmod +x ./cudasdk_2.3_linux.run</p> <p>./cudasdk_2.3_linux.run</span></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"> You dont need to be a superuser to install this.</p> <p>First you get asked where you want to put the files, and where the CUDA toolkit was installed. (Check that this dir is the same as the one you installed it in, even if it says it located it. The dir need to be the same and not have additions of nvcc or the like!)</p> <p>Last we need to compile the SDK files. In a terminal type (I assume default install dir)</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"></p> <p></p> <pre style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"><em><span style="color: rgb(0, 0, 0); font-weight: bold">sudo apt-get install gcc-4.1 g++-4.1</span></em></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"></p> <p></p> <pre style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.5cm"><em></em><span style="color: rgb(0, 0, 0); font-weight: bold"><em>sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.1 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.1 </em></p> <p><em>sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4</em></span><em></em></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"></p> <p></p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="color: rgb(0, 0, 0); font-weight: bold">cd NVIDIA_GPU_Computing_SDK/C</p> <p>make</span></pre><p style="margin-left: 0.53cm; margin-right: 0.53cm"> Now it should unpack everything succesfully. You may get a lot of warnings during the process, but these can safely be ignored.</p> <p>Once it is done you can test that everything does in fact work by going into</p> <p style="margin-left: 0.53cm; margin-right: 0.53cm; margin-bottom: 0.05cm"> Code:</p> <pre style="border: 1px solid rgb(0, 0, 0); padding: 0.16cm; margin-left: 0.53cm; margin-right: 0.53cm; text-align: left"><span style="color: rgb(0, 0, 0); font-weight: bold">cd NVIDIA_GPU_Computing_SDK/C/bin/linux/release/</span></pre><p></p> <p></p> </meta></meta></p> jaalvarez@ipn.mx (unknown) Sun, 22 Nov 2009 15:35:00 -0600 Examen Gramaticas CIDETEC 2009 http://www.ipnlinux.org/?module=blog&action=view&id=8&title=examen-gramaticas-cidetec-2009 http://www.ipnlinux.org/?module=blog&action=view&id=8&title=examen-gramaticas-cidetec-2009 <p>Entregar antes del 17 de Noviembre de 2009.</p> <p>Respuestas copiadas se tacharan.</p> <!--begin photo--><div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/Examen%20de%20%20Complejidad%20Computacional.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a> <span class="photo-description">EXAMEN</span> </div><!--end photo--> jaalvarez@ipn.mx (unknown) Tue, 10 Nov 2009 17:33:54 -0600 Platicas de TOGNU en SITEC 2009 http://www.ipnlinux.org/?module=blog&action=view&id=7&title=platicas-de-tognu-en-sitec-2009 http://www.ipnlinux.org/?module=blog&action=view&id=7&title=platicas-de-tognu-en-sitec-2009 <p><p style="text-align: left"><!--begin photo--></p><div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/simposium-sitec.jpg"><img class="picbox-photo" src="http://www.ipnlinux.org/data/thumbs/266_e9a2e94f18ee645a4180fd796a0d79d5_simposium-sitec.jpg" height="142" width="266" /></a> <span class="photo-description"><h3>SITEC 2009 CELAYA</h3></span> </div><!--end photo--><p><p style="text-align: left">Saludos, publico las platicas de seguridad y de ubuntu del Congreso SITEC 2009<span></span></p><p style="text-align: left">Realizado en la ciudad de Celaya.</p><p style="text-align: left"><!--begin photo--></p><div class="photo block-left"> <span class="photo-description"></span></div><code><span><div class="photo block-left"><span class="photo-description">Filosofia Ubuntu</span><a href="http://www.ipnlinux.org/data/uploads/presentation-ubuntu-2009-01-espanol.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a></div></span></code><p style="text-align: left"><span><code><span><div class="photo block-left"></div></span></code><span class="photo-description"><code>Pen test</code></span><a href="http://www.ipnlinux.org/data/uploads/hackeo-etico.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a></span></p><a href="http://www.ipnlinux.org/data/uploads/hackeo-etico.pdf"></a><code><span> <div class="photo float-left"></p> <p></div></span></code><div class="photo float-left"><span class="photo-description"></span> </div><!--end photo--><p><p style="text-align: left"></p></p> <!--begin photo--><p style="text-align: left"><span> <span class="photo-description"></span><span></span><blockquote><code><span><span class="photo-description">Google Hacking</span></span></code><span><a href="http://www.ipnlinux.org/data/uploads/33354.pdf"><img src="http://www.ipnlinux.org/media/icons/default/48/mimetypes/text-x-generic.png" height="48" width="48" /></a></span><code><span><span class="photo-description"></span><div class="photo float-left"></p> <p></div></span></code></blockquote><code></code></span><span></span><span> </span></p></p> jaalvarez@ipn.mx (unknown) Tue, 10 Nov 2009 12:00:19 -0600 Nuevo Ubuntu 9.10 Karmic Koala http://www.ipnlinux.org/?module=blog&action=view&id=5&title=nuevo-ubuntu-9-10-karmic-koala http://www.ipnlinux.org/?module=blog&action=view&id=5&title=nuevo-ubuntu-9-10-karmic-koala <p><p style="text-align: left"><span></span></p><p style="text-align: left"><span></span></p><p style="text-align: left"><span></p> <p><div class="postMeta"> By Tognu</p> <p></div><div style="text-align: left"></p> <p><img alt="Ubuntu Karmic Koala" src="http://img.genbeta.com/2009/09/karmic_koala.jpg" id="image52132" /></p> <p>El camino hacia la nueva <strong>versión 9.10 de Ubuntu</strong>, que llevará el nombre de <strong>Karmic Koala</strong>, continúa siendo recorrido por el equipo de desarrollo y ya se ha completado con exito. Su lanzamiento final llegará el 29 de octubre.undefined undefinedEn esta nueva edición nos encontramos con: <ul><li>la última versión del kernel 2.6.31 de Linux y de los entornos de escritorio <span>GNOME</span> y <span>KDE</span> (en el caso de Kubuntu).</li><li>el servicio <strong>Ubuntu One</strong> por defecto, plenamente integrado en el escritorio.</li><li><strong>Grub2</strong> como gestor de arranque y <strong>Ext4</strong> como sistema de ficheros por defecto.</li> <li>arquitectura <strong>UXA</strong> para el driver de gráficas Intel, disponible pero todavía en pruebas.</li></ul> undefinedUna mejora importante en esta versión es el cambio total del <strong>arranque del sistema</strong>, el cual ha mejorado enormemente en cuanto a su aspecto visual y también en el tiempo empleado para arrancar:undefined undefinedAdemás, nos encontramos ya con el nuevo proyecto <strong>Ubuntu Software Store</strong>, del cual hablaremos en un post próximamente con más detalle.undefined undefinedDescargalo <a href="http://www.ubuntu.com">aqui</a></div></span></p><div><p><a href="http://www.ipnlinux.org/karmic-desktop-i386.iso"></a></p></div><p style="text-align: left"><span></span></p></p> jaalvarez@ipn.mx (unknown) Sun, 08 Nov 2009 10:41:47 -0600 Como abrir aplicaciones libres con formato RUNZ Extension en Ubuntu http://www.ipnlinux.org/?module=blog&action=view&id=4&title=como-abrir-aplicaciones-libres-con-formato-runz-extension-en-ubuntu http://www.ipnlinux.org/?module=blog&action=view&id=4&title=como-abrir-aplicaciones-libres-con-formato-runz-extension-en-ubuntu <p><p></p><p style="text-align: left"><span>undefinedPor TOGNUundefined undefinedExiste un número considerable de aplicaciones portables disponibles para Ubuntu (Linux)en formato “.RUNZ” el cual no es reconocido por ubuntu , es por eso que deberas de instalar un framework para correlo.undefined undefinedLa extension .RUNZ es como un archivo .EXE en Windows y como un archivo .DMG en la Mac.undefined undefinedPara poder interpretarlo será necesario instalar la extension .RUNZ ya que es un archivo tipo DEBundefined <div> undefined<span id="more-2746"> </span>undefined <h3>Sigue estos simples pasos para hacerlo funcionar</h3> undefined<a href="http://hacktolive.org/files/runz/runz-framework-0.8.9.8.deb">Bajar el framework 0.8.9.8 para Ubuntu</a> [<a href="http://hacktolive.org/wiki/RUNZ_framework#RUNZ_framework">Verifica la última versión</a>]undefined undefinedGuarda el archivo .deb e instalalo usando el instalador de paquetes (Package Installer).undefined <div style="width: 560px"><img alt="Package Installer - .RUNZ" src="http://farm3.static.flickr.com/2471/3902641031_001d60a131_o.png" title="Package Installer - .RUNZ" height="400" width="550" /> Package Installer – .RUNZ </div> <div style="width: 517px; text-align: center"> <span><img alt="Installation Finished" src="http://farm3.static.flickr.com/2660/3903420832_f33f7f4eec_o.png" title="Installation Finished" height="203" width="507" /></span>Installation Finished </div> undefinedDespues de la instalación deberas de reiniciar tu sistema para activar el framework.undefined undefinedAhora podras integrar cualquier aplicación y correla directamenteundefined <div style="width: 379px; text-align: center"><img alt="RUNZ Icon" src="http://farm3.static.flickr.com/2468/3902641205_49bae08cf8_o.png" title="RUNZ Icon" height="189" width="369" /> RUNZ Icon </div> undefinedundefined</div></span></p><div><p></p></div><p style="text-align: left"><span></span></p></p> jaalvarez@ipn.mx (unknown) Sun, 08 Nov 2009 10:39:07 -0600 Oración del Ubuntero http://www.ipnlinux.org/?module=blog&action=view&id=2&title=oracion-del-ubuntero http://www.ipnlinux.org/?module=blog&action=view&id=2&title=oracion-del-ubuntero <p><p></p><p style="text-align: left"><!--begin photo--></p><div class="photo block-center"> <a href="http://www.ipnlinux.org/data/uploads/i-want-to-believe-in-ubuntu.jpg"><img class="picbox-photo" src="http://www.ipnlinux.org/data/thumbs/280_4a8f0a018fa015947dfd0c980b5424a5_elieve-in-ubuntu.jpg" height="280" width="224" /></a> </div><!--end photo--><p><p style="text-align: left"><span>Por tognu</p> <p><h3>Que el Kernel de Linux este siempre con todos nosotros hermanos!</h3> <h3>(Responde el resto)</h3> <h3>Y con tu disco duro.</h3> <h3>Orate-emos.</h3> <h3>Mark Shuttleworth que estas en Canonical,</h3> <h3>Santificado sea tu Ubuntu</h3> <h3>Venga a nosotros tu aplicación</h3> <h3>tanto en casa como el trabajo</h3> <h3>Hágase tu voluntad así en el Desktop como en el Server.</h3> <h3>Danos hoy la actualización de cada día</h3> <h3>Y perdona nuestros errores en la consola</h3> <h3>así como nosotros perdonamos a Windows,</h3> <h3>no nos dejes caer en la tentación del software privativo</h3> <h3>y más líbranos de los malvados bug`s.</h3> <h3>Amen.</h3> <h3>Démonos fraternalmente la ayuda.</h3> <h3> Podemos compilar en paz.</h3></span></p><h3></h3></p> jaalvarez@ipn.mx (unknown) Sun, 08 Nov 2009 10:34:38 -0600 Transmisión de Radio por Internet usando winamp http://www.ipnlinux.org/?module=blog&action=view&id=6&title=transmision-de-radio-por-internet-usando-winamp http://www.ipnlinux.org/?module=blog&action=view&id=6&title=transmision-de-radio-por-internet-usando-winamp <p><p style="text-align: left"><span><div class="postMeta"> By Tognu </div> undefined<img style="width: 587px; height: 387px" src="http://www.colegioelcamino.com/images/boletin%201/Studio%200001.jpg" title="RADIO POR iNTERNET" class="alignnone" />undefined undefinedPor tognu: Para locutores de Radiomax <a href="http://www.radiomax.com.mx/" title="radiomax">www.radiomax.com.mx</a>undefined undefinedConsiste básicamente en un <strong>Servidor de Radio</strong> y en un plugin para Winamp donde reproduciremos la música. Ambas aplicaciones las ofrece SHOUTcast.undefined <ul><li> <strong>Web oficial de SHOUTcast: <a target="_blank" href="http://www.shoutcast.com/"> www.shoutcast.com</a></strong></li><li> <strong>Página de downloads SHOUTcast: <a target="_blank" href="http://www.shoutcast.com/download/"> www.shoutcast.com/download/</a></strong></li></ul> undefinedUtilizaremos dos programas:undefined undefined<em><strong>1. SHOUTcast DSP Plug-In for Winamp</strong></em>: es un programa que se acopla al Winamp (plugin) y se usa <span style="font-family: century gothic,Arial,Helvetica">como reproductor y creador de playlists. Se compone de un conjunto de herramientas que toman el sonido reproducido en Winamp para enviarlo al Server.</span>undefined undefined<strong><em>2. SHOUTcast Server:</em></strong> es el programa servidor, que va a enviar a nuestros oyentes el sonido que queremos emitir (<span style="font-family: century gothic,Arial,Helvetica">streaming)</span>.undefined undefinedAmbos programas son gratuitos y pueden estar funcionando en la misma máquina. Para el Server hay versiones disponibles para Win32, FreeBSD, Linux y otros.undefined undefinedEmpecemos:undefined undefined<strong>Paso 1.</strong> Bajar e instalar el “<strong><em>SHOUTcast DSP Plug-In for Winamp</em></strong>” (el 1). Para ello vamos a la Web de SHOUTcast y hacemos click en <a target="_blank" href="http://www.shoutcast.com/download/">download</a>, hacemos click en “<strong>Be a DJ</strong>“, descargamos el “SHOUTcast DSP Plug-In for Winamp”. Para instalarlo simplemente hacemos doble clic y luego Next.undefined undefined<strong>Paso 2.</strong> Bajar e instalar el “<strong>SHOUTcast Server</strong>” (el 2); Para ello en la Web de SHOUTcast pinchamos en <a target="_blank" href="http://www.shoutcast.com/download/">download</a>, hacemos click en “<strong>Be a Server</strong>“, descargamos la última versión de SHOUTcast Server (Download the latest version of SHOUTcast Server). Aceptamos la licencia y pinchamos en “SHOUTcast WIN32 Console/GUI server v1.8.9″ que es el de Windows. Para instalarlo simplemente hacemos doble clic y luego Next.undefined undefined<strong>Paso 3. </strong>Ejecutamos el “<strong><em>SHOUTcast Server</em></strong>” haciendo clic en su icono en Inicio/Programs/”SHOUTcast DNAS (GUI), ahora verás una consola de Windows diciéndote que tu servidor esta preparado para empezar a servir tu música (ver foto). Vemos que aparece un icono en la barra de tareas, eso es que esta activo. Pulsaremos en ‘Edit config’ para modificar la configuración de nuestro servidor. Es interesante cambiar el password y otras configuraciones. El password default es changeme (cambiame en ingles) y es el default del DPS por lo que funcionará sin cambiarlo, pero es conveniente. Con configurar las 3 primeras opciones (Required stuff) será suficiente.undefined undefined<img src="http://www.principiantes.info/images/util/radio.1.jpg" height="438" width="548" border="0" />undefined undefined<strong>Paso 4.</strong> Abrimos WinAmp y configuramos <strong><em>“<a name="plugdownload">SHOUTcast DSP Plug-In for Winamp</a></em></strong>“; para ello abrimos Winamp y vamos al panel de ‘Preferences’ (Ctrl+P) en Plug-ins seleccionamos ‘DSP/Effect’, seleccionamos ‘Nullsoft SHOUTcast Source DSP’, una ventana de SHOUTcast se abrirá.undefined undefined<span style="font-family: Arial,Helvetica; color: rgb(255, 255, 255); font-size: x-small"> <img src="http://www.principiantes.info/images/util/prefs-scplugin.gif" height="361" width="449" /> <img src="http://www.principiantes.info/images/util/crear_1.gif" height="494" width="288" border="0" /></span>undefined undefinedYa está todo preparado para emitir, aunque primero podemos dar un repaso a la configuración:undefined <ul><li>En Output podemos configurar: el equipo donde esta el servidor de radio (localhost si esta en la misma maquina), el Password es el password configurado en el Server que sirve para conectar al Server para emitir y acceder a configuración (cambiar en el servidor y aquí para impedir intrusos), conviene mantener el puerto 8000 que es el default del servidor.</li><li>En Encoder podemos configurar el codec con el que emitiremos, muy recomendado mp3 de no mas de 24kbs ya que cuanto mas alto mas ancho de banda consume.</li><li>En Input podemos indicar la procedencia del sonido: el Winamp o Soundcard Input; este último supongo que por ejemplo para hablar por micrófono o bien para pinchar un disco vinilo cuyo reproductor este conectada a la tarjeta de sonido.</li></ul> undefined<strong>Paso 5.</strong> Vamos a ponernos a emitir. Abrimos el Winamp y se abrirá el SHOUTcast Source. Pulsamos el botón “<strong>connect</strong>“; si el password configurado es el mismo del servidor conectará. Ahora vamos al Winamp y le damos al <strong>Play </strong>para que reproduzca una canción. Veremos que en ‘Status’, se mueve el tiempo y los bytes enviados. Nuestra radio esta emitiendo; en el paso 6 probaremos conectar desde otra máquina.undefined undefined<img src="http://www.principiantes.info/images/util/crear_2.gif" height="494" width="288" border="0" />undefined undefined<strong>Paso 6.</strong> Prueba tu servidor; abre un <span style="text-decoration: underline">reproductor mp3</span> en otro ordenador e intenta conectar con tu servidor, la dirección será algo similar a <a href="http://tu">http://tu</a> IP:puerto/.</p> <p>Prueba la página de tu servidor, abre tu <span style="text-decoration: underline">navegador</span> y ve a <a href="http://tu">http://tu</a> IP:puerto/ , aquí verás información importante sobre tu servidor, para acceso administrativo, haz click en Admin e introduce tu password.</p> <p><span style="text-decoration: underline">Aclaración</span>: ‘tu IP’ se refiere a la IP de la maquina servidor; para que se conecte alguien de Internet deberá ser la IP pública y si es un cliente de tu red local, será tu IP de red. Puerto se refiere al puerto configurado, normalmente el 8000. Si tienes router el puerto 8000 deberás tenerlo abierto. Supongo que estas familiarizado con esto de las IPs y de los puertos.undefined undefined<strong>Nota:</strong></p> <p>Prepara tu sonido para el streaming. Las canciones que pienses emitir has de comprimirlas en mp3 mono a 32 Kbps single-rate (como mucho), ya que así ahorrarás ancho de banda y muchas más personas podrán oir tu radio.</p> <p>Ahora ya solo tienes que darle publicidad, la mejor forma es crear una página Web en la que indiques tu programación y tu horario de emisión, pero recuerda, que no todos tus oyentes viven en la misma franja horaria.</p> <p></span></p> jaalvarez@ipn.mx (unknown) Sun, 08 Nov 2009 00:46:00 -0600 GRUB 2 solo en Ubuntu 9.10 http://www.ipnlinux.org/?module=blog&action=view&id=3&title=grub-2-solo-en-ubuntu-9-10 http://www.ipnlinux.org/?module=blog&action=view&id=3&title=grub-2-solo-en-ubuntu-9-10 <p><p style="text-align: left"><span></span><span><div class="postMeta"></div>undefined<span><div class="postMeta"> By Tognu</div><span><div class="postMeta"> </div> <div class="postBody">Como se indico en el reporte de nuevas caracteristicas de Ubuntu 9.10, el reciente Ubuntu Developer Summit ha servido para debatir muchos de los temas que son importantes en el presente y futuro de Ubuntu. Uno de ellos <strong>hizo relación a Plymouth</strong>, el gestor gráfico de arranque que por lo visto no formará parte de Ubuntu 9.10 Karmic </div></span><div class="postBody">Koala.undefined undefined<a href="http://www.muylinux.com/wp-content/uploads/2009/06/grub-2-1.jpg"><img style="width: 530px; height: 345px" title="grub-2-1" src="http://www.muylinux.com/wp-content/uploads/2009/06/grub-2-1.jpg" alt="grub-2-1" /></a>undefined undefinedEl que sí que parece que <strong>debutará en la próxima edición de Ubuntu será GRUB 2</strong>, el esperado nuevo gestor de arranque que sustituye al tradicional GRUB y que aporta varias novedades.undefined undefined<a href="http://www.muylinux.com/wp-content/uploads/2009/03/103_grub.png"><img title="103_grub" src="http://www.muylinux.com/wp-content/uploads/2009/03/103_grub-500x375.png" alt="103_grub" height="375" width="500" /></a>undefined undefinedEl anuncio oficial de Colin Watson en la <a href="https://lists.ubuntu.com/archives/ubuntu-devel-announce/2009-June/000573.html" target="_blank">lista de correo de Ubuntu</a> deja claro que a partir de hoy mismo las ‘daily builds’ de Ubuntu 9.10 Karmic Koala <strong>harán uso de este nuevo gestor de arranque</strong>, que ya hace tiempo que está en pruebas y <a href="https://wiki.ubuntu.com/KernelTeam/Grub2Testing" target="_blank">documentado en el wiki</a> de Ubuntu.undefined undefinedEntre las mejoras destacan las siguientes:undefined undefined- Soporte para más <strong>sistemas de ficheros</strong>undefined undefined- Soporte de <strong>scripting</strong>undefined undefined- Soporte para la <strong>internacionalización</strong>undefined undefined- Nuevo método para <strong>numerar las particiones</strong> (vaya, ahora que ya estábamos acostumbrados a la de siempre)undefined undefined- Mejor <strong>gestión de memoria</strong>undefined undefined- Soporte de <strong>instalación </strong>para varias plataformasundefined undefined-<strong> Interfaz gráfica de usuario</strong>undefined undefined- <strong>Portable</strong>undefined undefinedNo está mal, y la cosa promete. Los más intrépidos pueden <strong>instalarlo</strong>, pero yo de momento dejaría tranquilo el desarrollo. Eso sí, si alguien lo está probandoundefined </div> <strong></strong>undefined<span></span>undefined</span>undefined</p> <p></span></p> jaalvarez@ipn.mx (unknown) Sun, 08 Nov 2009 00:36:00 -0600