{"id":430,"date":"2010-09-16T09:07:35","date_gmt":"2010-09-16T09:07:35","guid":{"rendered":"http:\/\/esferas.org\/msqlu\/2010\/09\/16\/laneas-por-pulgada-iii\/"},"modified":"2016-04-17T08:59:00","modified_gmt":"2016-04-17T08:59:00","slug":"laneas-por-pulgada-iii","status":"publish","type":"post","link":"https:\/\/esferas.org\/msqlu\/2010\/09\/16\/laneas-por-pulgada-iii\/","title":{"rendered":"L\u00edneas por pulgada (III)"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1722,&quot;href&quot;:&quot;http:\\\/\\\/perldoc.perl.org\\\/functions\\\/print.html&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20200712171340\\\/https:\\\/\\\/perldoc.perl.org\\\/functions\\\/print.html&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/perldoc.perl.org\\\/functions\\\/print.html&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:1723,&quot;href&quot;:&quot;http:\\\/\\\/perldoc.perl.org\\\/functions\\\/exit.html&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20200225000710\\\/https:\\\/\\\/perldoc.perl.org\\\/functions\\\/exit.html&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/perldoc.perl.org\\\/functions\\\/exit.html&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:1724,&quot;href&quot;:&quot;http:\\\/\\\/www.lprng.com&quot;,&quot;archived_href&quot;:&quot;https:\\\/\\\/web-wp.archive.org\\\/web\\\/20260416003058\\\/http:\\\/\\\/www.lprng.com\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>Lo malo de estar m\u00e1s s\u00f3lo que la una es que no hay tiempo para explorar en profundidad nada de nada.<\/p>\n<p><!--more--><\/p>\n<p>Dado que es el \u00fanico listado impreso que depende de la posici\u00f3n exacta sobre el papel, y que no encuentro el motivo de tanta disparidad en los desempe\u00f1os de las impresoras, voy a hacer una excepci\u00f3n y a crear un filtro de impresi\u00f3n para \u00e9l en exclusiva.<\/p>\n<p>Dicho filtro va a ser un programa Perl que desplace el tercer recibo una l\u00ednea hacia abajo, insertando un salto de l\u00ednea antes del recibo y quitando una del final para que mantenga la longitud de la p\u00e1gina f\u00edsica. Para entendernos todos: es una <a href=\"\/dotclear\/index.php?tag\/%C3%B1apa\">\u00f1apa<\/a>.<\/p>\n<p>El programita es m\u00e1s o menos \u00e9ste:<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #808080;font-style: italic\">#!\/usr\/bin\/perl<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #000000;font-weight: bold\">use<\/span> strict;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #000000;font-weight: bold\">use<\/span> warnings;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$VERSION<\/span>         = <span style=\"color: #cc66cc\">0.2<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$lineas_x_recibo<\/span> = <span style=\"color: #cc66cc\">24<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$insert_line_on<\/span>  = <span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #0000ff\">$lineas_x_recibo<\/span> <span style=\"color: #66cc66\">*<\/span> <span style=\"color: #cc66cc\">2<\/span><span style=\"color: #66cc66\">&#041;<\/span> + <span style=\"color: #cc66cc\">1<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$delete_line<\/span>     = <span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #0000ff\">$lineas_x_recibo<\/span> <span style=\"color: #66cc66\">*<\/span> <span style=\"color: #cc66cc\">3<\/span><span style=\"color: #66cc66\">&#041;<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$lines_counter<\/span>   = <span style=\"color: #cc66cc\">0<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #808080;font-style: italic\">#   Bucle de lectura de l\u00edneas<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #b1b100\">while<\/span> <span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #b1b100\">my<\/span> <span style=\"color: #0000ff\">$line<\/span> = <span style=\"color: #009999\">&lt;STDIN&gt;<\/span><span style=\"color: #66cc66\">&#041;<\/span> <span style=\"color: #66cc66\">&#123;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #808080;font-style: italic\"># Contabilizamos<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #0000ff\">$lines_counter<\/span> ++;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #808080;font-style: italic\"># Si alcanzamos el punto de inserci\u00f3n de l\u00ednea<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #b1b100\">if<\/span> <span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #0000ff\">$lines_counter<\/span> == <span style=\"color: #0000ff\">$insert_line_on<\/span><span style=\"color: #66cc66\">&#041;<\/span> <span style=\"color: #66cc66\">&#123;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">        <a href=\"http:\/\/perldoc.perl.org\/functions\/print.html\"><span style=\"color: #000066\">print<\/span><\/a> <span style=\"color: #000000;font-weight: bold\">STDOUT<\/span> <span style=\"color: #ff0000\">&quot;<span style=\"color: #000099;font-weight: bold\">\\n<\/span>&quot;<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #66cc66\">&#125;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #808080;font-style: italic\"># Si no hemos llegado al punto de supresi\u00f3n enviamos copia de lo<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #808080;font-style: italic\"># recibido<\/span>\n<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #b1b100\">if<\/span> <span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #0000ff\">$lines_counter<\/span> <span style=\"color: #66cc66\">&lt;<\/span> <span style=\"color: #0000ff\">$delete_line<\/span><span style=\"color: #66cc66\">&#041;<\/span> <span style=\"color: #66cc66\">&#123;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">        <a href=\"http:\/\/perldoc.perl.org\/functions\/print.html\"><span style=\"color: #000066\">print<\/span><\/a> <span style=\"color: #000000;font-weight: bold\">STDOUT<\/span> <span style=\"color: #0000ff\">$line<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #66cc66\">&#125;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #808080;font-style: italic\"># Si estamos en el lugar donde suprimir la \u00faltima l\u00ednea<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #b1b100\">else<\/span> <span style=\"color: #66cc66\">&#123;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">        <span style=\"color: #0000ff\">$lines_counter<\/span> = <span style=\"color: #cc66cc\">0<\/span>;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">    <span style=\"color: #66cc66\">&#125;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><span style=\"color: #66cc66\">&#125;<\/span><\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\">&nbsp;<\/div><\/li><li style=\"font-family: 'Courier New', Courier, monospace;color: black;font-weight: normal;font-style: normal\"><div style=\"font-family: 'Courier New', Courier, monospace;font-weight: normal\"><a href=\"http:\/\/perldoc.perl.org\/functions\/exit.html\"><span style=\"color: #000066\">exit<\/span><\/a> <span style=\"color: #cc66cc\">0<\/span>;<\/div><\/li><\/ol><\/pre>\n<p>La puesta en marcha es sencilla porque el servidor donde lo har\u00e1 es un veterano y sigue empleando <a href=\"http:\/\/www.lprng.com\/\">lprng<\/a> como sistema de impresi\u00f3n. Para instalar un filtro de impresi\u00f3n s\u00f3lo es necesario modificar la entrada correspondiente en la configuraci\u00f3n, que en este caso es el viejo y eficiente archivo <\/p>\n<pre class=\"inline:true decode:1 \" >\/etc\/printcap<\/pre>\n<p>:<\/p>\n<pre>\nrecibos:tc=.common:lp=hp2055@servidor.int\n:filter=\/etc\/magicfilter\/recibos\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Lo malo de estar m\u00e1s s\u00f3lo que la una es que no hay tiempo para explorar en profundidad nada de nada.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","webmentions_disabled_pings":false,"webmentions_disabled":false,"footnotes":""},"categories":[5],"tags":[215,323,208],"class_list":["post-430","post","type-post","status-publish","format-standard","hentry","category-hardware","tag-impresora","tag-napa","tag-sysadmin"],"_links":{"self":[{"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/comments?post=430"}],"version-history":[{"count":0,"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"wp:attachment":[{"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/esferas.org\/msqlu\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}