Polipo and uncachable file

Dear lazyweb,

I was searching through the internet what was I doing wrong, I wrote to the polipo-user list but my email got stuck on moderation, and my connection is really shitty (that’s why I’m using polipo the way I’m using it). I have relaxTransparency and mindlesslyCacheVary set to true, but I don’t need so aggresive caching in my development stages that are located under *.local and another development subdomain on the net.

Already tried setting uncachableFile to /etc/polipo/uncachable and to ~/.polipo-uncachable, according to the web-config thing is properly setted up, but can’t get it to recognize it’s content. I first thought it was I was writing bad the regex, .*\.local but it does work in the /etc/polipo/forbidden file. Besides, adding complete domains to the uncachable file doesn’t works neither. Could someone confirm this or throw me a hand on this? I’m using 1.0.4.1-1.1 version which is the last one on unstable repos.

You can edit this ad by going editing the index.php file or opening /images/exampleAd.gif

and issues on vim with $TERM=”screen”

Because of tmux I run with $TERM=”screen” instead of my regular rxvt-unicode, but I had a big issue with VIM because of this, it kept writing and F\n and H\n each time I pressed and keys respectively. I finally found the way to solve this, making VIM use $TERM=”xterm” internally writing this on my ~/.vimrc:

if &term == "screen"
  set term=xterm
endif

So, this way, even in my servers without XTerm installed (but ncurses-term) I can use VIM as I’m used to.

Moving from Screen to Tmux

I’ve been a long-time user of GNU Screen, as almost every person I know that spend a lot of time in a terminal.

I must admit I was happy, I really was. I was used to my workflow with 4 terminals 8×25 and a bunch of screens, with several nested-screens. I used awesome-wm before, so definitely I felt I wasn’t using all the space in my laptop screen (my laptop is a ThinkPad X61, so 1024×768 in a 12 inches-screen) but that was OK, after all my workflow was, well, good.

Until 2 days ago, I was told to try tmux, in fact, I was told «and why are you using screen? use tmux». As a daily-user of Screen my first reaction was «I’m used to», «I can use it as I want», and a lot of excuses for just not trying something new. But then I made a little research (on Google, of course). In about 30 minutes I ended up with a multiplexer working as I wanted and as I never got Screen to work. Finally I was using just a terminal and using all the space available in my tiny-laptop-screen and plus: saving a lot of bandwidth with my permanent SSH connection (a really big plus now that I’m living with a capped link to the net with a GSM-modem).

I changed the Ctrl-b shortcut to Ctrl-a (b is too far for using it with only one hand), configured so I could use nested tmux’es like screen when I push Ctrl-a a, activated visual monitoring and even got to use the tmux’s buffer along with my X11 buffer when I press Ctrl-a >!!

It’s all in my ~/.tmux.conf, use it at will. Later I will make a screencast about using tmux, so more people can get a working tmux easily.

ATM, I’m even more happy than I was with GNU Screen, so, any other recommendation, people?

Changing background sync’d with jQueryUI Tabs

I love to use jQuery UI plugins. The one I use constantly is Tabs and this time I needed to sync the auto-changing of tab with the background. For this I used an event called

tabsshow

to trigger my function + the code I wrote yesterday for full-page background with CSS:

/* @author Jose Luis Rivas <joseluis@eserre.com>
 *
 * @desc swaping full-background pages with jQuery UI's Tabs plugin events.
*/



$(document).ready(function() {

  $( "#slides" ).bind( "tabsshow", function(event, ui) {
    var tabattr = $('.ui-state-active').find('a').attr('href');

    switch(tabattr) {
      case '#tab1':
        $('img#bg').attr('src', '/img/tab1.jpg');
        break;

      case '#tab2':
        $('img#bg').attr('src', '/img/tab2.jpg');
        break;

      default:
        $('img#bg').attr('src', '/img/tab1.jpg');
                                break;
    }

  });

});

What it does the script?

Finds the active-tab identified with the

.ui-state-active

class and then changes the

img

tab

src

attribute according to the

href

attribute of the active-tab.

Full-Page Background with CSS with crossbrowser support

I’ve been trying to get the perfect full-page background without using JavaScript since a while. I tried with CSS3 but, obviously for IE <9 was a pain in the ass, even for older Firefox' releases. So I decided to go with the plain-CSS option:

<!doctype html>
<head>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <img id="bg" src="/img/bg.jpg">

  <p>Content</p>
</body>
</html>
img#bg {
  min-width: 100%;
  min-height: 100%;
 
  /* Proportionate re-dimension */
  width: 100%;
  height: auto;

  position: fixed; top: 0; left: 0;

  z-index: -1;
}

