[gentoo-user] Battery charge status script for term or text console

2015-11-04 Thread Walter Dnes
  The attached script requires "make menuconfig" to have

Power management and ACPI options  --->
[*] ACPI (Advanced Configuration and Power Interface) Support  --->
<*>   Battery

or CONFIG_ACPI_BATTERY enabled if you do .config manually.

  The script reads /sys/class/power_supply/BAT1/uevent on a laptop and
calculates the percentage of battery charge.  Because it only reads from
/sys, and does not write, it can be run by a regular user.  The script
is primitive, and has to be stopped with {CTRL}{C}.

  The script runs in text mode, and can run in xterm or even a pure text
console.  I've removed the #!/bin/bash at the top of the attached file
and chmod'ed it non-executable.  The mailing list software seems to
reject any such attachments.  You can source the file as is, or chmod it
executable, and insert #!/bin/bash at the top.  Note that there is an
ANSI escape sequence in the script, to keep the output in one location.
Regular cut-and-paste can fail if you try to copy from the screen.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications
#
# If no battery found, bail out
if [ ! -d /sys/class/power_supply/BAT1 ]; then
   echo "***ERROR***; Battery not detected"
   exit
fi
#
# Get line containing full design charge value
full=`grep POWER_SUPPLY_CHARGE_FULL_DESIGN /sys/class/power_supply/BAT1/uevent`
#
# Strip out everything except the actual number itself
full1="${full#POWER*=}"
#
# Get half of the full value, for use in emulating "round offs" in integer
# arithmetic.
half=$(( ${full} / 2 ))
while true
do
#
# Get line containing current charge value and strip out everything
# except the actual number itself
   now=`grep POWER_SUPPLY_CHARGE_NOW /sys/class/power_supply/BAT1/uevent`
   now1="${now#POWER*=}"
#
# Multiply by 1000, so that the following division is actually 10 times
# the percentage.
   now2=$(( ${now1} * 1000 ))
   percent=$(( ${now2} / ${full1} ))
#
# Get the remainder of the division.  If it's greater than or equal to
# half the divisor (as determined above) add 1 to the percent x 10 value.
   remainder=$(( ${now2} % ${full1} ))
   if [ ${remainder} -ge ${half} ]; then
  percent=$(( ${percent} + 1 ))
   fi
