Sunday, December 23, 2012

Excel: mail la modificarea unei celule

Sunt cazuri in care dupa ce ai facut cateva modificari intr-un fisier Excel vrei sa trimiti un mail prin care sa anunti acest lucru.

Desigur ca poti sa faci acest lucru manual dar daca te grabesti sau vrei sa ai un template care sa te ajute atunci poti sa folosesti metoda de mai jos:

  • iti stabilesti o celula care daca este modificata sa genereze transmiterea de mail (de exemplu A5)
  • iti stabilesti o celula (de exemplu A4) cu un hyperlink special (descris mai jos)
  • adaugi urmatorul cod Visual Basic

Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Row = 1 Then
    If Target.Column = 5 Then
      ActiveSheet.Cells(1, 4).Hyperlinks(1).Follow
    End If
  End If
End Sub


Astfel, la un update pe celula A5 (unde putem mentiona data la care am facut un update) se apeleaza URL-ul salvat in A4 (in .

Mai jos sunt 2 exemple pentru un URL care sa trimita un mail. Primul construit dupa specificatiile "mailto" iar al doilea pentru transmiterea unui mail prin Gmail:

  • mailto:destinatar@123.com?subject=Update%20pentru%20vanzari&body=Salut,%0a%0aAm%20facut%20un%20nou%20update%20pentru%20fisierul%20de%20vanzari.%0a%0aExpeditor
  • https://mail.google.com/mail/?view=cm&ui=2&tf=0&fs=1&to=destinatar@123.com&su=Update%20pentru%20vanzari&body=Salut,%0a%0aAm%20facut%20un%20nou%20update%20pentru%20fisierul%20de%20vanzari.%0a%0aExpeditor



Saturday, July 21, 2012

Trasee Montane - Date statistice (1)

Dupa mai bine de un an de la prima mentiune a aplicatiei Trasee Montane pe portalul alpinet.org traficul inregistrat pe site permite extragerea unor date statistice. In acest moment aplicatia permite vizualizarea unui numar de 262 trasee montane grupate in 26 zone montane, o crestere substantiala fata de situatia existenta la 31 Mai 2011 (65 trasee, respectiv 9 zone).

Intrebarea de astazi: care sunt zonele montane cele mai accesate in ultima luna?

Raspunsul este redat de lista de mai jos, unde sunt mentionate si numarul de trasee existente in baza de date OSM:


Informatiile sunt extrase din interfata Google Analytics, unde s-a facut o filtrare dupa accesarea paginilor de tipul "?zone=".

Saturday, April 07, 2012

Ati cautat, noi raspundem (1)

  • ce problema are hidroforu daca porneste prea repede?
Daca pompa hidroforului porneste prea repede (adica imediat dupa ce ati dat drumul la robinet de exemplu) cele mai probabile probleme sunt: presiune scazuta (in perna de aer) in vasul de expansiune (sau poate chiar perna de aer sparta) , dereglarea setarii pentru presiunea minima sau maxima (sunt prea joase) sau alegerea unui volum prea mic pentru vasul de expansiune.

  • data de schimbare a anvelopelor de vara
Nu exista o data fixa - recomandarea mea este sa schimbati anvelopele de vara dupa ce temperatura minima (cea anuntata la rubrica Meteo) depaseste 4 grade Celsius cel putin 7 zile la rand. Nu se intampla nimic daca mai mergeti inca 2-3 saptamani - totul e sa nu va prinda Pastele tot cu anvelopele de iarna pentru ca riscati sa calcati iepurasul daca va iese pe neasteptate in cale.

Friday, April 06, 2012

Din seria "Cel/Cea mai prost/proasta" - carnea de mici

Inaugurez astazi seria "Cel/Cea mai prost/proasta" cu recomandarea sa va feriti de carnea de mici de la Billa - cel putin daca o luati din locatia Barbu Vacarescu. Daca totusi faceti greseala sa luati de acolo, pregatiti un mujdei de usturoi pentru a trece cu bine de aceasta experienta. "Turnati" la comentarii si alte surse de care sa ne ferim.

Monday, February 13, 2012

Mondo Rescue: Using the post-nuke script

Quoting from their site
"Mondo Rescue is a GPL disaster recovery solution"
and have been used in several installations we have performed for our customers. One of the useful option is to exclude some directories (for example /var/log) and this means that all files and sub-directories will not be saved into the archive. This is good as it will save a lot of space but not very good to your system trying to write into an non-existent folder (like /var/log/asterisk).
The way to work around this problem is to use the "post-nuke" phase, when the control is transferred to a post-nuke script. If you will try to find some information about this feature the result is very disappointing as it is mentioned briefly only in the mondoarchive man page
-P tarball
Post-nuke tarball. If you boot into Nuke Mode and everything is restored successfully then the post-nuke script will be sought and executed if found. This is useful for post-restore customization. It is assumed that the tarball (.tar.gz format) will contain not just the post-nuke script (or binary, or whatever it is) but also any files it requires.

The way to solve the dilemma is to create (just before running mondoarchive) an archive with the hierarchy for the needed directories (for example for all of the directories you have excluded with -E). The hierarchy is obtain with find command and should provide a safe way to save all your sub-directories (including the symbolic links). The archive is created using tar command, which will save their owner, group and mode bits.
You could find here here an archive with the post-nuke script (to be placed in /root for example) and an example for the backup script.
The work was based on the post-nuke sample script (located in /usr/share/mondo/post-nuke.sample) and the information found in the Mondo-Devel mailing list archive (mainly this post).

Update #1: location for the archive example have been changed

Thursday, January 19, 2012

Linux: power off confirmation

There are situations when you need to configure your Linux machine to be powered off when somebody shortly press the power button. This is usually the case when you will install acpid (Advanced Configuration and Power Interface event daemon).

But what if you need some sort of confirmation that your command have been received and the system is in the shutdown cycle?

Well, all you have to do is to tweak the action parameter from /etc/acpi/events/power.conf and my suggestion could be found bellow.

Let's take a Centos or any RHEL based distribution and test it!

yum install acpid

in /etc/acpi/events/power.conf:

  • comment the default action (inserting # as the first character of the line)
  • add the following line at the end of the file
action=/bin/ps awwux | /bin/grep gnome-power-manager | /bin/grep -qv grep || (/bin/echo -e \\a >> /dev/console;/bin/sleep 0.25;/bin/echo -e \\aPower button event ! >> /dev/console;/bin/sleep 0.25;/bin/echo -e \\a >> /dev/console;/sbin/shutdown -h now)

All we have now is to restart the acpid service:

service acpid restart

In this way, when the case power button will be pressed shortly, 3 short beeps will be heard (in case your machine have an internal speaker) before the final shutdown command is triggered.