linux: how to access DHCP options from client

As you may know, you can configure any DHCP server to send many options to the clients; for example to setup dns domains, http proxy (WPAD) and so on. If you need to access these options from a linux client, you must configure the client to ASK the server for the new options, by editing /etc/dhcp/dhclient.conf, and add an entry like: option WPAD code 252 = string; also request WPAD; done that, when you’ll ask for a dhcp, the dhclient process will invoke your hook scripts with two new environment variables, old_WPAD and new_WPAD, with the values before and after the renewal. ...

November 6, 2017 · Andrea Manzini

simple and easy linux job queue

Recently I have been in a situation where I needed a simple ‘batch’ job scheduler, where I could submit some long-running tasks to a server and have a ‘system’ that serialize access the execution with some basic job control facilities (remove a job from the queue, stop the processing, and so on). Linux printing subsystem is already designed to do this, and we can exploit the CUPS printing subsystem to run our “batch” jobs. ...

December 21, 2015 · Andrea Manzini

redirect output of an already running process

Long story short: you have launched your script/program but forgot to redirect the output to a file for later inspection. #!/usr/bin/python3 #sample endless running program that prints to stdout import time,datetime while True: print(datetime.datetime.now().time()) time.sleep(1) Using GNU Debugger you can re-attach to the process, then invoke the creation of a logfile and duplicate the file descriptor to make the system send the data to the new file, instead of the terminal: ...

April 24, 2015 · Andrea Manzini

Linux Day 2012

Anche quest’anno ho avuto il piacere di partecipare al Linux Day, organizzato per Verona presso la sede del LUG Verona in via dei Gelsi a Montorio; Ho tenuto una breve presentazione su un argomento che mi sta a cuore: partecipare attivamente alla comunita’ del software libero, perche’ anche se ormai Linux e Il free software hanno una discreta diffusione, la maggior parte degli utenti si limita all’utilizzo passivo e anzi spesso si lamenta per la scarsa qualita’ del software open. Il software libero NON e’ solo avere programmi gratis! Vorrei invitare chiunque a “passare dall’altra parte” e abbandonare il comodo stato di “spettatori” per cominciare a dare il proprio contributo, ognuno per quello che puo'. ...

November 3, 2012 · Andrea Manzini