#
# Treating ${percent} as a string, figure out where to place a decimal
# point to fake 10ths of a percent.
   pointer=$(( ${#percent} - 1 ))
   percent1="${percent:0:${pointer}}.${percent:${pointer}}"
#
# Backtrack the cursor up to 7 columns, and display the new value
   echo -n "${percent1} %"
#
# Wait 5 seconds and update again.  This is an infinite loop.
   sleep 5
done


Re: [gentoo-user] printing problems : one solved

2015-11-04 Thread Philip Webb
151103 Philip Webb wrote:
> In addition, the icon doesn't work in Gvim, tho'  :ha  does.

That latter was mistaken : the icon is simply a shortcup for  :ha .
You have to tell Gvim which printer to use.  In  ~/.vimrc  you need :
'set pdev=Deskjet_2510' (or system name for your own device).
When this is set & Gvim restarted, the icon &  :ha  both work.

The problem of getting Gvim & LO to recognise the 631 hi-quality setting
remains, however.  Somehow, it works without a problem with Xfce on Mint.
Is it something the KDE or Gnome libraries handle, but not Fluxbox ?

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] printing problems : hiccups solve them

2015-11-04 Thread Philip Webb
151103 Philip Webb wrote:
> The basic problem is now clear : this printer won't print draft quality,
> but leaves blank bands across the output (no, it's not an old cartridge).
> Therefore, something has to tell it to print 'high-quality' or 'best'.
> 
> In Mint, when that is set via the 631 menu, printing works correctly :
> I can print text files via Gvim (icon or  :ha ) & Gedit,  .odt  via LO
> & PDF via Evince ; Gedit & Evince have their own quality settings.
> 
> In Gentoo, the 631 setting has no effect, so all printing is draft.
> Only Kwrite has its own quality setting, which does work properly for text.

I've found the source of the problem.
It's necessary to choose the 'hpcups' driver, not the 'hpijs' driver,
when setting up the printer via the 631 menu.
Once that's done, Gvim Okular LO all print 'best' quality correctly.

There is also a quality setting hidden away in the LO menus :
 tools -> options -> LO -> print : set 'high' = 300 dpi.

My route to the solution was via trying the 'gutenprint' pkg.
It doesn't offer a driver for an HP DJ 2510 , only 2500 or 2540,
but that led me to look thro' the other drivers in the 631 menu
& one of them was 'hpcups'.

I'm surprised -- well, am I really ? -- that there's no mention of all this
in any of the dox, wikis, Forum discussions etc etc I've scoured.
However as usual, all problems with Gentoo are  1  level deep :
find where it is & the solution falls into place promptly (smile).

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] printing problems : hiccups solve them

2015-11-04 Thread Mick
On Thursday 05 Nov 2015 06:21:16 Philip Webb wrote:
> 151103 Philip Webb wrote:
> > The basic problem is now clear : this printer won't print draft quality,
> > but leaves blank bands across the output (no, it's not an old cartridge).
> > Therefore, something has to tell it to print 'high-quality' or 'best'.
> > 
> > In Mint, when that is set via the 631 menu, printing works correctly :
> > I can print text files via Gvim (icon or  :ha ) & Gedit,  .odt  via LO
> > & PDF via Evince ; Gedit & Evince have their own quality settings.
> > 
> > In Gentoo, the 631 setting has no effect, so all printing is draft.
> > Only Kwrite has its own quality setting, which does work properly for
> > text.
> 
> I've found the source of the problem.
> It's necessary to choose the 'hpcups' driver, not the 'hpijs' driver,
> when setting up the printer via the 631 menu.
> Once that's done, Gvim Okular LO all print 'best' quality correctly.
> 
> There is also a quality setting hidden away in the LO menus :
>  tools -> options -> LO -> print : set 'high' = 300 dpi.
> 
> My route to the solution was via trying the 'gutenprint' pkg.
> It doesn't offer a driver for an HP DJ 2510 , only 2500 or 2540,
> but that led me to look thro' the other drivers in the 631 menu
> & one of them was 'hpcups'.
> 
> I'm surprised -- well, am I really ? -- that there's no mention of all this
> in any of the dox, wikis, Forum discussions etc etc I've scoured.
> However as usual, all problems with Gentoo are  1  level deep :
> find where it is & the solution falls into place promptly (smile).

Ahh!  Yes, I forgot about this.  Sorry  :-)

hpcups is the newer driver for HP printers.  On a new box I set up hpcups and 
it worked with my old HP printer, without hpjis, but older boxen still print 
fine with hpjis, so I left them alone.  From what you're saying your printer 
*must* use hpcups.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


[gentoo-user] xen and NUMA

2015-11-04 Thread hw


Hi,

how do I know whether xen uses NUMA or not?  It says in dmesg:


[0.00] NUMA turned off
[0.00] Faking a node at [mem 0x-0x40068fff]


and 'xl info -n' shows two nodes:


node:memsizememfreedistances
   0: 14656   3304  10,20
   1: 23424   7792  20,10


which could be right --- though I would expect each node to have 12GB
rather than these weird sizes.

So is NUMA turned off or not?  Is it even possible to turn it off when it's
enabled in the BIOS?



Re: [gentoo-user] printing problems

2015-11-04 Thread Peter Humphrey
On Tuesday 03 November 2015 22:38:18 Dale wrote:

> Now if I can just get Seamonkey and Firefox to stop defaulting to
> English (United Kingdom) instead of English (United States) I'll be even
> happier.  o_O

Why would you want all those wrong spellings?

;)

-- 
Rgds
Peter




Re: [gentoo-user] xen and NUMA

2015-11-04 Thread J. Roeleveld
On 4 November 2015 13:14:18 CET, hw  wrote:
>
>Hi,
>
>how do I know whether xen uses NUMA or not?  It says in dmesg:
>
>
>[0.00] NUMA turned off
>[0.00] Faking a node at [mem
>0x-0x40068fff]
>
>
>and 'xl info -n' shows two nodes:
>
>
>node:memsizememfreedistances
>0: 14656   3304  10,20
>1: 23424   7792  20,10
>
>
>which could be right --- though I would expect each node to have 12GB
>rather than these weird sizes.
>
>So is NUMA turned off or not?  Is it even possible to turn it off when
>it's
>enabled in the BIOS?

If BIOS has it enabled. Then the OS still beeds to support it.

Recent Xen has support for it.

As for the non uniform spread of the memory. It depends how the memory modules 
are placed in the mainboard with regards to the Numa nodes. (CPU)

--
Joost 
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: [gentoo-user] Re: clean-up root partition

2015-11-04 Thread Neil Bothwick
On Wed, 4 Nov 2015 00:10:47 -0800, Raymond Jennings wrote:

> A good place to start is to make a hotlist of anything that isn't owned
> by a package.
> 
> You really shouldn't randomly delete things that portage thinks belongs
> to someone.
> 
> But if you find orphaned junk, it could be fair game.

You can build a list of orphaned files with qfile

qfile -o $(find / -xdev -type f)

You may want to exclude /etc/ from the search path as that produces a lot
of hits.


-- 
Neil Bothwick

How is it that we put man on the moon before we figured out it would be a
good idea to put wheels on luggage?


pgpIeN0XcCzFH.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] printing problems

