abidibo.net

Weblog

Low battery notification with fluxbox

bash battery conky fluxbox

I'm very happy with my fluxbox window manager, but there is a thing which causes me some problems, the lack of a notification message when my laptop battery has a really low charge.

I run conky as monitor display, which shows me battery information, but while I'm working I don't care of my desktop most of the times, I'm overwhelmed by all my opened windows and applications and so always happens that my machine shutdown because ...

read the full post


Fluxbox, configure an external monitor

fluxbox hdmi linux tips vga xrandr

One problem I still haven't solved with fluxbox is how to manage multiple monitors resolutions.
More specifically, I can stream the output over multiple monitors, I can have multiple resolutions, but fluxbox sizes itself considering only the first screen resolution.

For example if I boot my machine with an external VGA monitor connected, the system boots and both the VGA monitor and the laptop monitor work (even if the laptop monitor is closed). The problem here is that my laptop monitor has a 1366x768 resolution, while the external monitor is fullHD. So what happens is that I'll have the maximum resolution supported by all active monitors (1366x768) and so my fullHD monitor looks very ugly!

I learned playing ...

read the full post


Connect to WPA2 wireless network through command line

linux network tips

There is one rule I learned during my linux experience: If you want to learn things, you've to break things.
Trying to solve problems alone is the best way to increase your linux knowledge.

That said, almost every disaster can be recovered through your command line, so when X crashes, when you have broken your windows manager or display manager, you'll always be able to recover from terminal, BUT you need at least one thing: one active internet connection.

If you can go with a LAN cable ok, there is hopefully no problem, but what if only a WPA protected wlan network is available for you?
Clearly you've to connect to such network through command line in ...

read the full post


Convert select multiple widget to checkboxes in django admin form

django django-admin django-mptt jquery

I think this should be a nice post talking about the substitution of the default multiple select widget used in django admin interface to deal with m2m fields, with a multiple checkbox widget.

Yes I know, you may solve it this way, but I don't like such solution very much, and I think it is just not perfect for some reasons:

  • At the time of this writing the add related functionality (+) seems to be broken, throws an error, at least for me
  • It just can't be used with the django-mptt application, which is awesome to deal with data which have a tree like structure

So to graphically explain what we want to do here, say we want this ...

read the full post


Reverse selector engineering with mootools

css javascript mootools selectors

What if you need to get the css selector which targets a DOM element given the element itself?

This is the case for example when you want to store some added information over an element and show it after recharging the page. In this case you may store the information in the local storage object together with the path to the element, in other words you must be able to store the element position inside the DOM

In this scenario ...

read the full post


MySQL, bad preformance of INFORMATION_SCHEMA queries

cache mysql performance php

Recently I've discovered a quite big perfomance problem when running INFORMATION_SCHEMA queries on mysql.

In particular I found that on some systems (some mysql versions) a query like

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'db_name' AND TABLE_NAME = 'db_table'

can take up to 0.1s to run!

Clearly such time interval is not acceptable, and I think it happens only with some versions of mysql because I've run some tests on my local machine and on the server where this site is running obtaining a result of 0.0007 seconds, we are talking about a difference of two orders of magnitude!

I've not investigated more about which mysql versions are affected and if there are any patches, I ...

read the full post


Glen Hansard, Milano 2013

glen hansard life me music

Dunque oggi sono scassato come una merda, ma sono contento perché ieri sera sono andato in una disco tamarra di Milano a sentire Glen Hansard in concerto.

Inizio concerto ore 20:00, ore 20:00 meno qualcosa parcheggiamo a poca distanza dal locale, 3 bottiglie di vino alle spalle, ci incamminiamo verso l'ingresso e santo Carlo "Oh, ma è Glen!", scorge Glen camminare verso di noi diretto probabilmente ad una birra e paninazzo.

Molliamo di brutto filtri e armamentari e lo placchiamo. Flu rotto in culo si fa firmare l'ukulele ora vero e proprio cimelio. Poi è il momento della foto ed inizio a blaterargli qualcosa di incomprensibile riguardo al fatto che anch'io avrei voluto fargli ...

read the full post


Development of a preview functionality with canvas

canvas javascript mootools

Do you remember the last post about canvas dealing with undo and redo functionality?

Now we'll see how to add a preview functionality, that is I want to see my straight line, or my circle, while keeping pressed the left mouse button and moving the pointer to change the shape size.

The first, bad, idea

Initially I thought that the way was to store the portion of canvas interested by the modification and restore it in the next mousemove call, so that the mousemove function has to respect the following flow:

  • restore the previous saved state
  • save the state of the portion of the canvas that now will be drawed
  • draw the new state

Such flow works, but doesn ...

read the full post


Deploy django application, set up another machine

deploy django git pip programming virtualenv

This entry is related to the series "Deploy django applications with nginx, uwsgi, virtualenv, south, git and fabric", the first part here.

So what happens here? Really nothing special, I've changed my working machine and so I had to set up my django projects on the new notebook. This post is only a remainder of the followed steps.

Install all the required system packages

Clearly I had to install some packages in the new machine:

  • mysql-server
  • python
  • python-dev
  • python-setuptools
  • build-essentials
  • libmysqlclient-dev
  • git

And also I've installed pip and virtualenv

Create the folder structure and the virtualenv

First of all create a directory which will contain the project, I've created it under /var/www:

$ mkdir /var/www/myproject ...

read the full post


A mootools powered showcase with dot pagination

animation effect javascript mootools programming showcase webmaster css3

Today I was playing (really working) with a nice animation effect to use for the pagination of a showcase module (or stories).

The concept is quite simple here, we have some items which iterates with a nice effect (fade in this case) automatically or not (decided through options). Every item has a dot controller which shows the item when clicked.

Nothing exceptional here, the cool thing is the effect that I gave to such dot controllers, as it seems that when clicking a not selected dot, the selected one moves forward or backward to reach the clicked point.

Quite difficult ...

read the full post


Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!

Featured