What does it does?

It takes an inline image and uses it as if were a

background-image

thanks to the

z-index: -1

CSS-rule.

There are lots of other techniques at CSS-Tricks but none works in every browser as this one in particular.

Enjoy.

Moved from approx to apt-cacher-ng

I have been a long-time user of

approx

, I got used to it and knew how to configure it so all my machines + VMs used the same cache and saved me a lot of bandwidth.

But that was when I got a stable connection at >100KiB/s in a daily-basis. Now I’m with a mobile connection at <30KiB/s and sometimes is intermittent, so

approx

started giving me a lot of headaches.

When

approx

tries to connect a host that can’t be resolved its domain name, then gets 404. How does that reflects in the

/pool

? Well, you get a file

touch

‘d and 0 bytes size. When you try again,

approx

will find the same file with 0 bytes size and will gives you again a 404, even if you can now resolve the name address of that domain. And as I like to use what I know, then I made a workaround: Each time this happened I ran:

# find /var/cache/approx -size 0 | xargs rm

So next time I requested a file to

approx

it tried to connect to the host. But I got tired.

I installed

apt-cacher-ng

, tweaked a bit

/etc/apt-cacher-ng/acng.conf

so it uses port 9999 and the cache dir redirects to the same cache than

approx

and done.

apt-cacher-ng

returns 503 when it can’t connect to the peer, even tries to several repositories with only a line in

/etc/apt/sources.list

in my clients. It makes me happy and keeps saving me a lot more of bandwidth than

approx

.

Deck.js: Para hacer presentaciones con HTML+JS

Hoy navegando me topé con esta librería Javascript para hacer lo que llaman presentaciones modernas con HTML. Depende de jQuery y Modernizr para hacer la magia y está bajo una licencia dual MIT/GPL. Funciona en IE7+, Opera, Chrome, Firefox y Safari.

La librería en cuestión se llama Deck.js y pueden ver una demostración de sus resultados, incluye más temas y documentación para que tú mismo crees tus temas si manejas CSS+JS.

Pueden hacer un fork del código de Deck.js desde GitHub.

«Licencias para Desarrolladores en el mundo Open Source», la presentación en PDF

Para los que asistieron y para los que no a mi charla en el Día Debian 2011 de Barquisimeto, aquí les dejo mis láminas en formato PDF y fácilmente leíbles desde la web con Scribd.

Pronto estaré escribiendo más sobre el tema de la propiedad intelectual que poco se ha urgado en la comunidad hispana pero que sigue teniendo efectos sobre nuestras acciones.

Mañana 20 de Agosto, Día Debian Barquisimeto

Mañana se realizará el Día Debian en Barquisimeto, en el Decanato de Ciencias y Tecnología de la UCLA, donde estaré dando la charla «Licencias OpenSource para Desarrolladores», el cronograma completo del evento es el siguiente:

Sala 1:

  1. Routing en Debian Linux (Harold Luzardo) 8:30 am
  2. “¿Por que instalar Debian?” (Instalacion de Debian Squeeze) (Rafael Isturiz) 10am
  3. Android Primero Pasos (Gustavo Piciccini) 2:00pm
  4. Principios básicos en Python (Samuel Rojas) 3:00 pm

Sala 2:

  1. Virtualización de la A a la Z (Jesus Lara) 8:45am
  2. Licencias OpenSource para Desarrolladores (Jose Luis Rivas) 11:00am
  3. Juegos mas allá del código (Will Alvarez) 2pm
  4. Comunidades de Software Libre (Augusto Davila) 3:30pm

¡Los esperamos por allá!

What’s a hosting?

So, we all know the internet, right? It’s supposed we are connected to a bunch of websites that… Wait, where are those websites? Where I’m getting connected to?

This is the funny part, must of the people believe there’s a cyber-world like a parallel world with numbers and math-formulas. Did someone saw the movie Hackers? The bunch of building with green lines and like a bunch of boxes for saving data.

Well, that’s not true, not literally. You can imagine or draw all the data that gets to your eyes in this way, but in reality is a bunch of computers connected to each other, they’re millions of nodes in a net. Some of those computers not only see the data available but makes data available, serving websites or any kind of data in any other form. That’s called hosting. It’s called server too, obviously because it serves data.

So, your computer right now is connected to another, that shows data stored in the last one. That means, if someone shuts up a hosting, that info is no longer available to be surfed. Maybe it’s available in other caches, but not is the same hosting.