2015-11-04 Thread J. Roeleveld
On Wednesday, November 04, 2015 02:19:40 AM Dale wrote:
> J. Roeleveld wrote:
> > On Tuesday, November 03, 2015 10:38:18 PM Dale wrote:
> >> Alan McKinnon wrote:
> >>> On 03/11/2015 18:05, Dale wrote:
>  I don't know if this will help or not but since you seem to be grasping
>  at straws, grab this one and hold on for dear life.  For the longest
>  time, every time hplip, cups and friends were updated, I had to delete
>  and readd my printer.  If I didn't, printing was not going to happen,
>  period.  I might also add, I'd restart cups just to be sure, after the
>  delete and again after the readd.  Once I did that, printing worked
>  like
>  a charm.  If I didn't know better, I'd think the ink lasted longer too.
>  ROFL  Just kidding but . . . .   If nothing else works, may want to try
>  that.
>  
>  Oh, the last time I did the setup, I ignored cups completely.  I went
>  in
>  as root and set up the printer using the hplip command.  That was at
>  least a couple years ago.  Since then, whenever I get ready to print,
>  and replace the dried out cartridges, it just works.  I have a D4260,
>  currently out of ink, again.
>  
>  I think the actual command is hp-setup.  I use KDE and that opens a GUI
>  to do the set up.  Generally, it is just clicking next.  It just seems
>  to figure out the rest itself, unless you have more than one printer
>  hooked up then you may have to select something.
>  
>  None of this may help but maybe one will.  May be worth a shot.  ;-)
> >>> 
> >>> That's my experience too. I print very little by for ages now everytime
> >>> a change was made to a printer or cups (even teeny minor ones), I'd
> >>> delete and re-add all printers plus restart cups.
> >>> 
> >>> Why does cups behave like this? Buggered if I know. I have an
> >>> unexpressable opinion based on a certain fruity vendor who seems better
> >>> at suing Samsung than actually writing code
> >> 
> >> For some reason, cups just doesn't like HP, at least in my case.  I've
> >> had that problem for ages until a couple years or so ago.  I always used
> >> cups to setup and mange the printer.  After getting enough of it one
> >> day, I stopped cups.  I then set up the printer with hplip.  It took
> >> less than a minute to do to, just keep clicking next for me.  After I
> >> did that, I don't think I have had to delete/readd the printer since.  I
> >> know I have updated both cups and hplip too, likely several times.  No
> >> telling what has been updated that they depend on.
> >> 
> >> Maybe I got lucky or maybe just not using cups works.  Odd thing is,
> >> when I rebooted later, cups started automatically and the printer still
> >> works and the printer shows up in cups.  It's been working ever since.
> >> So, kick cups out of the way, set it up using only hplip stuff and see
> >> what happens.  Heck, it just may work.  :/
> >> 
> >> Now if I can just get Seamonkey and Firefox to stop defaulting to
> >> English (United Kingdom) instead of English (United States) I'll be even
> >> happier.  o_O
> >> 
> >> Dale
> >> 
> >> :-)  :-)
> >> 
> >> P. S.  I got my elcheapo ebay cartridges today.  It still prints fine.
> >> 
> >> :-D   Oooo, pretty colors too.
> > 
> > Same here.
> > I use hp-setup to configure the printer once and then it "just works"
> > without further thinking. (Apart from having to switch it on)
> > 
> > I stopped using inkjet/deskjet/... printers years ago after having another
> > one ruined by dried up ink.
> > Currently happily using a laserprinter with a network-cable :)
> > 
> > --
> > Joost
> 
> I wish I could get me a laser printer.  I'm dipping off into electronics
> again and will have to make PCBs and they say laser printers work
> better, although I have had a couple tell me ink jets work just as good
> now, maybe better.  Still, toner doesn't seem to mess up like cartridges
> do.  Just keep the stuff in a relatively dry spot and it's ready to go
> when ever you need to print.

