Categories
English

Glances v1.3.7 released – System monitoring tool for Linux

System statistics at a glance: Official site.

From

Glances v1.3.7 released – System monitoring tool for Linux | The Hacker News THN.

Categories
English Feeds

Julien Danjou: Using GTK+ stock icons with pynotify

It took me a while to find this, so I’m just blogging it so other people
will be able to find it.

I wanted to send a desktop
notification
using
pynotify, but using a GTK+ stock
icons
.

With the following snippet, I managed to do it.

import pynotify
pynotify.init("myapp")
import gtk
n = pynotify.Notification(summary="Summary", message="Message!")
n.set_icon_from_pixbuf(gtk.Label().render_icon(gtk.STOCK_HARDDISK, gtk.ICON_SIZE_LARGE_TOOLBAR))
n.show()

Note that the use of a Label is just to have a widget instanciated to use
the render_icon() method. It could be any widget type as far as I
understand.

Categories
English Feeds

Living: Being bad CAN be good

According to the bods at MSN, who have come up wth the below list, being bad can be good for you (though we are certain that this should be approached with a pinch of salt

Swearing
At best, swearing can make men seem inarticulate. At worst, it can make them seem angry or aggressive. Nobody likes to hear loud swearing in a public place.

But on occasion, a well-chosen profanity doesn’t just feel like the only word up to the task – it can even be good for you.

Researchers at Keele University’s School of Psychology found that volunteers who repeated a swear word throughout the ordeal were able to keep their hands in ice cold water longer than participants who repeated a non-swear word. It adds to previous evidence that swearing, on occasion (when you stub your toe, for example), can be an effective form of pain control.

But the Keele researchers warned that swearing works best when it’s done in moderation.

"People who don't swear very much in daily life can keep their hand in roughly double the amount of time when they swear compared to when they don't swear," said Keele's Dr Richard Stephens. But the research found that swearing is less effective as a painkiller in people who swear regularly at other times.

Drinking
Excessive drinking ups your risk of various cancers, obesity, heart disease and a host of other unpleasant ailments. But alcohol doesn’t have to lead to ill health. It can be good for you.

There’s actually quite a lot of evidence that moderate drinking is healthy. Most recently, a study from researchers at Calgary University found that people who drank moderately were 14% to 25% less likely to develop cardiovascular disease than people who didn’t drink at all.

That chimes with a ten-year study on Irish and French men, which found that regular, moderate drinkers had a lower risk of heart disease than both non-drinkers and binge drinkers.

Bear that last line in mind, though. Only modest drinking – four units a day for men at most, up to a maximum of 21 a week – seems to confer health benefits. Heavy drinking is always bad for you.

Fighting
Brawling on the street or in the pub is never a good idea. You could get seriously hurt. You could get arrested. You could get shunned by everyone you know.

But studies show that training to fight in a controlled environment actually makes people less violent.

The research has largely been done with martial arts, but it may be true of boxing too. When you fight in a structured environment, you release aggression safely, connect with others socially, and give yourself something to do on boring nights when you might otherwise be out looking for trouble (if you’re that way inclined).

In other words, structured training in martial arts helps boys develop a better attitude to violence and aggression. Fighting – in the right way – was good for them.

Gambling
Gambling is undoubtedly bad for you if you become addicted to it or if you need to gamble to try and pay the rent. But moderate gambling, like your monthly poker night with friends, can be healthy in all sorts of ways.

In fact, research published in the American Journal of Psychiatry found that, among older people, gambling is a positive boon. It found that between 80 and 90% of all recreational gamblers over 65 claimed to enjoy excellent health, compared with just 62% of non-gamblers.

You may not be over 65, but the reasons the researchers found for this positive effect are relevant at any age. Gamblers were more stimulated (they enjoyed it – a lot) and sociable than non-gamblers.

So there it is. ‘Proof’ that being bad means you’re golden. Except when you either swear at work – get the sack, drink at work – get the sack, fight at work – get the sack, gamble your wages, end up stealing from work – get the sack. Or drink to much (leading to gambling), lose winning pot (leading to swearing at someone), end up in a rucus get punched (leading to fighting). Fighting leads to being charged with affray.

Moderation is the key.

Forward by email

Categories
Feeds Français

Connaissance du 17/12/2011

Le véritable prénom de Mr. Alzheimer était Alois.

Categories
English Feeds

Happy New Year!

Time flies but you're the pilot

via+

Categories
English Feeds

Axel Beckert: grep everything

During the OpenRheinRuhr I noticed that a friend of mine didn’t know
about zgrep and friends. So I told him what other grep
variations I know and he told me about some grep variations I didn’t
know about.

So here’s our collection of grep wrappers, derivatives and variations.
First I’ll list programs which search for text in different file
formats:

grep through what Fixed Strings Wildcards / Basic RegExps Extended RegExps Debian package
uncompressed text files fgrep grep egrep grep
gzip-compressed text files zfgrep zgrep zegrep zutils, gzip
bzip2-compressed text files bzfgrep bzgrep bzegrep bzip2
xz-compressed text files xzfgrep xzgrep xzegrep xz-utils
uncompressed text files in installed Debian packages dfgrep dgrep degrep debian-goodies
gzip-compressed text files in installed Debian packages dzgrep debian-goodies
PDF documents pdfgrep pdfgrep
POD texts podgrep pmtools
E-Mail folder (mbox, MH, Maildir) mboxgrep -G mboxgrep -E mboxgrep
Patches grepdiff grepdiff -E patchutils
Process list pgrep procps
Gnumeric spreadsheets ssgrep -F ssgrep ? gnumeric
Files in ZIP archives zipgrep unzip
ID3 tags in MP3s taggrepper taggrepper
Network packets ngrep ngrep
Tar archives targrep / ptargrep perl (Experimental only for now)

And then there are also greps for special patterns on more or less
normal files:

grep for what uncompressed files compressed files Debian package
PCRE (Perl Compatible Regular Expression) pcregrep (see also the grep -P option) zpcregrep pcregrep
IP Address in a given CIDR range grepcidr grepcidr
XPath expression xml_grep xml-twig-tools

One question is though still unanswered for us: Is there some kind of
meta-grep which chooses per file the right grep from above by looking
at the MIME type of the according files, similar to xdg-open.

Other tools which have grep in their name, but are too special to
properly fit into the above lists:

  • ext3grep: Tool to help recover deleted files on ext3
    filesystems
  • xautomation: Includes a tool named visgrep
    to grep for subimages inside other images.

Includes contributions by Frank Hofmann and Faidon Liambotis.