LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices



Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

Script to quickly set the wake-alarm power on

Posted 04-28-2014 at 12:40 AM by the dsc (linux-related notes)
Updated 04-28-2014 at 12:43 AM by the dsc
Tags wakealarm

I think it's working. Issuing "set-alarm 6:00" will set the computer to automatically turn on the next day at 6am, or the same day, if the script was executed after midnight already.


Information about the whole thing, read before trying anything, no warranties/responsibilities whatsoever and all that, actually by having some trouble with the script you warrant ME the legal rights to sue YOU for a billion dollars and/or have you as my free butler for life:
...
Member
Posted in Uncategorized
Views 278 Comments 0 the dsc is offline
Old

How to fix (possibly) wrong icon appearing for hp-systray

Posted 04-17-2014 at 06:37 PM by the dsc (linux-related notes)

Depending on your DE configurations -- probably if you use KDE or mainly KDE/qt applications (I'm on Openbox, but I have "export DE=KDE" on my autostart for some reason), or perhaps if you use tint2, HP systray applet may show up with non-responsive "stolen" icons from neighbor applications and behave oddly in general.


It's generally set to autorun by there being a file "/etc/xdg/autostart/hplip-systray.desktop". All you got to do is to edit such...
Member
Posted in Uncategorized
Views 255 Comments 0 the dsc is offline
Old

Gruesome PDF to JPG converter script

Posted 03-28-2014 at 09:57 PM by the dsc (linux-related notes)
Updated 04-10-2014 at 01:11 PM by the dsc (fixing a bug)
Tags pdf

Requires gs, imagemagick, jpegoptim, cpulimit, and "coolloop" (or maybe not).

Has no options or anything.

You run it like:

howeveryounameit.sh appropriate-filename portable-document-file-to-convert.pdf

The result will be:

appropriate-filename-001.jpg, appropriate-filename-002.jpg and so on.

So you don't add numbers or extension on the first parameter ($1). I guess it may not deal well with spaces...
Member
Posted in Uncategorized
Views 307 Comments 0 the dsc is offline
Old

Ugly script to sleep "accordingly" to CPU temperature, on loops

Posted 03-28-2014 at 09:40 PM by the dsc (linux-related notes)

Sometimes you have a script or one-liner loop thing that may put quite a heavy load on the CPU, that can be at least bothersome due to the noise of the fan, or somewhat worrisome if the temperature approaches or goes beyond what the processor specifications recommend, and yet the system doesn't do anything by itself to avoid it.

One could simply add some arbitrary, constant sleep time within the loop, but that will likely make the whole thing slower than it needs to be. If within...
Member
Posted in Uncategorized
Views 233 Comments 0 the dsc is offline
Old

Give a default/non-null value in order to avoid the "unary operator expected" error

Posted 02-19-2014 at 04:00 PM by the dsc (linux-related notes)
Tags bash

Quote:
Originally Posted by cfajohnson
Quote:
i am trying to compare a value with value 50. but i am getting
"[: -lt: unary operator expected"

I am using

if [ $j -lt 50 ]
then
echo "------------"

fi
Make sure that $j expands to a value. Best is to set it explicitly, but you can also give it a default value (0 in this example):


Code:
if [ ${j:-0} -lt 50 ]
http://www.unix.com/302295072-post3.html...
Member
Posted in Uncategorized
Views 345 Comments 0 the dsc is offline

  



All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration