Re: [gentoo-user] How to dim the display brightness

2009-02-24 Thread Damian
On Mon, Feb 23, 2009 at 9:57 PM, Damian damian.o...@gmail.com wrote:
 Hi Sebastian,

 acpi_os-name = Linux as kernel parameter might help.
 Ok, I've changed the grub menu.lst file. After the reboot I will write
 if something changes.
Nope :(


 and take a look if /sys/class/backlight/acpi_video0/ is present:
 this is the kernel interface to set the brightness.
 I have it, but running
    cho 2  /sys/class/backlight/acpi_video0/brightness
 has no effect in the display brightness.

 CONFIG_BACKLIGHT_LCD_SUPPORT

 is the appropriate kernel config category to look at in recent kernels.
 Yes, that variable is set.

 BTW which kernel are you using?
 2.6.27-r2

 No doubt: the first dimms the videocard output, the latter the LCD.
 I didn't know the reasons for this missmatch, thanks a lot for this
 brief but useful explanation.

 You can use xev to see which keycode is emmitted and then look in your
 desktop environment if this is match with some action.
 In fact, Fn + dimming keys produces output. Now, to do something
 useful, I need to know how to dim the light of the LCD.

 Well. it should be somehow applicable, because it is rather generic.
 I don't know how to replace this line
    echo level ${LEVEL}  /proc/acpi/ibm/brightness

 I have a file
    /proc/acpi/video/C14B/C160/brightness
 whose contents look like
    levels:  100 51 30 37 44 51 58 65 72 79 86 93 100
    current: 72

 I did some echoes to that file, but no luck so far :(




Re: [gentoo-user] [OT] - command line read *.csv create new file

2009-02-24 Thread Etaoin Shrdlu
On Tuesday 24 February 2009, 03:26, Mark Knecht wrote:

 If I drop columns - and I do need to - then something like how cut
 works would be good, but it needs to repeat across all the rows being
 used. For instance, if I'm dropping columns 6  12 from a 20 column
 wide data set, then I'm dropping 6  12 from all N lines. This is
 where using cut after the line is built is difficult as I'm forced to
 figure out a list like 6,12,26,32,46,52, etc. Easy to make a mistake
 doing that. If I could say something like Drop 6  12 from all rows,
 and 1  2 from all rows higher than the first that make up this new
 line then that would be great. That's a lot to ask though.

 D1,T1,A1,B1,C1,D1,
 D2,T2,A2,B2,C2,D2,
 D3,T3,A3,B3,C3,D3,
 D4,T4,A4,B4,C4,D4,
 D5,T5,A5,B5,C5,D5,

 In the data above if I drop column A, then I drop it for all rows.
 (For instance, A contains 0 and isn't necessary, etc.)  Assuming 3
 wide I'd get

 D1,T1,B1,C1,D1,B2,C2,D2,B3,C3,D3
 D2,T2,B2,C2,D2,B3,C3,D3,B4,C4,D4
 D3,T3,B3,C3,D3,B4,C4,D4,B5,C5,D5

 Making that completely flexible - where I can drop 4 or 5 random
 columns - is probably a bit too much work. On the other hand maybe
 sending it to cut as part of the whole process, line by lone or
 something, is more reasonable? I don't know.

The current dropcol variable drops fields from the beginning of line. 
Doing that for arbitrary columns can be done, but requires an array 
where to save the numbers of the columns to drop. 

So, in my understanding this is what we want to accomplish so far:

given an input of the form

D1,T1,a1,b1,c1,d1,...,R1
D2,T2,a2,b2,c2,d2,...,R2
D3,T3,a3,b3,c3,d3,...,R3
D4,T4,a4,b4,c4,d4,...,R4
D5,T5,a5,b5,c5,d5,...,R5

(the ... mean that an  arbitrary number of columns can follow)

You want to group lines by n at a time, keeping the D and T column from 
the first line of each group, and keeping the R column from the last 
line of the group, so for example with n=3 we would have:

D1,T1,a1,b1,c1,d1,...a2,b2,c2,d2,...a3,b3,c3,d3,...R3
D1,T1,a2,b2,c2,d2,...a3,b3,c3,d3,...a4,b4,c4,d4,...R4
D1,T1,a3,b3,c3,d3,...a4,b4,c4,d4,...a5,b5,c5,d5,...R5

(and you're right, that produces an output that is roughly n times the 
size of the original file)

Now, in addition to that, you also want to drop an arbitrary number of  
columns in the a,b,c... group. So for example, you want to drop columns 
2 and 3 (b and c in the example), so you'd end up with something like

D1,T1,a1,d1,...a2,d2,...a3,d3,...R3
D1,T1,a2,d2,...a3,d3,...a4,d4,...R4
D1,T1,a3,d3,...a4,d4,...a5,d5,...R5

Please confirm that my understanding is correct, so I can come up with 
some code to do that.

 I found a web site to study awk so I'm starting to see more or less
 how your example works when I have the code in front of me. Creating
 the code out of thin air might be a bit of a stretch for me at this
 point though.

I suggest you start from 

http://www.gnu.org/software/gawk/manual/gawk.html

really complete, but gradual so you can have an easy start and move on to 
the complexities later.



[gentoo-user] Re: Installing OSS / error adding oss-overlay

2009-02-24 Thread Nikos Chantziaras

Nikos Chantziaras wrote:

[...]
Hopefully they'll fix it soon.


It should be fixed now.  Remove and re-add the overlay in layman and resync.




Re: [gentoo-user] [OT] - command line read *.csv create new file

2009-02-24 Thread Mark Knecht
On Tue, Feb 24, 2009 at 2:56 AM, Etaoin Shrdlu shr...@unlimitedmail.org wrote:
SNIP

 So, in my understanding this is what we want to accomplish so far:

 given an input of the form

 D1,T1,a1,b1,c1,d1,...,R1
 D2,T2,a2,b2,c2,d2,...,R2
 D3,T3,a3,b3,c3,d3,...,R3
 D4,T4,a4,b4,c4,d4,...,R4
 D5,T5,a5,b5,c5,d5,...,R5

 (the ... mean that an  arbitrary number of columns can follow)

 You want to group lines by n at a time, keeping the D and T column from
 the first line of each group, and keeping the R column from the last
 line of the group, so for example with n=3 we would have:

 D1,T1,a1,b1,c1,d1,...a2,b2,c2,d2,...a3,b3,c3,d3,...R3
 D1,T1,a2,b2,c2,d2,...a3,b3,c3,d3,...a4,b4,c4,d4,...R4
 D1,T1,a3,b3,c3,d3,...a4,b4,c4,d4,...a5,b5,c5,d5,...R5

 (and you're right, that produces an output that is roughly n times the
 size of the original file)

 Now, in addition to that, you also want to drop an arbitrary number of
 columns in the a,b,c... group. So for example, you want to drop columns
 2 and 3 (b and c in the example), so you'd end up with something like

 D1,T1,a1,d1,...a2,d2,...a3,d3,...R3
 D1,T1,a2,d2,...a3,d3,...a4,d4,...R4
 D1,T1,a3,d3,...a4,d4,...a5,d5,...R5

 Please confirm that my understanding is correct, so I can come up with
 some code to do that.

Perfectly correct for all the data rows.

For the header I now see that we have a slightly harder job. What we'd
need to do is read the first line of the file, duplicate it N times,
and then drop the same columns as we drop in the rows. The problem is
that now I have the same header value for N columns which won't make
sense to the tool that uses this data. If we could read the header and
then automatically postpend the number N to each duplicated name. (or
some string like _N)

Maybe better would be a separate small program to do the header part
and then this program could read that header and make it the first
line of the output file. My worry is that when this data file becomes
very large - say 1GB or more of data - I probably cannot open the file
with vi to edit the header. Better if I could put the header in it's
own file. That file would be 1 line long. I could check it for the
name edits, make sure it's right, and then the program you are so
kindly building would just read it, cut out columns, and put it at the
start of the new large file.

Does that make sense?


 I found a web site to study awk so I'm starting to see more or less
 how your example works when I have the code in front of me. Creating
 the code out of thin air might be a bit of a stretch for me at this
 point though.

 I suggest you start from

 http://www.gnu.org/software/gawk/manual/gawk.html

 really complete, but gradual so you can have an easy start and move on to
 the complexities later.



Yes, very complete. A good reference. Thanks!

Cheers,
Mark



Re: [gentoo-user] MonetBD on portage?

2009-02-24 Thread Paul Hartman
On Tue, Feb 24, 2009 at 12:41 AM, Dirk Uys dirkc...@gmail.com wrote:
 On Mon, Feb 23, 2009 at 5:41 PM, Paul Hartman
 paul.hartman+gen...@gmail.com wrote:
 On Mon, Feb 23, 2009 at 9:36 AM, laurent laur...@logiquefloue.org wrote:

 Apparently monetdb maintainer requested it to be removed from Portage.
 You can still access the prior ebuilds at:

 http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/monetdb/?hideattic=0

 Good luck
 Paul

 The maintainer of the ebuild or the maintainer of the monetDB project?

 Regards
 Dirk



I have no idea. The Changelog says:

Masked since always, requested removal from maintainer.

I never even heard of MonetDB before... I was just relaying the information :)

Paul



[gentoo-user] Re: MonetBD on portage?

2009-02-24 Thread Nikos Chantziaras

Paul Hartman wrote:

On Tue, Feb 24, 2009 at 12:41 AM, Dirk Uys dirkc...@gmail.com wrote:

On Mon, Feb 23, 2009 at 5:41 PM, Paul Hartman
paul.hartman+gen...@gmail.com wrote:

On Mon, Feb 23, 2009 at 9:36 AM, laurent laur...@logiquefloue.org wrote:

Apparently monetdb maintainer requested it to be removed from Portage.
You can still access the prior ebuilds at:

http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/monetdb/?hideattic=0

Good luck
Paul

The maintainer of the ebuild or the maintainer of the monetDB project?

Regards
Dirk




I have no idea. The Changelog says:

Masked since always, requested removal from maintainer.


That's usually the ebuild maintainer.  Projects is referred to as 
upstream, not maintainer.





[gentoo-user] Re: Portage and sets

2009-02-24 Thread James
Alan McKinnon alan.mckinnon at gmail.com writes:


 As to why there isn't such a thing with portage, I don't know. You would have 
 to ask the kde ebuild maintainers. But if you would like to have this 
 collection of sets and haven't added the overlay, I'd happily send you a 
 tarball of all the kde sets.


OK email them to me.


thx,


James










[gentoo-user] {OT} TCP or UDP?

2009-02-24 Thread Grant
How can I find out whether I should be specifying TCP, UDP, or both
for iptables (shorewall) config?

- Grant



[gentoo-user] Re: {OT} TCP or UDP?

2009-02-24 Thread Nikos Chantziaras

Grant wrote:

How can I find out whether I should be specifying TCP, UDP, or both
for iptables (shorewall) config?


By knowing the application's protocol for which you write the rules for :P

For example, if I write some rule that applies to traffic generated by a 
web server and web browsers, that's TCP.  If I write rules that apply to 
an online game's matchmaking and game discovery browser, that's UDP (but 
depends on the game).  So you have to research a bit to see if the 
application uses TCP or UDP.





[gentoo-user] OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Michael Higgins
I can't figure this one out. 

Have disallowed root login, public key auth.

Have a bunch of random renaming to do on that machine though, so would like to 
point and click for a change.

Is this possible? No GUI libs on the remote machine...

I was thinking sshfs, but since I can't login directly as root, is there some 
other way?

Cheers,

-- 
 |\  /||   |  ~ ~  
 | \/ ||---|  `|` ?
 ||ichael  |   |iggins\^ /
 michael.higgins[at]evolone[dot]org



[gentoo-user] Re: OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Nikos Chantziaras

Michael Higgins wrote:
I can't figure this one out. 


Have disallowed root login, public key auth.

Have a bunch of random renaming to do on that machine though, so would like to 
point and click for a change.

Is this possible? No GUI libs on the remote machine...

I was thinking sshfs, but since I can't login directly as root, is there some 
other way?


Don't think there's a way.  The simplest would be installing an X 
filemanager on the server but don't run X only on your machine (ssh -Y).


(Btw, in case you're using KDE, you don't need sshfs.  You can simply 
fish:// into your server in Dolphin or Konqueror.)





Re: [gentoo-user] OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Alan McKinnon
On Tuesday 24 February 2009 19:02:42 Michael Higgins wrote:
 I can't figure this one out.

 Have disallowed root login, public key auth.

 Have a bunch of random renaming to do on that machine though, so would like
 to point and click for a change.

 Is this possible? No GUI libs on the remote machine...

 I was thinking sshfs, but since I can't login directly as root, is there
 some other way?

Export temporarily via nfs or samba. With nfs, remember to set no_root_squash, 
which is highly unrecommended, leaving samba as actually quite decent for this 
kind of thing.

-- 
alan dot mckinnon at gmail dot com





[gentoo-user] Orphan e-mail message in kmail

2009-02-24 Thread Peter Humphrey
Greetings,

After a power failure a few days ago, kmail-1.9.9 now has one message in one 
folder that can't be read, viewed, moved or deleted. It's shown at the top 
of the list instead of near the bottom, and nothing I can think of will 
make any change to it.

Can anyone suggest a reasonably safe approach to getting rid of it? I don't 
mind losing it as long as I don't lose anything else.

I suppose I could delete my home directory, create a new one and import 
kmail's stuff from the old to the new, together with other applications' 
stuff, but I don't know any way to import filters, and anyway it's an awful 
fag.

-- 
Rgds
Peter



Re: [gentoo-user] Re: {OT} TCP or UDP?

2009-02-24 Thread Florian Philipp

Nikos Chantziaras schrieb:

Grant wrote:

How can I find out whether I should be specifying TCP, UDP, or both
for iptables (shorewall) config?


By knowing the application's protocol for which you write the rules for :P
[...]   So you have to research a bit to see if the
application uses TCP or UDP.




 You can also have a look at /etc/services which lists the more common 
protocols and their ports.




Re: [gentoo-user] [OT] - command line read *.csv create new file

2009-02-24 Thread Etaoin Shrdlu
On Tuesday 24 February 2009, 15:41, Mark Knecht wrote:
 On Tue, Feb 24, 2009 at 2:56 AM, Etaoin Shrdlu
 shr...@unlimitedmail.org wrote: SNIP

  So, in my understanding this is what we want to accomplish so far:
 
  given an input of the form
 
  D1,T1,a1,b1,c1,d1,...,R1
  D2,T2,a2,b2,c2,d2,...,R2
  D3,T3,a3,b3,c3,d3,...,R3
  D4,T4,a4,b4,c4,d4,...,R4
  D5,T5,a5,b5,c5,d5,...,R5
 
  (the ... mean that an  arbitrary number of columns can follow)
 
  You want to group lines by n at a time, keeping the D and T column
  from the first line of each group, and keeping the R column from the
  last line of the group, so for example with n=3 we would have:
 
  D1,T1,a1,b1,c1,d1,...a2,b2,c2,d2,...a3,b3,c3,d3,...R3
  D1,T1,a2,b2,c2,d2,...a3,b3,c3,d3,...a4,b4,c4,d4,...R4
  D1,T1,a3,b3,c3,d3,...a4,b4,c4,d4,...a5,b5,c5,d5,...R5
 
  (and you're right, that produces an output that is roughly n times
  the size of the original file)
 
  Now, in addition to that, you also want to drop an arbitrary number
  of columns in the a,b,c... group. So for example, you want to drop
  columns 2 and 3 (b and c in the example), so you'd end up with
  something like
 
  D1,T1,a1,d1,...a2,d2,...a3,d3,...R3
  D1,T1,a2,d2,...a3,d3,...a4,d4,...R4
  D1,T1,a3,d3,...a4,d4,...a5,d5,...R5
 
  Please confirm that my understanding is correct, so I can come up
  with some code to do that.

 Perfectly correct for all the data rows.

 For the header I now see that we have a slightly harder job. What we'd
 need to do is read the first line of the file, duplicate it N times,
 and then drop the same columns as we drop in the rows. The problem is
 that now I have the same header value for N columns which won't make
 sense to the tool that uses this data. If we could read the header and
 then automatically postpend the number N to each duplicated name. (or
 some string like _N)

So in the last example the header would be something like

D,T,a,b,c,d,...,R

in the original file, and would become 

D,T,a_1,b_1,c_1,d_1,...a_2,b_2,c_2,d_2,...a_3,b_3,c_3,d_3,...R

and

D,T,a_1,d_1,...a_2,d_2,...a_3,d_3,...R

respectively for the two sample outputs above.

 Maybe better would be a separate small program to do the header part
 and then this program could read that header and make it the first
 line of the output file. My worry is that when this data file becomes
 very large - say 1GB or more of data - I probably cannot open the file
 with vi to edit the header. Better if I could put the header in it's
 own file. That file would be 1 line long. I could check it for the
 name edits, make sure it's right, and then the program you are so
 kindly building would just read it, cut out columns, and put it at the
 start of the new large file.

 Does that make sense?

Maybe, but while we're at it my personal preference would be to just add 
header handling to the existing program. Here's the revised code (also 
cleaned up a bit and more structured):

# returns a ,a1,b1,c1,.. line
# drops unwanted columns
function do_line(num) {
  line=
  for(j=3;jNF;j++)
if(!((j-2) in dc)){line=line OFS $j (num0?_num:)}
  return line
}

# dcols is a string like '2,3,4,7' with a comma separated values list of
# the columns to drop (first data column after date/time is column 1
# here)

BEGIN {FS=OFS=,
   t=split(dcols,tmp,/,/)
   for(i=1;i=t;i++)dc[tmp[i]]
  }

# process the header
NR==1{
  l=$1 OFS $2;
  for(i=1;i=n;i++)l=l do_line(i)
  l=l OFS $NF
  print l
}

NR=2{
  for(i=1;in;i++){
s[i]=s[i+1]
dt[i]=dt[i+1]
  }

  dt[n]=$1 OFS $2
  s[n]=do_line(-1)

  if(NR=n+1){
l=dt[1]
for(i=1;i=n;i++)l=l s[i]
l=l OFS $NF
print l
  }
}'

I think two examples are enough here to demonstrate how it works (blank 
lines between commands added for clarity - remember first line is header 
line):

$ cat file.csv
D,T,a,b,c,d,R
D1,T1,a1,b1,c1,d1,R1
D2,T2,a2,b2,c2,d2,R2
D3,T3,a3,b3,c3,d3,R3
D4,T4,a4,b4,c4,d4,R4
D5,T5,a5,b5,c5,d5,R5
D6,T6,a6,b6,c6,d6,R6

$ awk -v n=3 -f program.awk file.csv
D,T,a_1,b_1,c_1,d_1,a_2,b_2,c_2,d_2,a_3,b_3,c_3,d_3,R
D1,T1,a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,R3
D2,T2,a2,b2,c2,d2,a3,b3,c3,d3,a4,b4,c4,d4,R4
D3,T3,a3,b3,c3,d3,a4,b4,c4,d4,a5,b5,c5,d5,R5
D4,T4,a4,b4,c4,d4,a5,b5,c5,d5,a6,b6,c6,d6,R6

$ awk -v n=3 -v dcols='1,3' -f program.awk file.csv
D,T,b_1,d_1,b_2,d_2,b_3,d_3,R
D1,T1,b1,d1,b2,d2,b3,d3,R3
D2,T2,b2,d2,b3,d3,b4,d4,R4
D3,T3,b3,d3,b4,d4,b5,d5,R5
D4,T4,b4,d4,b5,d5,b6,d6,R6

The program still assumes that first two columns and last column must be 
excluded from the general processing, and just prepended and appended to 
the output lines. That can be changed though.



Re: [gentoo-user] Re: {OT} TCP or UDP?

2009-02-24 Thread Etaoin Shrdlu
On Tuesday 24 February 2009, 18:21, Florian Philipp wrote:
 Nikos Chantziaras schrieb:
  Grant wrote:
  How can I find out whether I should be specifying TCP, UDP, or both
  for iptables (shorewall) config?
 
  By knowing the application's protocol for which you write the rules
  for :P [...]   So you have to research a bit to see if the
  application uses TCP or UDP.

   You can also have a look at /etc/services which lists the more
 common protocols and their ports.

Or even sniff the traffic and see which protocols are used.



Re: [gentoo-user] Orphan e-mail message in kmail

2009-02-24 Thread Volker Armin Hemmann
On Dienstag 24 Februar 2009, Peter Humphrey wrote:
 Greetings,

 After a power failure a few days ago, kmail-1.9.9 now has one message in
 one folder that can't be read, viewed, moved or deleted. It's shown at the
 top of the list instead of near the bottom, and nothing I can think of will
 make any change to it.

 Can anyone suggest a reasonably safe approach to getting rid of it? I don't
 mind losing it as long as I don't lose anything else.

 I suppose I could delete my home directory, create a new one and import
 kmail's stuff from the old to the new, together with other applications'
 stuff, but I don't know any way to import filters, and anyway it's an awful
 fag.

go into the mail directory and remove the index file. kmail must not running!
Then start kmail and let it re-index the directory. After that you can read 
it, move it, remove it.

Maybe just rebuilding index is enough, but I had cases in the past where that 
was not enough.




Re: [gentoo-user] Re: {OT} TCP or UDP?

2009-02-24 Thread kashani

Etaoin Shrdlu wrote:

On Tuesday 24 February 2009, 18:21, Florian Philipp wrote:

Nikos Chantziaras schrieb:

Grant wrote:

How can I find out whether I should be specifying TCP, UDP, or both
for iptables (shorewall) config?

By knowing the application's protocol for which you write the rules
for :P [...]   So you have to research a bit to see if the
application uses TCP or UDP.

  You can also have a look at /etc/services which lists the more
common protocols and their ports.


Or even sniff the traffic and see which protocols are used.



	You're going to miss stuff that way. Take for example a DNS server. 
Normally requests are UDP over port 53. However once your request 
exceeds 512 bytes TCP is used on port 53. That rarely happens and in 
fact many ISPs don't seem to be aware that this can happen.
	Chances are you're going to find almost everything you need at 
http://www.shorewall.net/Documentation_Index.html which is going to far 
better than trying to cobble everything together yourself.


kashani




Re: [gentoo-user] OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Paul Hartman
On Tue, Feb 24, 2009 at 11:02 AM, Michael Higgins li...@evolone.org wrote:
 I can't figure this one out.

 Have disallowed root login, public key auth.

 Have a bunch of random renaming to do on that machine though, so would like 
 to point and click for a change.

 Is this possible? No GUI libs on the remote machine...

 I was thinking sshfs, but since I can't login directly as root, is there some 
 other way?

I believe you can make a key to associate with one command only. So
perhaps you can allow root login, but the only root key is one that
runs scp. Then you can scp as root but no actual login as root is
possible to normal ssh.



Re: [gentoo-user] OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Daniel Troeder
Am Dienstag, den 24.02.2009, 09:02 -0800 schrieb Michael Higgins:
 I can't figure this one out. 
 
 Have disallowed root login, public key auth.
 
 Have a bunch of random renaming to do on that machine though, so would like 
 to point and click for a change.
 
 Is this possible? No GUI libs on the remote machine...
 
 I was thinking sshfs, but since I can't login directly as root, is there some 
 other way?

Something like this might work:

# cp /etc/ssh/sshd_config /root/sshd_root_allow_config

Then edit /root/sshd_root_allow_config to allow root-login, to listen on
a port != 22 and to use another PID-file:
---
Port 222
PidFile /var/run/sshd_root_allow.pid
PermitRootLogin yes
---

Install app-admin/sudo and configure, that your login-user can execute
the following two commands (maybe only these!?!):
# sudo /usr/sbin/sshd -f /root/sshd_root_allow_config
# sudo kill $(cat /var/run/sshd_root_allow.pid)

Then you can use sshfs to port 222 between the two commands as root :)

Bye,
Daniel


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [gentoo-user] Re: Portage and sets

2009-02-24 Thread Dale
James wrote:
 Alan McKinnon alan.mckinnon at gmail.com writes:


   
 As to why there isn't such a thing with portage, I don't know. You would 
 have 
 to ask the kde ebuild maintainers. But if you would like to have this 
 collection of sets and haven't added the overlay, I'd happily send you a 
 tarball of all the kde sets.
 


 OK email them to me.


 thx,


 James

   

He emailed a copy to the list so you should be able to get them.  I
already got mine.  It is one reply above this one I think.  It is in my
mail box anyway.  It's a attachment. 

Dale

:-)  :-) 



Re: [gentoo-user] [OT] - command line read *.csv create new file

2009-02-24 Thread Mark Knecht
On Tue, Feb 24, 2009 at 9:48 AM, Etaoin Shrdlu shr...@unlimitedmail.org wrote:
 On Tuesday 24 February 2009, 15:41, Mark Knecht wrote:
 On Tue, Feb 24, 2009 at 2:56 AM, Etaoin Shrdlu
 shr...@unlimitedmail.org wrote: SNIP

  So, in my understanding this is what we want to accomplish so far:
 
  given an input of the form
 
  D1,T1,a1,b1,c1,d1,...,R1
  D2,T2,a2,b2,c2,d2,...,R2
  D3,T3,a3,b3,c3,d3,...,R3
  D4,T4,a4,b4,c4,d4,...,R4
  D5,T5,a5,b5,c5,d5,...,R5
 
  (the ... mean that an  arbitrary number of columns can follow)
 
  You want to group lines by n at a time, keeping the D and T column
  from the first line of each group, and keeping the R column from the
  last line of the group, so for example with n=3 we would have:
 
  D1,T1,a1,b1,c1,d1,...a2,b2,c2,d2,...a3,b3,c3,d3,...R3
  D1,T1,a2,b2,c2,d2,...a3,b3,c3,d3,...a4,b4,c4,d4,...R4
  D1,T1,a3,b3,c3,d3,...a4,b4,c4,d4,...a5,b5,c5,d5,...R5
 
  (and you're right, that produces an output that is roughly n times
  the size of the original file)
 
  Now, in addition to that, you also want to drop an arbitrary number
  of columns in the a,b,c... group. So for example, you want to drop
  columns 2 and 3 (b and c in the example), so you'd end up with
  something like
 
  D1,T1,a1,d1,...a2,d2,...a3,d3,...R3
  D1,T1,a2,d2,...a3,d3,...a4,d4,...R4
  D1,T1,a3,d3,...a4,d4,...a5,d5,...R5
 
  Please confirm that my understanding is correct, so I can come up
  with some code to do that.

 Perfectly correct for all the data rows.

 For the header I now see that we have a slightly harder job. What we'd
 need to do is read the first line of the file, duplicate it N times,
 and then drop the same columns as we drop in the rows. The problem is
 that now I have the same header value for N columns which won't make
 sense to the tool that uses this data. If we could read the header and
 then automatically postpend the number N to each duplicated name. (or
 some string like _N)

 So in the last example the header would be something like

 D,T,a,b,c,d,...,R

 in the original file, and would become

 D,T,a_1,b_1,c_1,d_1,...a_2,b_2,c_2,d_2,...a_3,b_3,c_3,d_3,...R

 and

 D,T,a_1,d_1,...a_2,d_2,...a_3,d_3,...R

 respectively for the two sample outputs above.

 Maybe better would be a separate small program to do the header part
 and then this program could read that header and make it the first
 line of the output file. My worry is that when this data file becomes
 very large - say 1GB or more of data - I probably cannot open the file
 with vi to edit the header. Better if I could put the header in it's
 own file. That file would be 1 line long. I could check it for the
 name edits, make sure it's right, and then the program you are so
 kindly building would just read it, cut out columns, and put it at the
 start of the new large file.

 Does that make sense?

 Maybe, but while we're at it my personal preference would be to just add
 header handling to the existing program. Here's the revised code (also
 cleaned up a bit and more structured):

 # returns a ,a1,b1,c1,.. line
 # drops unwanted columns
 function do_line(num) {
  line=
  for(j=3;jNF;j++)
    if(!((j-2) in dc)){line=line OFS $j (num0?_num:)}
  return line
 }

 # dcols is a string like '2,3,4,7' with a comma separated values list of
 # the columns to drop (first data column after date/time is column 1
 # here)

 BEGIN {FS=OFS=,
       t=split(dcols,tmp,/,/)
       for(i=1;i=t;i++)dc[tmp[i]]
      }

 # process the header
 NR==1{
  l=$1 OFS $2;
  for(i=1;i=n;i++)l=l do_line(i)
  l=l OFS $NF
  print l
 }

 NR=2{
  for(i=1;in;i++){
    s[i]=s[i+1]
    dt[i]=dt[i+1]
  }

  dt[n]=$1 OFS $2
  s[n]=do_line(-1)

  if(NR=n+1){
    l=dt[1]
    for(i=1;i=n;i++)l=l s[i]
    l=l OFS $NF
    print l
  }
 }'

 I think two examples are enough here to demonstrate how it works (blank
 lines between commands added for clarity - remember first line is header
 line):

 $ cat file.csv
 D,T,a,b,c,d,R
 D1,T1,a1,b1,c1,d1,R1
 D2,T2,a2,b2,c2,d2,R2
 D3,T3,a3,b3,c3,d3,R3
 D4,T4,a4,b4,c4,d4,R4
 D5,T5,a5,b5,c5,d5,R5
 D6,T6,a6,b6,c6,d6,R6

 $ awk -v n=3 -f program.awk file.csv
 D,T,a_1,b_1,c_1,d_1,a_2,b_2,c_2,d_2,a_3,b_3,c_3,d_3,R
 D1,T1,a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,R3
 D2,T2,a2,b2,c2,d2,a3,b3,c3,d3,a4,b4,c4,d4,R4
 D3,T3,a3,b3,c3,d3,a4,b4,c4,d4,a5,b5,c5,d5,R5
 D4,T4,a4,b4,c4,d4,a5,b5,c5,d5,a6,b6,c6,d6,R6

 $ awk -v n=3 -v dcols='1,3' -f program.awk file.csv
 D,T,b_1,d_1,b_2,d_2,b_3,d_3,R
 D1,T1,b1,d1,b2,d2,b3,d3,R3
 D2,T2,b2,d2,b3,d3,b4,d4,R4
 D3,T3,b3,d3,b4,d4,b5,d5,R5
 D4,T4,b4,d4,b5,d5,b6,d6,R6

 The program still assumes that first two columns and last column must be
 excluded from the general processing, and just prepended and appended to
 the output lines. That can be changed though.


