| 1 | [<].*?> | 
Categoría: Informatica
Mensaje de bienvenida en CentOS/Linux
Se hace editado el fichero /etc/motd
| 1 | nano /etc/motd | 
El contenido, normalmente, es texto plano y se mostrara en el inicio de sesión. Se puede poner texto o caracteres ASCII para mostrar texto en grande o dibujos:
| 1 2 3 4 5 |   _   _       _  | | | | ___ | | __ _  | |_| |/ _ \| |/ _` |  |  _  | (_) | | (_| |  |_| |_|\___/|_|\__,_| | 
También se pueden añadir colores mediante caracteres no legibles. Aunque no he sabido como insertarlos desde el Notepad++, así que hace falta usar los comandos:
| 1 2 3 4 5 6 7 | echo -en "\033[1;36m" > /etc/motd echo -en "\r\n" >> /etc/motd echo "...Mensaje de bienvenida..." >> /etc/motd echo -en "\033[0m" >> /etc/motd echo -en "\r\n\r\n" >> /etc/motd | 
Después se puede sustituir el texto por otro pero sin borrar los caracteres especiales, quedando así:
Viene bien cuando se mantiene varios servidores, así se diferencian al menos al iniciar sesión, aunque también se podría cambiar el color del fondo o el del texto (sin necesidad de tocar el cliente)
Más info:
http://www.bdunk.com/motd-linux
Edit:
Listado de colores:
http://midactstech.blogspot.com/2013/11/how-to-add-color-to-your-motd.html
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Text Color Variables BLK="\033[00;30m"    # BLACK R="\033[00;31m"      # RED GRN="\033[00;32m"    # GREEN BR="\033[00;33m"     # BROWN BL="\033[00;34m"     # BLUW P="\033[00;35m"      # PURPLE C="\033[00;36m"      # CYAN LtG="\033[00;37m"    # LIGHT GRAY DkG="\033[01;30m"    # DARK GRAY LtR="\033[01;31m"    # LIGHT RED LtGRN="\033[01;32m"  # LIGHT GREEN Y="\033[01;33m"      # YELLOW LtBL="\033[01;34m"   # LIGHT BLUE LtP="\033[01;35m"    # LIGHT PURPLE LtC="\033[01;36m"    # LIGHT CYAN W="\033[01;37m"      # WHITE | 
Formulario PHP para enviar Emails
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | <?php    $submit = !empty($_REQUEST['submit']); ?> <!DOCTYPE html> <html lang="en-GB">    <head>       <meta charset="UTF-8" />       <?php if( $submit ){ ?><meta HTTP-EQUIV="Refresh" CONTENT="3; URL=" /><?php } ?>       <title>Email test</title>       <style type="text/css">          label{display: block;}          input,textarea{margin-bottom:15px;}       </style>    </head>    <body>    <?php       // Display the contact form:       if( !$submit )       {          ?>          <form action="" method="POST" enctype="multipart/form-data">             <label>Your name</label>             <input name="name" type="text" value="" size="30"/>             <br/>             <label>Your email</label>             <input name="email" type="email" value="" size="30"/>             <br/>             <label>Your message</label>             <textarea name="message" rows="7" cols="30"></textarea>             <br/>             <input name="submit" type="submit" value="Send email"/>          </form>          <?php       }       // Send the submitted data:       else       {          $name    = $_REQUEST['name'];          $email   = $_REQUEST['email'];          $message = $_REQUEST['message'];          if( empty($name)  ||  empty($email)  ||  empty($message) )          {             ?><p>All fields are required.<br/>You will be redirected in 3 seconds.</p><?php          }          else          {             $from    = "From: $name<$email>\r\nReturn-path: $email";             $subject = "Message sent using your contact form";             mail( $email/*TO*/, $subject, $message, $from ) ;             ?><p>Email sent!<br/>You will be redirected in 3 seconds.</p><?php          }       }    ?>    </body> </html> | 
Edit:
El visualizado de código de WP omite algunas partes del código PHP por seguridad. Desde aquí puede bajarse el fichero original:
[Java] Ordenar lista de objetos al azar
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | private static List< Shop > randomSort(List< Shop > inList) {    int numItems = inList.size();    List< Shop > outList = new ArrayList< Shop >();    Integer[] randomNumbers = new Integer[numItems];    int itm = 0;    int cm = 0;    while( cm < numItems )    {       itm = new Double(Math.random() * numItems).intValue();       if( randomNumbers[itm] == null )       {          randomNumbers[itm] = cm++;       }    }    for( int i = 0 ; i < numItems ; i++ )       outList.add(inList.get(randomNumbers[i]));    return outList; } | 
Copia y restaura base de datos mediante comandos
| 1 2 3 4 5 | #Copia: mysqldump --opt --user=USUARIO --password='CONTRASEÑA' NOMBRE_DB > NOMBRE_FICHERO.sql; #Restaura: mysql --user=USUARIO --password='CONTRASEÑA' NOMBRE_DB < NOMBRE_FICHERO.sql | 
Omitir la introducción de la contraseña al inicio de sesión de Windows
Pulsar: windows+r
Escribir: control userpasswords2
Desmarcar: Los usuarios deben escribir su nombre y contraseña para usar el equipo.
Aceptar.
Fuente:
http://www.ehowenespanol.com/omitir-inicio-sesion-windows-xp-como_295309/

