This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SshConector { | |
//variables | |
protected String host, user, password, consoleMessage; //variables to connect | |
protected Session session; | |
protected int port=22; //ssh port | |
//ssh connection | |
private JSch jschChannel; | |
private int intTimeOut = 60000; //timeout for connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LISTADO DE COMANDOS LINUX ÚTILES PARA SysAdmin | |
* inxi -Fxn => Muestra la información principal del equipo (https://www.comoinstalarlinux.com/inxi-un-comando-linux-para-saber-mucho-de-tu-eqiuipo/) | |
* eject -r => Expulsa el CD (No muy util pero sirve para trollear a otro por ssh) | |
* lsb_release -a => Conocer versión sistema | |
* df -h => muestra la capacidad de memoria de los dispositivos del sistema y su uso | |
* du -sh => muestra la capacidad de disco utilizada en el directorio actual | |
* lsblk -fm => estructura de particiones y HDD | |
* iptables -L => Listado de Ip tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#include <QNetworkInterface> en cabecera | |
QString ClientUdp::getMacAddress() { | |
foreach(QNetworkInterface netInterface, QNetworkInterface::allInterfaces()) { | |
// Devuelve solo la primera dirección MAC que no sea de loopback | |
if (!(netInterface.flags() & QNetworkInterface::IsLoopBack)) | |
return netInterface.hardwareAddress(); | |
qDebug() << "obteniendo dirección MAC"; | |
} | |
return QString(); | |
}//funcion para obtener la direccion MAC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package ejercicio8bdoracle; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Component; | |
import java.beans.SimpleBeanInfo; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import javax.accessibility.Accessible; | |
import javax.swing.JTable; | |
import javax.swing.Scrollable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*METODO RECURSIVO PARA LEER XML*/ | |
/*Method to read XML file recursively*/ | |
private void startReader(Node nodeEntry) { | |
NodeList nodeList = nodeEntry.getChildNodes(); | |
for (int i=0; i<nodeList.getLength(); i++) { | |
//get the item | |
Node node = nodeList.item(i); | |
if (node.getNodeType()== Node.ELEMENT_NODE) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
import javax.swing.JOptionPane; | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## make a backup from whole folder entry by argument## | |
## $1 only could be a folder or file ## | |
## For desscompress use tar -xvf file.tar.gz ## | |
actualDate=$(date +"%Y-%m-%d") | |
errorState=$? | |
folderPath="/home/manrique/BACKUPS" | |
tar -zcvf $folderPath/$1-$actualDate.tar.gz $1 | |
##Check errors | |
if [ $errorState -eq 0 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* EventosRaton.java | |
* | |
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz> | |
* | |
*/ | |
import java.awt.*; | |
import java.awt.event.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* FocusEvent.java | |
* | |
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz> | |
* | |
* | |
*/ | |
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; |
NewerOlder