viernes, 5 de junio de 2015

Comando MTR

Mtr (My Trace Route) [MTR98] es una herramienta de diagnóstico de red utilizada en sistemas GNU/Linux, que combina las funcionalidades básicas de las aplicaciones traceroute y ping.Puede ejecutarse tanto desde un terminal o a través de una interfaz gráfica. 

Las opciones más comunes de ejecución de mtr son las siguientes:
  • -c count: envía un número determinado de pings especificados por la variable count.
  • -g: lanza mtr a través de una interfaz gráfica de usuario basada en GTK+.
  • -i seconds: número de segundos transcurridos entre el intervalo de envío de dos pings consecutivos a un mismo salto. El número de segundos se define mediante la variable seconds.
  • -n: no resuelve los nombre de dominio.
  • -r: muestra por pantalla un informe de la traza realizada después del envío de 10 pings seguidos a cada uno de los nodos intermedios existentes entre el origen y el destino. El número de pings enviados se puede modificar utilizando para ellos la opción -c count.
  • HOSTNAME: máquina destino de la traza.


Ejemplo:
mtr 192.168.1.2

miércoles, 3 de junio de 2015

Persistence.xml y servidor mysql

Once GlassFish is installed, make sure it can access MySQL Connector/J. To do this, copy the MySQL Connector/J jar file to the domain-dir/lib directory. For example, copy mysql-connector-java-5.1.30-bin.jar toC:\glassfish-install-path\domains\domain-name\lib. Restart the GlassFish Application Server. For more information, see Integrating the JDBC Driver in GlassFish Server Open Source Edition Administration Guide, available at GlassFish Server Documentation.
You are now ready to create JDBC Connection Pools and JDBC Resources.
Creating a Connection Pool
  1. In the GlassFish Administration Console, using the navigation tree navigate to ResourcesJDBCConnection Pools.
  2. In the JDBC Connection Pools frame click New. You will enter a two step wizard.
  3. In the Name field under General Settings enter the name for the connection pool, for example enter MySQLConnPool.
  4. In the Resource Type field, select javax.sql.DataSource from the drop-down listbox.
  5. In the Database Vendor field, select MySQL from the drop-down listbox. Click Next to go to the next page of the wizard.
  6. You can accept the default settings for General Settings, Pool Settings and Transactions for this example. Scroll down to Additional Properties.
  7. In Additional Properties you will need to ensure the following properties are set:
    • ServerName - The server to connect to. For local testing this will be localhost.
    • User - The user name with which to connect to MySQL.
    • Password - The corresponding password for the user.
    • DatabaseName - The database to connect to, for example the sample MySQL database World.
  8. Click Finish to exit the wizard. You will be taken to the JDBC Connection Pools page where all current connection pools, including the one you just created, will be displayed.
  9. In the JDBC Connection Pools frame click on the connection pool you just created. Here, you can review and edit information about the connection pool. Because Connector/J does not support optimized validation queries, go to the Advanced tab, and under Connection Validation, configure the following settings:
    • Connection Validation - select Required.
    • Validation Method - select table from the drop-down menu.
    • Table Name - enter DUAL.
  10. To test your connection pool click the Ping button at the top of the frame. A message will be displayed confirming correct operation or otherwise. If an error message is received recheck the previous steps, and ensure that MySQL Connector/J has been correctly copied into the previously specified location.
Now that you have created a connection pool you will also need to create a JDBC Resource (data source) for use by your application.
Creating a JDBC Resource
Your Java application will usually reference a data source object to establish a connection with the database. This needs to be created first using the following procedure.
  • Using the navigation tree in the GlassFish Administration Console, navigate to ResourcesJDBCJDBC Resources. A list of resources will be displayed in the JDBC Resources frame.
  • Click New. The New JDBC Resource frame will be displayed.
  • In the JNDI Name field, enter the JNDI name that will be used to access this resource, for example enter jdbc/MySQLDataSource.
  • In the Pool Name field, select a connection pool you want this resource to use from the drop-down listbox.
  • Optionally, you can enter a description into the Description field.
  • Additional properties can be added if required.
  • Click OK to create the new JDBC resource. The JDBC Resources frame will list all available JDBC Resources.

jueves, 16 de abril de 2015

Speedtest linux centos

Speedtest-cli is a small command line application meant for testingyour internet speeds via Terminal in various Linux distributions including CentOS, Fedora, Ubuntu and Mint. Speedtest-cli uses thespeedtest.net website for testing your internet bandwidth. Installation is rather simple. Launch Terminal in your linux distribution and copy paste the following commands
# wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
# chmod +x speedtest_cli.py
Run an internet speed test with the following command:
# ./speedtest_cli.py
speedtest-cli If you want to share the speed test result, you can use “–share” option, which will allow you to share speed test result with others in an image format via Speedtest.net.
# ./speedtest_cli.py --share
speedtest-cli-shareThe following is a sample image automatically generated and uploaded to Speedtest.net by speedtest-cli.
3225139972
The utility supports a few other parameters, and you can view them by running the speedtest-cli.py –help command.
# ./speedtest_cli.py --help
./speedtest_cli.py --help
Usage: speedtest_cli.py [options]

Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------

https://github.com/sivel/speedtest-cli

Options:
  -h, --help       show this help message and exit
  --share          Generate and provide a URL to the speedtest.net share
                   results image
  --simple         Suppress verbose output, only show basic information
  --list           Display a list of speedtest.net servers sorted by distance
  --server=SERVER  Specify a server ID to test against
  --mini=MINI      URL of the Speedtest Mini server
  --source=SOURCE  Source IP address to bind to
  --version        Show the version number and exit


Fuente: http://lintut.com/test-internet-speed-from-linux-command-line/