From: Ulick Magee on
houghi wrote:
>
> And as things go, just when I was ready, I found an (XFCE-)applet that
> would do the change correctly. LOL.

Well, I was going to suggest kpowersave (if you like killing 3 puppies
at a time) or powerdevil (4 puppies at a time - that's what the version
numbers mean, right?) but obviously it is bad and wrong to control the
hardware using applications specific to one desktop environment ;)



--

Ulick Magee

Free software and free formats for free information for free people.
Open Office for Windows/OSX/Linux: http://www.openoffice.org
openSUSE Linux: http://en.opensuse.org
From: mjt on
On Sun, 25 Jul 2010 15:55:11 +0200
houghi <houghi(a)houghi.org.invalid> wrote:

> I wanted to have more control as user over my CPU speed. Especially
> for the portable. If you want to do this as well, you could perhaps
> get some ideas from this posting and do somthing usefull with it,
> like brew beer.
>
> First you need to install `cpufrequtils` and look at the man pages for
> cpufreq-info and cpufreq-set.
>
> This is already almost all that you need to know. However you need to
> be root each time, which can become annoying to type the root pasword
> each time. So sudoers is the next step. In YaST, Security and Users,
> Sudo you can add (or edit) the user, as Host select ALL, RunAs empty
> and "NoPassword" selected and as command /usr/bin/cpufreq-set
>
> If you rather do it manually, become root and type `visudo` and add a
> line like:
> houghi ALL=NOPASSWD: /bin/mount, /bin/umount, /usr/bin/cpufreq-set
> Comma seperated programs.
>
> Now when you do `sudo /usr/bin/cpufreq-set -c0 -g ondemand` you do not
> need to type the password anymore.
>
> This you can then use in a small script where you can select what to,
> uh, select. (You know, where this is going, right?). I placed this in
> a script, but the realized would want to have it in a GUI, so zenity
> or kdialog would be the best option. However I have a test portable
> where I have no idea in advance what it will be running, so I made a
> script that uses both:
> http://houghi.eu/s/1B85FP1
>
> Some explanation. The script is almost read from bottom to top. First
> it will look if zenity exists and if not if kdialog exists.
> It will then show the GUI part where you can do a selection. After the
> selection, it will count the CPUs, so it can do the change for all
> CPUs. It will show a message what it has done. (can be turned of for
> the KDialog one)
>
> But remember:
> 1) You need cpufrequtils and kdialog and/or zenity
> 2) You need to put /usr/bin/cpufreq-set in sudoers
> 3) Your hardware must support this
> 4) If you turn this into beermaking, please send me some
>
> houghi

--
Go placidly amid the noise and waste, and remember what value there may
be in owning a piece thereof. - National Lampoon, "Deteriorata"
<<< Remove YOURSHOES to email me >>>

From: Benjamin Yu on
Can't you just set the setuid flag on the appropriate files instead of
sudoing? Then anyone wth permission to run them will run as the file owner
(root in this case).

"houghi" <houghi(a)houghi.org.invalid> wrote in message
news:slrni4oghv.6e6.houghi(a)penne.houghi...
>I wanted to have more control as user over my CPU speed. Especially for
> the portable. If you want to do this as well, you could perhaps get some
> ideas from this posting and do somthing usefull with it, like brew beer.
>
> First you need to install `cpufrequtils` and look at the man pages for
> cpufreq-info and cpufreq-set.
>
> This is already almost all that you need to know. However you need to be
> root each time, which can become annoying to type the root pasword each
> time. So sudoers is the next step. In YaST, Security and Users, Sudo you
> can add (or edit) the user, as Host select ALL, RunAs empty and
> "NoPassword" selected and as command /usr/bin/cpufreq-set
>
> If you rather do it manually, become root and type `visudo` and add a
> line like:
> houghi ALL=NOPASSWD: /bin/mount, /bin/umount, /usr/bin/cpufreq-set
> Comma seperated programs.
>
> Now when you do `sudo /usr/bin/cpufreq-set -c0 -g ondemand` you do not
> need to type the password anymore.
>
> This you can then use in a small script where you can select what to,
> uh, select. (You know, where this is going, right?). I placed this in a
> script, but the realized would want to have it in a GUI, so zenity or
> kdialog would be the best option. However I have a test portable where I
> have no idea in advance what it will be running, so I made a script that
> uses both:
> http://houghi.eu/s/1B85FP1
>
> Some explanation. The script is almost read from bottom to top. First it
> will look if zenity exists and if not if kdialog exists.
> It will then show the GUI part where you can do a selection. After the
> selection, it will count the CPUs, so it can do the change for all CPUs.
> It will show a message what it has done. (can be turned of for the
> KDialog one)
>
> But remember:
> 1) You need cpufrequtils and kdialog and/or zenity
> 2) You need to put /usr/bin/cpufreq-set in sudoers
> 3) Your hardware must support this
> 4) If you turn this into beermaking, please send me some
>
> houghi
> --
> This is written under the inluence of the following:
>> Artist : Simon and Garfunkel
>> Song : Kathy's Song
>> Album : Old Friends