elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


  Mostrar Temas
Páginas: 1 2 [3] 4 5 6 7 8 9
21  Sistemas Operativos / Windows / No se reconoce Micro SD en: 14 Enero 2014, 19:33 pm
Hola.

Tengo un celular Samsung ACE GT-S5830M
Me había estado dando problemas con la memoria micro sd, así que busque un poco para solucionarlo pero resultó peor.

Utilicé un programa llamado "Hard Disk Low Level Format Tool" desde windows y al momento de volver al movil para verificar me encuentro con la sorpresa de que no reconoce la micro sd, solo muestra el mensaje "Tarjeta de memoria vacia" entonces selecciono esa opción y aparece un cuadro que dice:
"Formatear tarjeta de memoria", la formateo pero queda igual.

Al conectar al pc tampoco aparece en los dispositivos de almacenamiento (en equipo)

Pero en el administrador de dispositivos si aparece, desde ahí he tratado de desintralar el controlador y volver a instalarlo.
También ahi mismo trate de rellenar el volumen pero tampoco funciona.

En el administrador de discos tampoco se muestra activo, traté cambiar el nombre del volumen pero no funciona.

Obteniendo la letra del volumen desde el administrador de discos, intenté formatear desde consola pero no reconoce el volumen.

Alguna idea?


Gracias
22  Foros Generales / Foro Libre / Un programador enseña su oficio a un ... en: 24 Octubre 2013, 00:41 am
Un programador enseña su oficio a un sintecho en cuatro semanas

Patrick McColongue, programador neoyorquino, decidió ofrecer a Leo la oportunidad de aprender a programar para poder así salir de la calle.

http://s.libertaddigital.com/fotos/noticias/650/0/programar-sintecho-portada-08102013.jpg

"The Journeyman Hacker", así es como llamaba Patrick McColongue a Leo antes de conocerle. McColongue, un joven programador que vive y trabaja en New York, ha conseguido desarrollar con éxito un pequeño experimento que consiste en enseñar a Leo, un sintecho de apenas 28 años, a programar en un mes para que éste pueda así ganarse la vida. La noticia ha dado la vuelta al mundo, tras la entrevista realizada a la Leo por el portal de noticias Business Insider.

Diariamente, Patrick McColongue se cruzaba con Leo en su camino al trabajo, cerca del rió Hudson, cuando una mañana el joven informático se decidió a realizar su ansiado proyecto. "Soy programador, te ofrezco dos opciones: Volver mañana y darte 100 dólares en efectivo, o bien te doy tres libros de javascript (principiante, avanzado, experto), un ordenador portátil y me comprometo a venir todos los días, una hora antes de trabajar, para enseñarte a programar".

El joven Leo que ya tiene más de 29.000 seguidores en Facebook, se muestra inquieto en los asuntos medioambientales y focaliza su atención en futuros proyectos relacionados con la energía solar o la mejora de la eficiencia del transporte público.

Noticia completa:
http://www.libertaddigital.com/ciencia-tecnologia/tecnologia/2013-10-08/un-programador-ensena-su-oficio-a-un-sintecho-en-cuatro-semanas-1276501256/
23  Foros Generales / Foro Libre / Cobrar impuesto por uso y explotación del Sol en: 10 Octubre 2013, 16:51 pm
Cobrar impuesto por uso y explotación del Sol, la propuesta que indigna a España

Las personas que instalaron paneles solares en España para reducir sus costos de energía enfrentan impuestos por generar su propia electricidad. El sector de energía renovable está paralizado ante la propuesta.

Seremos el único país en el mundo que cobre por el uso del sol', dice Jaume Serrasolses.
'Están pasando cosas extrañas en España. Ésta es una de ellas'.
Serrasolses, secretario de la Asociación de Servicios Energéticos Básicos Autónomos, SEBA, que promueve el uso de energía solar en España, se refiere a la propuesta del gobierno de grabar un impuesto únicamente para aquellos que generan su propia electricidad.


Quedarían pagando dos impuestos: un peaje de respaldo por el uso de energía auxiliar para sus paneles solares en caso de que fallen y, otro, un peaje de acceso que paga todo el que consume electricidad del tendido convencional.

Fuente:
http://www.diariocambio.com.mx/2013/secciones/internacional/item/29410-cobrar-impuesto-por-uso-y-explotacion-del-sol-la-propuesta-que-indigna-a-espana



Me pregunto si tiene que ver con esta persona.

http://www.veoverde.com/2012/12/supuesta-duena-del-sol-quiere-que-le-paguen-por-su-uso/

Alguno tiene paneles solares en casa?.
24  Programación / Desarrollo Web / Problema al instalar idioma español en SMF 2.0 [Solucionado] en: 28 Septiembre 2013, 01:13 am
Instalé el idioma español a SMF 2.0 en el servidor local sin problemas.

Estoy tratando de hacer lo mismo pero en el servidor del proveedor.

Se muestra el siguiente mensaje.
Citar
FTP Information Required

Some of the files the package manager needs to modify are not writable. This needs to be changed by logging into FTP and using it to chmod or create the files and folders. Your FTP information may be temporarily cached for proper operation of the package manager. Note you can also do this manually using an FTP client - to view a list of the affected files please click here.

FTP Server: localhost Port: 21
Username: usuario
Password: C0ntra$3na
Local path to SMF:

En la parte de Local path to SMF intenté de las siguientes formas:
/public_html/foro/
/home/universo/domains/midominio.com/public_html/foro/


También intenté creando solo las carpetas y cambiando los permisos de las carpetas o archivos necesarios, haciendo esto deja de mostrarse el mensaje anterior (FTP Information Required).

Utilizo filezilla para cambiar los permisos de los archivos y carpetas, el valor numérico es 777 y selecciono la opción "incluir todos los subdirectorios"

Intentando de ambas formas solo me vuelve a regresar a la misma página sin mostrar algún mensaje.


Cómo podría solucionarlo?, hay alguna otra forma de instalar el idioma?.
Busqué en el foro pero no encontré nada que pueda ayudarme.

Gracias!

Edito:

Solucionado!

Con los pasos anteriores utilizaba Chrome Versión 29 (29.0.1547.76)
Utilicé Internet Explorer Versión: 10 (10.0.9200.16686) y no tuve problemas para instalar el idioma.


Edito nuevamente el tema para decir que esa solución fue momentanea, porque accidentalmente elimine los archivos de smf y tuve que volver a configurar, tuve el problema nuevamente con los idiomas pero en esta ocasión no pude instalarlo con IE  ahora fue con Chrome  con el que pude instalar :¬¬

Saludos.
25  Seguridad Informática / Nivel Web / Libro para aprender seguridad web? en: 4 Septiembre 2013, 17:03 pm
Hola.
Hace una semana me inicie el tema de seguridad web.
Me gustaría ser un buen auditor tanto para aprender a proteger mis apps como para encontrar vulnerabilidades en otras  ;D

Verán al día pierdo al rededor de 3.5 horas en transporte  :¬¬ y he pensado aprovechar ese tiempo para leer un buen libro, aunque también apoyarme de internet.

No creo que haya un libro que se compare con el contenido que hay en la web (sobre todo en la parte de ejemplos o ejercicios)
Estuve investigando algunos libros y encontré estos.

The Web Aplications Hackers Handbook
SQL Injection Attack and Defense
Hacking de Aplicaciones Web: SQL Injection

Si alguien ha leído un libro me gustaría que me lo recomendara.
Aunque mi idea al inicio era comprar una tablet pero por el momento no alcanza el presupuesto así que como segunda opción está el libro para aprovechar ese lapso de tiempo sin ocupar.

Mi intención no es entrar a destruir sistemas, sino aprender lo más que se pueda sobre seguridad.

Tengo conocimientos en html, javascript, php, ajax, jquery, sql

Gracias
26  Informática / Software / Guardar mensajes enviados (desde servicio de correo) en cliente de correo? en: 3 Septiembre 2013, 00:05 am
Hola.
Existe alguna forma de guardar los mensajes que se encuentran en la carpeta de enviados de los servicios de hotmail, gmail o yahoo en un cliente de correo como outlook, thunderbird o cualquier otro?.

Necesito bajar mi información, tanto de correos en bandeja como enviados pero no sé si es posible.

Hay algun método para hacer esto?.

Gracias
27  Programación / Java / [Aporte] Shutdown en diferentes Plataformas. en: 30 Agosto 2013, 19:58 pm
JDShutdown v1
Descripción: Aplicación que permite establecer una hora y apagar el sistema una vez transcurrido el tiempo.
Autor: 1mpuls0

Entorno de desarrollo
IDE: Netbeans 7.01
JDK: 1.7.0
SO: Windows 7

Plataformas de prueba
Windows
Linux
Mac

Estoy tratando de mejorar y optimizar el código, solo se utilizan librerías propias de java.
Cualquier sugerencia o recomendación es bienvenida, así como también si tienen dudas pueden consultarlo.

Clase: JDShutdown
Código
  1. /*
  2.  * Autor: 1mpuls0
  3.  */
  4. package projects;
  5.  
  6. import javax.swing.JFrame;
  7. import javax.swing.JPanel;
  8. import javax.swing.WindowConstants;
  9. import javax.swing.JOptionPane;
  10. import javax.swing.JLabel;
  11. import javax.swing.JButton;
  12. import javax.swing.JTextField;
  13. import java.awt.event.ActionListener;
  14. import java.awt.event.ActionEvent;
  15. import javax.swing.BorderFactory;
  16. import java.awt.Font;
  17. import java.awt.FlowLayout;
  18. import java.awt.BorderLayout;
  19. import java.awt.event.WindowAdapter;
  20. import java.awt.event.WindowEvent;
  21. import java.util.logging.Level;
  22. import java.util.logging.Logger;
  23. import java.awt.event.KeyListener;
  24. import java.awt.event.KeyEvent;
  25. import java.util.Date;
  26.  
  27. import projects.date.DateTime;
  28. import projects.actions.Shutdown;
  29.  
  30. import java.util.regex.Matcher;
  31. import java.util.regex.Pattern;
  32.  
  33. public class JDShutdown extends JFrame implements KeyListener, ActionListener  {
  34.  
  35.    private JPanel panelPrincipal;
  36.    private JPanel panelCurrentDate;
  37.    private JLabel labelCurrentDate;
  38.    private JPanel panelLastDate;
  39.    private JTextField textFieldDate;
  40.    private JTextField textFieldTime;
  41.    private JButton buttonStart;
  42.    private JButton buttonCancel;
  43.    private JPanel panelActions;
  44.    private DateTime date;
  45.    private Shutdown threadShutdown;
  46.  
  47.  
  48.    public static void main(String args[]) {
  49.        JDShutdown jds = new JDShutdown();
  50.        jds.setVisible(true);
  51.        jds.setLocationRelativeTo(null);
  52.    }
  53.  
  54.    public JDShutdown() {
  55.        panelPrincipal = new JPanel();
  56.        panelCurrentDate = new JPanel();
  57.        labelCurrentDate = new JLabel();
  58.        panelLastDate = new JPanel();
  59.        textFieldDate = new JTextField();
  60.        textFieldTime = new JTextField();
  61.        panelActions = new JPanel();
  62.        buttonStart = new JButton();
  63.        buttonCancel = new JButton();
  64.        date = new DateTime();
  65.  
  66.  
  67.        setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  68.        setTitle("JDShutdown V1");
  69.        getContentPane().setLayout(new FlowLayout());
  70.        setResizable(false);
  71.  
  72.        panelPrincipal.setLayout(new BorderLayout());
  73.  
  74.        panelCurrentDate.setBorder(BorderFactory.createTitledBorder("Fecha y hora de inicio"));
  75.  
  76.        labelCurrentDate.setFont(new Font("Tahoma", 0, 24));
  77.        panelCurrentDate.add(labelCurrentDate);
  78.  
  79.        panelPrincipal.add(panelCurrentDate, BorderLayout.PAGE_START);
  80.  
  81.        panelLastDate.setBorder(BorderFactory.createTitledBorder("Fecha y hora de apagado"));
  82.  
  83.        textFieldDate.setColumns(10);
  84.        textFieldDate.setText(date.getCurrentDate().substring(0, 10));
  85.        textFieldDate.addKeyListener(this);
  86.  
  87.        textFieldTime.setColumns(10);
  88.        labelCurrentDate.setText("--/--/---- --:--");
  89.        textFieldTime.addKeyListener(this);
  90.  
  91.        panelLastDate.add(textFieldDate);
  92.        panelLastDate.add(textFieldTime);
  93.        //addDateMask();
  94.  
  95.        panelPrincipal.add(panelLastDate, BorderLayout.CENTER);
  96.  
  97.        panelActions.setBorder(BorderFactory.createTitledBorder("Acciones"));
  98.  
  99.        buttonStart.setText("Iniciar");
  100.        buttonStart.addActionListener(this);
  101.        panelActions.add(buttonStart);
  102.  
  103.        buttonCancel.setText("Cancelar");
  104.        buttonCancel.addActionListener(this);
  105.        buttonCancel.setEnabled(false);
  106.        panelActions.add(buttonCancel);
  107.  
  108.        panelPrincipal.add(panelActions, BorderLayout.PAGE_END);
  109.  
  110.        getContentPane().add(panelPrincipal);
  111.  
  112.        addWindowListener(new AppAdapter());
  113.  
  114.        pack();
  115.    }
  116.  
  117.    private void exit() {
  118.        try {
  119.            int salida = JOptionPane.showConfirmDialog(null, (char)191+"Desea salir?", "Salida", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
  120.            if(salida == JOptionPane.YES_OPTION) {
  121.                setVisible( false );
  122.                dispose();
  123.                System.exit(0);
  124.            }
  125.        } catch(NullPointerException npe) {
  126.            Logger.getLogger(getClass().getName()).log(
  127.            Level.ALL, "Error...", npe);
  128.        }
  129.    }
  130.  
  131.    public void actionPerformed(ActionEvent evt) {
  132.        Object src = evt.getSource();
  133.        if (src == buttonStart) {
  134.            String lastDate = textFieldDate.getText();
  135.            textFieldTime.setText(date.completeTime(textFieldTime.getText()));
  136.            String lastTime = textFieldTime.getText();
  137.  
  138.            if(date.isDateValid(lastDate)) {
  139.                if(date.isTimeValid(lastTime)) {
  140.                    Date currentDateTime = date.getCurrentDateTime();
  141.                    Date lastDateTime = date.stringToDate(lastDate + " " + lastTime);
  142.                    long milisecondsOfDifference = date.differenceTime(currentDateTime, lastDateTime);
  143.                    if(milisecondsOfDifference > 6000 ) {
  144.                        labelCurrentDate.setText(String.valueOf(date.getCurrentDate()));
  145.                        buttonStart.setEnabled(false);
  146.                        buttonCancel.setEnabled(true);
  147.                        textFieldTime.setEditable(false);
  148.                        threadShutdown = new Shutdown(milisecondsOfDifference);
  149.                    } else {
  150.                        labelCurrentDate.setText("--/--/---- --:--");
  151.                        JOptionPane.showMessageDialog(null, "Verifica la hora.\n Coloca una hora con minimo un minuto de diferencia mas a la hora actual.", "Hora no valida", JOptionPane.WARNING_MESSAGE);
  152.                    }
  153.                }else {
  154.                    labelCurrentDate.setText("--/--/---- --:--");
  155.                    JOptionPane.showMessageDialog(null, "Verifica la hora", "Hora no valida", JOptionPane.ERROR_MESSAGE);
  156.                }
  157.            } else {
  158.                labelCurrentDate.setText("--/--/---- --:--");
  159.                JOptionPane.showMessageDialog(null, "Verifica la fecha", "Fecha no valida", JOptionPane.ERROR_MESSAGE);
  160.            }
  161.  
  162.        } else if (src == buttonCancel) {
  163.            threadShutdown.stop();
  164.            buttonStart.setEnabled(true);
  165.            buttonCancel.setEnabled(false);
  166.            textFieldTime.setEditable(true);
  167.        }
  168.    }
  169.  
  170.    public void keyTyped(KeyEvent evt) {
  171.        Object src = evt.getSource();
  172.        char caracter = evt.getKeyChar();
  173.        if (src == textFieldDate) {
  174.            if( ((caracter < '0') ||(caracter > '9')) && (caracter != '/') || textFieldDate.getText().length()== 10 )
  175.                evt.consume();
  176.            if((textFieldDate.getText().length()==2 || textFieldDate.getText().length()==5) && (caracter != '/'))
  177.                evt.consume();
  178.        } else if(src == textFieldTime) {
  179.            if( ((caracter < '0') ||(caracter > '9')) && (caracter != ':') || textFieldTime.getText().length()== 8 )
  180.                evt.consume();
  181.            if((textFieldTime.getText().length()==2 || textFieldTime.getText().length()==5) && (caracter != ':'))
  182.                evt.consume();
  183.        }
  184.    }
  185.  
  186.    public void keyPressed(KeyEvent evt) {      
  187.    }
  188.  
  189.    public void keyReleased(KeyEvent evt) {      
  190.    }
  191.  
  192.    class AppAdapter extends WindowAdapter {
  193.        public void windowClosing(WindowEvent event) {
  194.            exit();
  195.        }
  196.    }
  197. }
  198.  

Clase: DateTime
Código
  1. /*
  2.  * Autor: 1mpuls0
  3.  */
  4. package projects.date;
  5.  
  6. import java.text.SimpleDateFormat;
  7. import java.util.Date;
  8. import java.text.DateFormat;
  9. import java.text.ParseException;
  10. import java.util.logging.Level;
  11. import java.util.logging.Logger;
  12.  
  13. public class DateTime {
  14.  
  15.    private final String FORMAT = "dd/MM/yyyy HH:mm:ss";
  16.  
  17.    public long differenceTime(Date currentDate, Date lastDate) {
  18.        long msDifference = 0;
  19.        long msCurrentDate = currentDate.getTime();
  20.        long msLastDate = lastDate.getTime();
  21.        if(msLastDate>msCurrentDate)
  22.            msDifference = Math.abs(msCurrentDate - msLastDate);
  23.        return msDifference;
  24.    }
  25.  
  26.    public Date getCurrentDateTime() {
  27.        String currentDate;
  28.        SimpleDateFormat dateFormat = new SimpleDateFormat(FORMAT);
  29.        Date date = new Date();
  30.        currentDate = dateFormat.format(date);
  31.        try {
  32.            dateFormat.parse(currentDate);
  33.        } catch (ParseException ex) {
  34.            Logger.getLogger(getClass().getName()).log(
  35.            Level.ALL, "Error...", ex);
  36.        }
  37.        return date;
  38.    }
  39.  
  40.    public String getCurrentDate() {
  41.        String currentDate = "";
  42.        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  43.        Date date = new Date();
  44.        try {
  45.            currentDate = dateFormat.format(date);
  46.  
  47.        } catch(NullPointerException npe) {
  48.            Logger.getLogger(getClass().getName()).log(
  49.            Level.ALL, "Error...", npe);
  50.        }
  51.        return currentDate;
  52.    }
  53.  
  54.    public Date stringToDate(String strDate) {
  55.        SimpleDateFormat format = new SimpleDateFormat(FORMAT);
  56.        Date date = null;
  57.        try {
  58.            date = format.parse(strDate);
  59.        } catch (ParseException pe) {
  60.            Logger.getLogger(getClass().getName()).log(
  61.            Level.ALL, "Error...", pe);
  62.        }
  63.        return date;
  64.    }
  65.  
  66.    public boolean isDateValid(String strDate) {
  67.         try {
  68.            DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
  69.            df.setLenient(false);
  70.            df.parse(strDate);
  71.            return true;
  72.        } catch (ParseException pe) {
  73.            Logger.getLogger(getClass().getName()).log(
  74.            Level.ALL, "Error...", pe);
  75.            return false;
  76.        }
  77.    }
  78.  
  79.    public boolean isTimeValid(String strDate) {
  80.        try {
  81.            DateFormat df = new SimpleDateFormat("HH:mm:ss");
  82.            df.setLenient(false);
  83.            df.parse(strDate);
  84.            return true;
  85.        } catch (ParseException pe) {
  86.            Logger.getLogger(getClass().getName()).log(
  87.            Level.ALL, "Error...", pe);
  88.            return false;
  89.        }
  90.    }
  91.  
  92.    public String completeTime(String strTime) {
  93.        if(strTime.length()==4 && strTime.charAt(3)<'9') {
  94.            strTime = strTime.substring(0, 3) + "0" + strTime.substring(3) + ":00";
  95.        }
  96.  
  97.        if(strTime.length()==5) {
  98.            strTime+=":00";
  99.        }
  100.  
  101.        if(strTime.length()==7 && strTime.charAt(6)<'9') {
  102.            strTime = strTime.substring(0, 6) + "0" + strTime.substring(6);
  103.        }
  104.        return strTime;
  105.    }
  106. }
  107.  

Clase: OperatingSystem
Código
  1. package projects.information;
  2.  
  3. public class OperatingSystem {
  4.    //The prefix String for all Windows OS.
  5.    private static final String OS_NAME_WINDOWS_PREFIX = "Windows";
  6.  
  7.    //The {@code os.name} System Property. Operating system name.
  8.    public static final String OS_NAME = getSystemProperty("os.name");
  9.    //The {@code os.version} System Property. Operating system version.
  10.    public static final String OS_VERSION = getSystemProperty("os.version");
  11.  
  12.    //Is {@code true} if this is AIX.
  13.    public static final boolean IS_OS_AIX = getOSMatchesName("AIX");
  14.    //Is {@code true} if this is HP-UX.
  15.    public static final boolean IS_OS_HP_UX = getOSMatchesName("HP-UX");
  16.    //Is {@code true} if this is Irix.
  17.    public static final boolean IS_OS_IRIX = getOSMatchesName("Irix");
  18.    //Is {@code true} if this is Linux.
  19.    public static final boolean IS_OS_LINUX = getOSMatchesName("Linux") || getOSMatchesName("LINUX");
  20.    //Is {@code true} if this is Mac.
  21.    public static final boolean IS_OS_MAC = getOSMatchesName("Mac");
  22.    //Is {@code true} if this is Mac.
  23.    public static final boolean IS_OS_MAC_OSX = getOSMatchesName("Mac OS X");
  24.    //Is {@code true} if this is FreeBSD.
  25.    public static final boolean IS_OS_FREE_BSD = getOSMatchesName("FreeBSD");
  26.    //Is {@code true} if this is OpenBSD.
  27.    public static final boolean IS_OS_OPEN_BSD = getOSMatchesName("OpenBSD");
  28.    //Is {@code true} if this is NetBSD.
  29.    public static final boolean IS_OS_NET_BSD = getOSMatchesName("NetBSD");
  30.    //Is {@code true} if this is OS/2.
  31.    public static final boolean IS_OS_OS2 = getOSMatchesName("OS/2");
  32.    //Is {@code true} if this is Solaris.
  33.    public static final boolean IS_OS_SOLARIS = getOSMatchesName("Solaris");
  34.    //Is {@code true} if this is SunOS.
  35.    public static final boolean IS_OS_SUN_OS = getOSMatchesName("SunOS");
  36.  
  37.    //Is {@code true} if this is a UNIX like system, as in any of AIX, HP-UX, Irix, Linux, MacOSX, Solaris or SUN OS.
  38.    public static final boolean IS_OS_UNIX = IS_OS_AIX || IS_OS_HP_UX || IS_OS_IRIX || IS_OS_LINUX || IS_OS_MAC_OSX
  39.            || IS_OS_SOLARIS || IS_OS_SUN_OS || IS_OS_FREE_BSD || IS_OS_OPEN_BSD || IS_OS_NET_BSD;
  40.  
  41.  
  42.    //Is {@code true} if this is Windows.
  43.    public static final boolean IS_OS_WINDOWS = getOSMatchesName(OS_NAME_WINDOWS_PREFIX);
  44.  
  45.    //Gets a System property, defaulting to {@code null} if the property cannot be read.
  46.    private static String getSystemProperty(String property) {
  47.        try {
  48.            return System.getProperty(property);
  49.        } catch (SecurityException ex) {
  50.            // we are not allowed to look at this property
  51.            System.err.println("Caught a SecurityException reading the system property '" + property
  52.                    + "'; the SystemUtils property value will default to null.");
  53.            return null;
  54.        }
  55.    }
  56.  
  57.    //Decides if the operating system matches.
  58.    private static boolean getOSMatchesName(String osNamePrefix) {
  59.        return isOSNameMatch(OS_NAME, osNamePrefix);
  60.    }
  61.  
  62.    //Decides if the operating system matches.
  63.    static boolean isOSNameMatch(String osName, String osNamePrefix) {
  64.        if (osName == null) {
  65.            return false;
  66.        }
  67.        return osName.startsWith(osNamePrefix);
  68.    }
  69.  
  70.    static boolean isOSMatch(String osName, String osVersion, String osNamePrefix, String osVersionPrefix) {
  71.        if (osName == null || osVersion == null) {
  72.            return false;
  73.        }
  74.        return osName.startsWith(osNamePrefix) && osVersion.startsWith(osVersionPrefix);
  75.    }    
  76. }
  77.  
  78.  

Clase: Shutdown
Código
  1. /*
  2.  * Autor: 1mpuls0
  3.  */
  4. package projects.actions;
  5.  
  6. import java.io.IOException;
  7. import java.util.logging.Level;
  8. import java.util.logging.Logger;
  9.  
  10. import projects.information.OperatingSystem;
  11.  
  12. public class Shutdown implements Runnable {
  13.  
  14.    private final Thread thread;
  15.    private long timeDifference = 0;
  16.    private OperatingSystem sys;
  17.  
  18.    public Shutdown(long timeDifference) {
  19.        this.timeDifference = timeDifference;
  20.        thread = new Thread(this);
  21.        thread.start();
  22.    }
  23.  
  24.    private void process(long time) {
  25.        System.out.println("APAGATE!!!");
  26.        String shutdownCommand = null;
  27.  
  28.        if(sys.IS_OS_AIX)
  29.            shutdownCommand = "shutdown -Fh " + time;
  30.        else if(sys.IS_OS_FREE_BSD || sys.IS_OS_LINUX || sys.IS_OS_MAC|| sys.IS_OS_MAC_OSX || sys.IS_OS_NET_BSD || sys.IS_OS_OPEN_BSD || sys.IS_OS_UNIX)
  31.            shutdownCommand = "shutdown -h " + time;
  32.        else if(sys.IS_OS_HP_UX)
  33.            shutdownCommand = "shutdown -hy " + time;
  34.        else if(sys.IS_OS_IRIX)
  35.            shutdownCommand = "shutdown -y -g " + time;
  36.        else if(sys.IS_OS_SOLARIS || sys.IS_OS_SUN_OS)
  37.            shutdownCommand = "shutdown -y -i5 -g" + time;
  38.        else if(sys.IS_OS_WINDOWS)
  39.            shutdownCommand = "shutdown.exe -s -t " + time;
  40.  
  41.        try {
  42.            Runtime.getRuntime().exec(shutdownCommand);
  43.        }catch(IOException ioe) {
  44.            Logger.getLogger(getClass().getName()).log(
  45.            Level.ALL, "Error...", ioe);
  46.            javax.swing.JOptionPane.showMessageDialog(null, "No se pudo apagar", "Comando no aceptado", javax.swing.JOptionPane.ERROR_MESSAGE);
  47.        }
  48.    }
  49.  
  50.    public void run() {
  51.        try {
  52.            thread.sleep(timeDifference);
  53.            process(0);
  54.        }
  55.        catch (InterruptedException ie) {
  56.            Logger.getLogger(getClass().getName()).log(
  57.            Level.ALL, "Error...", ie);
  58.        }
  59.    }
  60.  
  61.    public void stop() {
  62.        thread.stop();
  63.    }
  64. }
  65.  
28  Foros Generales / Dudas Generales / Diferencia entre KB/s y KBps? en: 28 Agosto 2013, 22:09 pm
Entiendo que:
1 byte = 8 bits
1 kb = 1, 000 bits
1024 bytes = 1 KB (o kB) (un kilobyte)

No voy a dar nombres pero un usuario del foro me comentó que:
1 kbps  = 0.125 kb/s

Segun lo que sé:
1 kbps = 1 kb/s
y
1 KBps = 1 KB/s

Esto hace que me genere duda entre lo que conozco y mi pregunta es:
¿Cual es la diferencia entre KBps y KB/s?

Mi intención no es quedar mal con este usuario, al contrario lo admiro y respeto mucho pero no quiero quedarme con la duda.

Gracias
29  Foros Generales / Sugerencias y dudas sobre el Foro / Crear página de ayuda inicial. en: 24 Julio 2013, 17:08 pm
Hola.

Con el fin de disminuir

contenido como el siguiente:
https://foro.elhacker.net/java/ejercicio_java_en_netbeans-t395410.0.html

títulos como este:
https://foro.elhacker.net/desarrollo_web/auxilio-t394792.0.html

Sugiero que se debe crear un página la cual se muestre después del registro del usuario, el contenido de dicha página serán temas que ya existen en el foro, como un tipo intro de ayuda. Por ejemplo.


Citar
Bienvenido al foro elhacker.net

Con el fin de mejorar el contenido del foro y proporcionar una mejor ayuda sugerimos leer los siguientes temas:

Reglas del foro:
https://foro.elhacker.net/sugerencias_y_dudas_sobre_el_foro/caren_v10_reglamento_de_convivencia_y_contenido-t17721.0.html

Antes de preguntar sobre un tema utiliza el buscador:
https://foro.elhacker.net/search.html

Presentate:
https://foro.elhacker.net/foro_libre/presentate_aqui_si_eres_nuevo-t162515.0.html

Diseño del foro:
https://foro.elhacker.net/help.html

Leer las reglas de cada subforo:


Sugerencias para el foro:
https://foro.elhacker.net/sugerencias_y_dudas_sobre_el_foro-b10.0/

Esto solo son algunos temas principales, se podrían agregar más que se consideren importantes para iniciar en el foro.

Opino que ayudará un poco a mantener limpio el foro además esto podría ayudar a que los moderadores y compañeros se ahorren un poco de trabajo.

Procedimiento:
Un nuevo usuario se registra.
Inmediatamente después del registro aparece esta página, ahora el usuario tiene como una "guía" para hacer una búsqueda antes de iniciar un tema que posiblemente ya existe, iniciar un tema nuevo, conocer las reglas, etc.

Porque, qué es lo primero que hace un nuevo usuario que necesita ayuda?.
Se registra e inmediatamente publica su tema.

Así que considerando esto, se puede decir que el usuario puede omitir o simplemente no leer la página posterior al registro.
Entonces ahora sugiero que si no han pasado más de cierto tiempo (10 minutos por ejemplo) el usuario no pueda crear un tema nuevo o que muestre un mensaje de leer reglas.

Aunque también podría ser un poco inconveniente, porque si antes del registro ya leyó las reglas serías molesto que no dejara crear temas  :xD

Hace mucho tiempo que me registré así que no sé si esta idea ya se encuentre implementada.  :¬¬

La idea que planteo puede variar en muchas cosas, solo es una sugerencia.


Qué opinan?.


Saludos.


30  Foros Generales / Sugerencias y dudas sobre el Foro / Sugerencia. Guardar temas como favoritos. en: 21 Julio 2013, 03:09 am
Hola.

Estuve revisando si el foro tiene una opción para guardar el tema como "favorito", pero no encontré :/ o tal vez no busqué bien  ;D.

De ser que no exista esa función, no creo que sea mala idea. Ustedes que opinan?.

La verdad es que muchos temas de aquí me sirven y me apoyo en ellos para solucionar algun tema, el problema es que a veces olvido como estaba redactado el tema y tardo mucho para encontrarlo.

Muchos dirán que para eso está en bookmarks de los navegadores, pero en mi caso uso por lo menos 3 pcs en la semana y a veces tengo que consultar información del foro.

Saludos.
Páginas: 1 2 [3] 4 5 6 7 8 9
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines