[Tfug] Re-nice... erm, and runlevels.

Bexley Hall bexley401 at yahoo.com
Thu Mar 12 23:29:57 MST 2009


> > [I was thinking of you/optics as I was "stitching" photos
> > together the other day -- wondering what magic lies in
> > the algorithms used therein   :> ]
> 
> hah, nice. I need to look at that more sometime. I assume
> they use autocorrelation and look for maximums, but I don't know
> how they do it effectively with such small overlaps sometimes.

I haven't a clue.  It seems to be *magic*!  ;-)  But, it is
a wicked neat toy to play with!  Unfortunately, until I
understand how it works, I'm never sure if I am taking
pictures "the right way" to maximize its ability to stitch
them together without it looking artificial (in one photo,
I ended up with a table with a BEND in it  :> )

> I also need to look at
> this because I keep taking all these pictures with the
> intent to
> stitch them and make a wicked panorama, but then I just let
> them sit on my drive. Meh.

I *think* being in one place is significant.  I.e., just spinning
on your feet moves the camera enough that near field items get
really messed up.  I guess the ideal would be to mount the
camera on a tripod and spin *that*  <shrug>

Maybe some of these "adjustments" in the software are intended
to handle this sort of thing.  Dunno.  (it's just a tool; I
just want it to work!  :> )

> >> Interesting question. I have no pertinent contribution, but
> >> it brings up a point that occasionally keeps me up nights.
> >
> > Yikes!  World Hunger, The Economy, etc. keep *me* up...  ;-)
> 
> Touche. I'm clearly a lesser man. :-)

Well, I could have mentioned more *colorful* things, but...

> >> For the longest time, I have felt like there are two
> >> aspects of linux (and perhaps other *nixen) that go sadly
> >> underused: (1) nice and (2) runlevels.
> >
> > Run levels are SysV-ish (which makes you wonder why Linux
> > doesn't embrace them more).  Traditionally, very *coarse*
> > controls like "Single user mode", "multi-user", "networking
> > services on", etc.  I'll admit I've rarely seen any more
> > judicious use than this (I've seen a "backup mode" on one
> > system that prevented multiple users from signing on during
> > system backup).
> 
> Exactly. Here there is this pretty awesome concept, already
> implemented and standard, and yet we sorta just ignore it.
> What really kills me if how we regress. I'm not sure if it was one

People forget the "beauty" of UN*X (vs. the other "desktop OS's")
is how easily you can build tools out of existing mechanisms.
Instead of reimplementing *everything* in each new "wonderful,
glorious testament to your (lack of) originality"...  :<

> of my trysts with another distro that I'm remembering, but I
> remember only one runlevel used to start X. My debian install starts up
> gdm/xdm/kdm in all multi-user runlevels. I don't know, maybe that was
> never standardized, but I always thought that was useful.
> 
> >> I still feel like a runlevel should be dedicated to
> >> low-power mode for laptops whereby switching runlevels
> >> removed power-hungry modules and set certain hardware
> >> into low power mode, or standby and shutdown
> >> unneeded services that otherwise keep spinning up disks.
> >
> > For "laptops in general"?  Or, for laptops running off
> > batteries?  (e.g., I don't like disk-intensive applications
> > running on laptop as most laptop disks are slow).
> 
> I was thinking along the lines of 3 modes: AC (all services, all
> modules, full 3D, etc.. leave disks spinning so we don't wear them out
> as fast and we get quicker response times), Battery normal (spin down
> disks, go to lower power where it makes sense, but don't limit the
> available services or interface at all),  Battery airplane (shutdown
> networking, turn off all 3D, stop all services, remove modules where
> possible, basically let me work on a document or a debug code, but
> that's it). Mode 1 and 2 might be controlled by laptopmode within a
> given runlevel, or might be different runlevels, but mode 3 could be
> pretty easy to do with runlevels switching.

Ah, OK.

> The downside is that it might be more akin to a reboot than people are
> used to, since it might require restarting X and so forth, but I would
> be fine with that  in the circumstances when it gains me an hour+ of
> battery life on long flights.

Understood.  I would guess its seamlessness would be a function of
the things it is dicking with.  Under SysV, "telinit <foo>" was
just something you did "whenever".  It wasn't like you had to
prepare yourself (and your work state) for the change.

But, then again, moving to another run level from the console
had few dependancies.  E.g., going to single user (network
services off) mode from a telnet session was like shooting
yourself in the foot...

> > You also bring up an interesting possibility -- using different
> > run levels to configure stock distributions for different
> > types of use.  E.g., server vs. workstation vs. ???
> 
> Ya, why not? Server vs workstation vs laptop? Seems like it
> would be
> easy to do, especially since there are runlevels 2-5 that
> appear to me to be identical on my debian system.

I think run levels can almost be arbitrary.  E.g., pick a single
character and call it a run level (I suspect this can also be
easily extended to support "strings").  I'll have to boot
one of my UN*X boxen to see for sure.

> >> Especially stuff like 3D graphics drivers and various services.
> >> Laptopmode is one thing, but it just seems like runlevels would
> >> be a powerful tool for changing such a state of the system, and
> >> you could still have a config/updatescript that allows choice
> >> of what gets switched on/off.
> >
> > Run levels in BSD are managed in a somewhat ad-hoc manner.
> > You have to "order" the various actions in configuration
> > directories.  So, adding a new action involves picking (gambling)
> > a numeric value that will put that action in relative sequence
> > with other actions (I guess there could be a tool to automatically
> > reorder/renumber the existing actions so you could "insert this
> > before action #24").
> 
> Ah, that's interesting. It seems pretty nonstandard
> other than 0 and 6
> even across linux distros. At least debian has update-rc.d
> and it's
> all about links in the /etc/rc#.d/ directories.  In fact,
> if I get off
> my duff for a bit, I could probably try out some of these
> ideas on my laptop and see how practical it is pretty easily.

I suspect the "problem" is just getting some sort of concensus
as to what each run level should do.  It seems like it should
be possible to build a "runlevel.d" to hold an indeterminate
number of user-defined "run levels" and just let "telinit <level>"
invoke the scripts in runlevel.d/rc<level>.d in LRalpha sequence.

That way, users could contribute scripts which could be
redistributed on he basis of how useful they are/become

> > But, even that could be changed as Ithink it is only there for
> > hysterical raisins.
> 
> Heh. I am now picturing that scene in airplane with everyone in a line
> to slap the woman, except the woman is a dried grape.

<groan>

> >> Uh.. and back on topic, similarly to nice levels. We should
> >> use those more effectively too. :-)
> >
> > But, how often *do* you re-nice something?  It seems like
> > you typically just "let it run" and/or kill off competitors
> > (note that closing a window is essentially the same thing).
> 
> I know. I had high hopes to use nice levels for something
> once. Now I
> can't even remember what that was. I sometimes consider
> trying to figure out how to renice a user though. :-)

sudo rm -r ~username


      




More information about the tfug mailing list