I find laser printers to be more expensive initially, but considering the 
amount of pages I can print per toner cartridge, compared to what I used to 
get out of the same amount of ink (comparing monetary costs), I find laser 
printers to be cheaper.
Inkjet only seems to work if I print a lot. For occasional printing, lasers 
are more reliable.

But I only print on paper.

I though PCBs are hard? How do you get those through a printer?

> Glad to know that the way I set up my printer works for someone else
> too.  Hm.

I had to rethink how I did it as it's been working without issue for a few 
years now. And I do update regularly.

--
Joost



Re: [gentoo-user] printing problems

2015-11-04 Thread Dale
J. Roeleveld wrote:
> On Tuesday, November 03, 2015 10:38:18 PM Dale wrote:
>> Alan McKinnon wrote:
>>> On 03/11/2015 18:05, Dale wrote:
 I don't know if this will help or not but since you seem to be grasping
 at straws, grab this one and hold on for dear life.  For the longest
 time, every time hplip, cups and friends were updated, I had to delete
 and readd my printer.  If I didn't, printing was not going to happen,
 period.  I might also add, I'd restart cups just to be sure, after the
 delete and again after the readd.  Once I did that, printing worked like
 a charm.  If I didn't know better, I'd think the ink lasted longer too.
 ROFL  Just kidding but . . . .   If nothing else works, may want to try
 that.

 Oh, the last time I did the setup, I ignored cups completely.  I went in
 as root and set up the printer using the hplip command.  That was at
 least a couple years ago.  Since then, whenever I get ready to print,
 and replace the dried out cartridges, it just works.  I have a D4260,
 currently out of ink, again.

 I think the actual command is hp-setup.  I use KDE and that opens a GUI
 to do the set up.  Generally, it is just clicking next.  It just seems
 to figure out the rest itself, unless you have more than one printer
 hooked up then you may have to select something.

 None of this may help but maybe one will.  May be worth a shot.  ;-)
>>> That's my experience too. I print very little by for ages now everytime
>>> a change was made to a printer or cups (even teeny minor ones), I'd
>>> delete and re-add all printers plus restart cups.
>>>
>>> Why does cups behave like this? Buggered if I know. I have an
>>> unexpressable opinion based on a certain fruity vendor who seems better
>>> at suing Samsung than actually writing code
>> For some reason, cups just doesn't like HP, at least in my case.  I've
>> had that problem for ages until a couple years or so ago.  I always used
>> cups to setup and mange the printer.  After getting enough of it one
>> day, I stopped cups.  I then set up the printer with hplip.  It took
>> less than a minute to do to, just keep clicking next for me.  After I
>> did that, I don't think I have had to delete/readd the printer since.  I
>> know I have updated both cups and hplip too, likely several times.  No
>> telling what has been updated that they depend on.
>>
>> Maybe I got lucky or maybe just not using cups works.  Odd thing is,
>> when I rebooted later, cups started automatically and the printer still
>> works and the printer shows up in cups.  It's been working ever since.
>> So, kick cups out of the way, set it up using only hplip stuff and see
>> what happens.  Heck, it just may work.  :/
>>
>> Now if I can just get Seamonkey and Firefox to stop defaulting to
>> English (United Kingdom) instead of English (United States) I'll be even
>> happier.  o_O
>>
>> Dale
>>
>> :-)  :-)
>>
>> P. S.  I got my elcheapo ebay cartridges today.  It still prints fine.
>>
>> :-D   Oooo, pretty colors too.
> Same here.
> I use hp-setup to configure the printer once and then it "just works" without 
> further thinking. (Apart from having to switch it on)
>
> I stopped using inkjet/deskjet/... printers years ago after having another 
> one 
> ruined by dried up ink.
> Currently happily using a laserprinter with a network-cable :)
>
> --
> Joost
>
>