Excellent! Worked identically for me once I removed an extra single
quote after the last brace that somehow crept into your copy/paste in
this email. Really good stuff.

I tried it on a 40MB data file from TradeStation with 6 years of 5
minute Dow Futures 

Re: [gentoo-user] How to dim the display brightness

2009-02-24 Thread Steffen Loos
Hello Damian,

 and take a look if /sys/class/backlight/acpi_video0/ is present:
On an IBM T61 i have acpi_video1 too. Video0 represents the vga/dvi output 
where video1 represents the LCD.
Also have a look on max_brightness on this dirs for the maximum value. 


 You can use xev to see which keycode is emmitted and then look in your
 desktop environment if this is match with some action.
 In fact, Fn + dimming keys produces output. Now, to do something
 useful, I need to know how to dim the light of the LCD.
As workarround you could switch to a console (Ctrl+Alt+F1) and try to dim with 
your fn+ keys.


 Well. it should be somehow applicable, because it is rather generic.
 I don't know how to replace this line
echo level ${LEVEL}  /proc/acpi/ibm/brightness

 I have a file
/proc/acpi/video/C14B/C160/brightness
 whose contents look like
levels:  100 51 30 37 44 51 58 65 72 79 86 93 100
current: 72
Be careful to touch the right (video-)output. In /proc/acpi/video i have two 
devices: VID and VID1. VID1 references to my LCD.

Steffen





Re: [gentoo-user] How to dim the display brightness

2009-02-24 Thread Damian
Hi Steffen,

 and take a look if /sys/class/backlight/acpi_video0/ is present:
 On an IBM T61 i have acpi_video1 too. Video0 represents the vga/dvi output 
 where video1 represents the LCD.
 Also have a look on max_brightness on this dirs for the maximum value.
No, I only have video0.

 As workarround you could switch to a console (Ctrl+Alt+F1) and try to dim 
 with your fn+ keys.
Yes, that's is what I'm currently doing.

 Be careful to touch the right (video-)output. In /proc/acpi/video i have two 
 devices: VID and VID1. VID1 references to my LCD.
Yes, I looked into that folder, but I had no results so far :(

I'm still trying ...

Thanks for your mail.

Best regards,
Damian.

 Steffen







Re: [gentoo-user] OT -- superuser file manager access to remote via ssh with no root login?

2009-02-24 Thread Mike Kazantsev
On Tue, 24 Feb 2009 09:02:42 -0800
Michael Higgins li...@evolone.org wrote:

 I can't figure this one out. 
 
 Have disallowed root login, public key auth.
 
 Have a bunch of random renaming to do on that machine though, so
 would like to point and click for a change.
 
 Is this possible? No GUI libs on the remote machine...
 
 I was thinking sshfs, but since I can't login directly as root, is
 there some other way?

I can see several solutions, as well:

1. Restrict root auth to public key and bind public key to your IP
only ( 'from=IP ssh-dss ...' in authorized_hosts, or tcp wrappers ).

2. Create login like 'somerandomuser' (you can actually use a hash
here, if you're security-crazed) and disallow root auth from pam, not
sshd.

3. Since it sounds like you have no need to do it repeatedly, why not
open root and do the stuff? Provided you don't have '123' as password.


While I think security is overally a good thing, making some aspects of
it a pain in the ass is what I just can't understand in people: it may
take ages to pick the root password (provided you have right anti-brute
daemon installed), but they will make their lives miserable over
it, while leaving the same passwords typed in the terminals and written
on paper scraps lying on the desk, not to mention a lot of more obvious
things.

-- 
Mike Kazantsev // fraggod.net


signature.asc
Description: PGP signature


[gentoo-user] OpenOffice-bin spell checking?

2009-02-24 Thread Mark Knecht
Hi,
   I emerged eselect-oodict and it acts like it's doing something but
still I don't see any dictionaries in

Tools-Options-Language Settings-Writing Aids

   Under Languages I have selected English (USA)

   Is there something else I have to turn on to get spell checking
working for my wife? I do not see the entry this person has in the
upper box. Why not? I seem to have hunspell installed and it says it's
a replacement for myspell. Does it work? What's the special trick?

Thanks,
Mark


dragonfly ~ # eselect oodict show
OpenOffice.org configured dictionaries
  [1]   myspell
Configured language codes from /usr/share/myspell:
  en
dragonfly ~ # eselect oodict unset myspell-en
dragonfly ~ # eselect oodict show
OpenOffice.org configured dictionaries
  (none)
dragonfly ~ # eselect oodict set myspell-en
dragonfly ~ # eselect oodict show
OpenOffice.org configured dictionaries
  [1]   myspell
Configured language codes from /usr/share/myspell:
  en
dragonfly ~ #

dragonfly ~ # eix -Ic spell
[I] app-dicts/aspell-en (6@08/10/2007): English (US, British,
Canadian) language dictionary for aspell
[I] app-dicts/myspell-en (20081...@02/24/2009): English dictionaries
for myspell/hunspell
[I] app-text/aspell (0.6...@08/27/2007): A spell checker replacement for ispell
[I] app-text/gnome-spell (1.0.8(1)@07/27/2008): Gnome spellchecking component
[I] app-text/hunspell (1@01/28/2009): Hunspell spell checker - an
improved replacement for myspell in OOo.
Found 5 matches.
dragonfly ~ #



[gentoo-user] Re: OpenOffice-bin spell checking?

2009-02-24 Thread Mark Knecht
Is OO really so stupid that it makes you add by hand for each user an
extension spelling library from /usr/lib/openoffice/extension/install
to get a spelling checker to work?

Is this anyway to run a business?

OK, solved. Working. I don't get it.

Sorry for the noise.

- Mark

On Tue, Feb 24, 2009 at 8:03 PM, Mark Knecht markkne...@gmail.com wrote:
 Hi,
   I emerged eselect-oodict and it acts like it's doing something but
 still I don't see any dictionaries in

 Tools-Options-Language Settings-Writing Aids

   Under Languages I have selected English (USA)

   Is there something else I have to turn on to get spell checking
 working for my wife? I do not see the entry this person has in the
 upper box. Why not? I seem to have hunspell installed and it says it's
 a replacement for myspell. Does it work? What's the special trick?

 Thanks,
 Mark


 dragonfly ~ # eselect oodict show
 OpenOffice.org configured dictionaries
  [1]   myspell
    Configured language codes from /usr/share/myspell:
      en
 dragonfly ~ # eselect oodict unset myspell-en
 dragonfly ~ # eselect oodict show
 OpenOffice.org configured dictionaries
  (none)
 dragonfly ~ # eselect oodict set myspell-en
 dragonfly ~ # eselect oodict show
 OpenOffice.org configured dictionaries
  [1]   myspell
    Configured language codes from /usr/share/myspell:
      en
 dragonfly ~ #

 dragonfly ~ # eix -Ic spell
 [I] app-dicts/aspell-en (6@08/10/2007): English (US, British,
 Canadian) language dictionary for aspell
 [I] app-dicts/myspell-en (20081...@02/24/2009): English dictionaries
 for myspell/hunspell
 [I] app-text/aspell (0.6...@08/27/2007): A spell checker replacement for 
 ispell
 [I] app-text/gnome-spell (1.0.8(1)@07/27/2008): Gnome spellchecking component
 [I] app-text/hunspell (1@01/28/2009): Hunspell spell checker - an
 improved replacement for myspell in OOo.
 Found 5 matches.
 dragonfly ~ #




Re: [gentoo-user] Orphan e-mail message in kmail

2009-02-24 Thread Alan McKinnon
On Tuesday 24 February 2009 19:18:03 Peter Humphrey wrote:
 Greetings,

 After a power failure a few days ago, kmail-1.9.9 now has one message in
 one folder that can't be read, viewed, moved or deleted. It's shown at the
 top of the list instead of near the bottom, and nothing I can think of will
 make any change to it.

 Can anyone suggest a reasonably safe approach to getting rid of it? I don't
 mind losing it as long as I don't lose anything else.

You are probably using maildir for your mail - it's the default. Shut down 
kmail completely. Go to ~/.kde/share/apps/kmail/mail/folder/cur, and delete 
the actual file. grep can help you find it even if only by identifying the 
files that isn't it.

Then delete the relevant index files in ~/.kde/share/apps/kmail/mail.
Your inbox for example is called .inbox.index.* and there will be three of 
them.

Restart kmail, it will rebuild it's indexes and all will be well.

(With KDE-4, change those paths to ~/.kde4/

 I suppose I could delete my home directory, create a new one and import
 kmail's stuff from the old to the new, together with other applications'
 stuff, but I don't know any way to import filters, and anyway it's an awful
 fag.

Don't delete your home dir! kmail keeps it's mail there and you will lose the 
lot.
-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: Portage and sets

2009-02-24 Thread Alan McKinnon
On Tuesday 24 February 2009 23:30:04 Dale wrote:
 James wrote:
  Alan McKinnon alan.mckinnon at gmail.com writes:
  As to why there isn't such a thing with portage, I don't know. You would
  have to ask the kde ebuild maintainers. But if you would like to have
  this collection of sets and haven't added the overlay, I'd happily send
  you a tarball of all the kde sets.
 
  OK email them to me.
 
 
  thx,
 
 
  James

 He emailed a copy to the list 

I did? Oh dear. Meant to send them direct to Dale and James. Sorry for the 
noise.



 so you should be able to get them.  I
 already got mine.  It is one reply above this one I think.  It is in my
 mail box anyway.  It's a attachment.

 Dale

 :-)  :-)

-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: Portage and sets

2009-02-24 Thread Dale
Alan McKinnon wrote:
 On Tuesday 24 February 2009 23:30:04 Dale wrote:
   
 James wrote:
 
 Alan McKinnon alan.mckinnon at gmail.com writes:
   
 As to why there isn't such a thing with portage, I don't know. You would
 have to ask the kde ebuild maintainers. But if you would like to have
 this collection of sets and haven't added the overlay, I'd happily send
 you a tarball of all the kde sets.
 
 OK email them to me.


 thx,


 James
   
 He emailed a copy to the list 
 

 I did? Oh dear. Meant to send them direct to Dale and James. Sorry for the 
 noise.



   
 so you should be able to get them.  I
 already got mine.  It is one reply above this one I think.  It is in my
 mail box anyway.  It's a attachment.

 Dale

 :-)  :-)
 

   

Ooops, you didn't send them to the list.  Since you didn't change the
subject line, it put it in the same folder as gentoo-user stuff.  I
didn't even notice.  My bad. 

I filter mailing lists by subject since it starts the same way in the
subject line.  You know, gentoo-user, gentoo-dev etc etc. 

I need to open my eyes.

Dale

:-)  :-)



Re: [gentoo-user] Re: Portage and sets

2009-02-24 Thread Alan McKinnon
On Wednesday 25 February 2009 07:43:42 Dale wrote:
 Ooops, you didn't send them to the list.  Since you didn't change the
 subject line, it put it in the same folder as gentoo-user stuff.  I
 didn't even notice.  My bad.

 I filter mailing lists by subject since it starts the same way in the
 subject line.  You know, gentoo-user, gentoo-dev etc etc.

 I need to open my eyes.

Tell me about it :-)

I've just spent 30 minutes starting at my Konsole trying to figure out why I 
can't send from my own relays if I telnet:

MAIL FROM: al...@domain
501 5.1.7 Bad sender address syntax


A colleague took one look and said I think you are missing a  and a  in 
there

Sheesh. That's a cake offense. Now I gotta find a bakery.

-- 
alan dot mckinnon at gmail dot com