Commands by electrotux (1)

  • Queries whether the monitor is on according to DPMS. If true then turns the monitor off, if false turns it on. The -display option on xset means the command will work from sessions other than the console, such as ssh or a cron'd script. Command should display any errors if there are any problems (eg no X available), otherwise no output if successful.


    0
    xset -display :0 q | grep ' Monitor is On' > /dev/null && xset -display :0 dpms force off || xset -display :0 dpms force on
    electrotux · 2015-04-06 19:04:04 12

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

convert a,b,c to ('a','b','c') for use in SQL in-clauses

Increase SCT of external USB disk enclosure to one hour.
So I had this 2TB Seagate external disk/USB enclosure which by default would spin-down its internal drive (it enters a standby mode) after four minutes of inactivity.. Spinning-up the inactive drive was an annoying delay when accessing files and also it severely interfered with NFS.. SCT stands for "Standby Condition Timer". To completely disable SCT: $ sdparm --clear STANDBY -6 /dev/sdb To return to original (default) SCT settings: $ sdparm -D -p 0x1a -6 /dev/sdb To verify the settings (before and after): $ sdparm -a /dev/sdb No need for vendor-provided MSWIN tools, etc.

create thumbnail of pdf

Install pip with Proxy
Installs pip packages defining a proxy

Finding files with different extensions
This is the way how you can find header and cpp files in the same time.

show the difference

Get your outgoing IP address
Instead of opening your browser, googling "whatismyip"... Also useful for scripts. dig can be found in the dnsutils package.

Add .gitignore files to all empty directories recursively from your current directory

Enable programmable bash completion in debian lenny
The really awesome bash completion in debian seems to be an extra package now, which has to be installed. After sourcing /etc/bash_completion it completes almost everything (package names in apt... etc) :-) To make this permanent, put something like this in your .bashrc: if [ -f /etc/bash_completion]; then source /etc/bash_completion fi

Convert entire audio library in parallel
Uses parallel processing Reiteration of my earlier command https://www.commandlinefu.com/commands/view/15246/convert-entire-music-library Usage lc Old_Directory New_DIrectory Old_Format New_Format lc ~/Music ~/Music_ogg mp3 ogg


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: