Actualizaciones de marzo, 2011 Mostrar/ocultar comentarios | Atajos de teclado
-
diegor
-
diegor
-
diegor
-
diegor
HOWTO: imprimir métodos de un objecto en perl
Muy simple:
#DON'T use strict; use Data::Dumper; my $object = ....; print "Instance METHOD IS " . Dumper( \%{ref ($object)."::" }) ;En Python es aún más fácil
-
diegor
HOWTO: utilizar telnet para crear llamadas HTTP
Telnet es una vieja utilidad utilizadas en la red local para proporcionar una comunicación bidireccional orientada a texto usando un terminal. Puede ser utilizada para crear llamadas http hacia un servidor remoto con finalidad de testing. Veamos como:
- Abre tu terminal favorito
- Escribe (en cambio de diegor.it puedes elegir cualquiera server quieras)
#> telnet diegor.it 80
y deberías tener este output:
Trying 75.119.192.123... Connected to diegor.it. Escape character is '^]'.
- Ahora escribe:
GET / HTTP/1.1 host: diegor.it <line feed>
donde “/” es la ruta remota. En este caso nosotros queremos la raíz. El output parecerá como este de bajo:
HTTP/1.1 200 OK Date: Mon, 13 Jun 2011 09:06:43 GMT Server: Apache Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Expires: Wed, 11 Jan 1984 05:00:00 GMT Last-Modified: Sun, 12 Jun 2011 13:29:48 GMT Vary: Accept-Encoding Content-Length: 85589 Content-Type: text/html;charset=UTF-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ...
¡Muy simple! Preguntas y comentarios son bienvenidos.
-
Paolo Bernardi
Careful there, maybe that MaxOS X telnet is very smart, but usually the command is in the form “telnet hostname port”. So, ‘telnet http://www.diegor.it 80′ is a better way to do this, the protocol is specified by the port number.
-
diegor
I can’t get what are you saying. Where’s the “error”?
-
diegor
Ok, now i get it. The problem is that this fucking wordpress put “http://” as prefix in www addresses
-
Paolo Bernardi
Hahahaha OK, that’s a sound explaination.
-
Paolo Bernardi
Besides, WP has put an http:// also in front of my comment’s telnet string
))-
diegor
Yes, I saw that! fucking WP
-
-
-
-
-
diegor
HOWTO: “ip_conntrack: table full, dropping packet”
Yo gestionaba un server con sobre linux y una vez tuve un mensaje extraño:
#> ip_conntrack: table full, dropping packet
Uno de los efectos de este mensaje es que no puedas crear y recibir conexiones nuevas.
Para resolverlo es suficiente aumentar el valor de ip_conntrack_max value. Como primero paso verifica el valor actual, digitando:#> cat /proc/sys/net/ipv4/ip_conntrack_max 65536
Ahora, aumenta este valor digitando:
#> echo 131072 > /proc/sys/net/ipv4/ip_conntrack_max
En general el valor de ip_conntrack_max está establecido a el total en MB de la RAM multiplicado por 16. Si tienes 8GB RAM (8192 MB), e valor debe ser establecido a 131072.
-
diegor
HOWTO: resaltar espacios con carácteres en VIM
Cuando modificas un archivo con vim, es comodo ver donde la línea termina, especialmente si termina con espacios. En lugar de verificar cada línea, puedes resaltar espacios. Como?
- Apre Vim desde el Terminal
- digita
:set list
- Puedes ver un resultado como este a continuación

- Si quieres ver cada espacio como carácter, digita este comando
:set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
- El resultado debería ser como este

¡Un consejo muy simple y útiles!
Si tienes dudas, consejos u otro, ¡comenta este articulo!
Fuente: Stackoverflow
-
proudlygeek
Vim is my favourite text editor, i use it pretty anywhere
I’ll share a useful trick for commenting multiple lines of code:
1) SHIFT-V to select multiple lines;
2) Type “:s/^/#”Where “^” indicates the beginning of a line and “#” the comment symbol of your choice.
To decomment a block of code:
1) Shift-V
2) Type “:s/^#//”

it works correctly also if you write only:
Deny from all
Allow from 172.17.10.1
Ciao boro!