Archive for May, 2009
Twitter de la semana 2009-05-31
by MigueliTUX on May.31, 2009, under Actualizaciones
Déjanos tu comentario más...Denegar acceso a usuarios por SSH
by MigueliTUX on May.29, 2009, under Linux
hola
si quieres que algún usuario no se conecte via SSH a tu máquina entonces debes:
editar el archivo sshd_config ubicado en /etc/ssh
debes agregar la siguiente linea
DenyUsers <nombre de usuario que no tendra acceso>
para que los cambios tengan efecto debes reiniciar el servicio
/etc/init.d/ssh stop
y luego
/etc/init.d/ssh start
Mostrar ToolTips con javascript
by MigueliTUX on May.28, 2009, under HTML, JavaScript, css
Les han pedido mostrar un tooltips cuando se posicionan en un campo en un formulario web?. Pues he encontrado en una pagina lo siguiente:
function showDiv (el, div, text, alignX, alignY) {
if (document.getElementById) {
var i = document.getElementById(el);
var c = document.getElementById(div);
if (c.style.display != “block”){
var l=0;
var t=0;
aTag = i;
do {
aTag = aTag.offsetParent;
l += aTag.offsetLeft;
t += aTag.offsetTop;
}
while (
aTag.offsetParent && aTag.tagName != ‘BODY’
);
var left = i.offsetLeft + l;
var top = i.offsetTop + t + i.offsetHeight + 2;
if (alignX == ‘left’ && c.style.width){
left = left - parseInt(c.style.width);
}
if (alignY == ‘top’ && c.style.height){
top = top - parseInt(c.style.height) -25;
}
c.style.left = left+’px’;
c.style.top = top+’px’;
c.style.display = “block”;
c.innerHTML = ‘<table cellpadding=”0″ border=”0″><tr><td align=”center”>’ + text + ‘</td></tr></table>’;
} else { c.style.display=”none”; }
}
}
function hideDiv (div) {
if (document.getElementById){
var c=document.getElementById(div);
c.style.display="none";
}
}
Estas funciones nos sirven para hacer el show el hide. Es un div, el cual debe ser incluido en pagina. Asi:
<div class=”popup” id=”Popup” > <table cellpadding=”3″ border=”0″> <tr> <td align=”center”>?sto es un tooltip</td> </tr> </table> </div>
Para formateo en el CSS:
div.popup {
position: absolute;
display: none;
padding: 1px;
border: 1px solid #feba02;
background-color: #fff9e7;
z-index: 99;
width:200px;
}
Como usarlo:
onmouseover=”showDiv(’<ELEMENTO>’,'Popup’,'Mensaje’,'right’,'bottom’)” onmouseout=”hideDiv(’Popup’);”
right es para definir hacia dónde se alargará el Tooltip. Los valores posibles son ‘left’, ‘center’ y ‘right’. En nuestro caso se va a alargar hacia la derecha, anclando su lado izquierdo en la imágen.
bottom es parecido al punto anterior pero verticalmente. Los valores posibles son ‘top’, ‘middle’ y ‘bottom’. En nuestro caso se mostrar? el tooltip por debajo del elemento de anclaje.
Ojala les sirva
¿Cuanta memoria libre tengo?
by MigueliTUX on May.27, 2009, under Linux
2 Comentarios :consola, libre, Linux, memoria más...Formas de Apagar y Reiniciar un GNU/Linux.
by MigueliTUX on May.26, 2009, under Linux
Para esta tarea existen varios comandos por ejemplo:
shutdown
El comando shutdown es el método más prolijo, seguro y completo de bajar el sistema.
Por ejemplo:
shutdown -r now
Hace que el sistema se rearranque (-r) de forma inmediata (now).
halt
Este comando realiza las tareas esenciales mínimas para bajar el sistema
reboot
El comando reboot procede como al halt pero arranca de nuevo el sistema después de bajarlo.