I wish I could get me a laser printer.  I'm dipping off into electronics
again and will have to make PCBs and they say laser printers work
better, although I have had a couple tell me ink jets work just as good
now, maybe better.  Still, toner doesn't seem to mess up like cartridges
do.  Just keep the stuff in a relatively dry spot and it's ready to go
when ever you need to print. 

Glad to know that the way I set up my printer works for someone else
too.  Hm.

Dale

:-)  :-) 



Re: [gentoo-user] Re: clean-up root partition

2015-11-04 Thread Raymond Jennings
A good place to start is to make a hotlist of anything that isn't owned by
a package.

You really shouldn't randomly delete things that portage thinks belongs to
someone.

But if you find orphaned junk, it could be fair game.  If you have
something bulky that DOES belong to a package, consider using emerge
--unmerge on it if you don't need it.

On Thu, Oct 1, 2015 at 1:15 PM, Nikos Chantziaras  wrote:

> On 01/10/15 23:14, Nikos Chantziaras wrote:
>
>> ncdu also makes it easier to find where the space is consumed. "ncdu /"
>> will scan and sort by size.
>>
>
> Sorry, should have been:
>
>   ncdu -x /
>
> This will exclude mounted filesystems.
>
>
>
>


Re: [gentoo-user] printing problems

2015-11-04 Thread Dale
J. Roeleveld wrote:
> On Wednesday, November 04, 2015 02:19:40 AM Dale wrote:
>>
>> I wish I could get me a laser printer.  I'm dipping off into electronics
>> again and will have to make PCBs and they say laser printers work
>> better, although I have had a couple tell me ink jets work just as good
>> now, maybe better.  Still, toner doesn't seem to mess up like cartridges
>> do.  Just keep the stuff in a relatively dry spot and it's ready to go
>> when ever you need to print.
> I find laser printers to be more expensive initially, but considering the 
> amount of pages I can print per toner cartridge, compared to what I used to 
> get out of the same amount of ink (comparing monetary costs), I find laser 
> printers to be cheaper.
> Inkjet only seems to work if I print a lot. For occasional printing, lasers 
> are more reliable.
>
> But I only print on paper.
>
> I though PCBs are hard? How do you get those through a printer?
>
>
> --
> Joost
>
>

I'm pretty sure you are right.  Toner goes a long ways.  The few laser
printers I have dealt with also last longer than ink jet stuff.  Right
now, I have a large gob of ink under the cartridge where it parks.  I
figure temp changes are making it have just enough pressure at times to
squeeze some out.  At least it still prints, for now. 

I used to make PCBs by hand.  I would draw with a pen or use dry
transfer sheets to make my circuits.  Once that was done, and checked
about a dozen times, I dropped it into the etchant.  A little while
later, out come the PCB ready to drill and put parts on.  Those little
drill bits are kinda cute.  lol 

From what I have read, I can print the PCB layout on paper and then use
that to transfer the circuit to the PCB which has a photo-resist coating
on it.  Or whatever that is called.  I've never done it but from what I
read, it is the way to do it home style.  If a person needs a lot of the
same board, send the files off to a PCB maker and let them run them
off.  I've been told there are a few places in China that does one heck
of a job on them even in fairly small quantities.  Price isn't bad either. 

Most likely my first project will be a new adjustable power supply. 
After that, a fence charger to keep deer and wild hogs out of my
garden.  It's either that or a bullet.  o_O 

Dale

:-)  :-)