Re: [gentoo-user] search files for "text string"

2015-06-06 Thread tlze
try:
find . -type f -exec grep 'abcd'  -l {} \;


Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Joseph

On 06/06/15 23:04, Alan McKinnon wrote:

On 06/06/2015 18:45, Joseph wrote:

I've bunch of php files in many directories and I need to file a text
string in them "Check/Money Order"

I've tried:
find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
it doesn't work.

What is a better method of searching files?



Define "doesn't work" in this context.

My guess is that the string you want isn't actually there.
If it is there, provide a sample of the source text containing the string.

--
Alan McKinnon
alan.mckin...@gmail.com


Apology, yes it did worked.
I was just in a wrong sub-directory.

--
Joseph



Re: [gentoo-user] Dual OS clock issues

2015-06-06 Thread Volker Armin Hemmann
Am 04.06.2015 um 21:06 schrieb Derek Ellison:
> I have two HDD in a UEFI system. Windows 8 on one and Gentoo on the
> other. Currently I have to update the clock everytime I boot to the
> other OS and I'm wondering if there is a way I can avoid this? It's
> just starting to get to be a pain to have to update it everytime. 
>
> Any information would be most welcome.
>
> Thanks!

using google was too hard for you?

Because that is such a standard problem, you should stumble upon the
solution in less than 10 seconds.



Re: [gentoo-user] which keymap and keyboard setup

2015-06-06 Thread Peter Humphrey
On Saturday 06 June 2015 14:57:15 Alan Mackenzie wrote:
> Hello, Peter
> 
> On Sat, Jun 06, 2015 at 02:25:17PM +0100, Peter Humphrey wrote:
> > On Saturday 06 June 2015 11:22:45 Alan Mackenzie wrote:
> > > :-)  I have a Filco mechanical keyboard, which works well.  Does your
> > > :new
> > > 
> > > keyboard need more desk space than a standard one?  That would be a
> > > negative feature for me.
> > 
> > I wonder how much better these are than my 105-key Cherry with its
> > mechanical key switches. It isn't quiet, but it doesn't need to be since
> > I'm the only one here. I deliberately went for a proper keyboard rather
> > than those nasty rubber-sheet jobs.
> 
> My Filco has Cherry keys in it.  I seem to remember from researching it a
> few years back, Cherry keys come in several weights of action, and some
> of them have an audible click, some don't.  An audible click would drive
> me crazy.

Hmm. I wonder whether I'm prone to it too...

-- 
Rgds
Peter




Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Neil Bothwick
On Sat, 6 Jun 2015 13:11:04 -0400, Philip Webb wrote:

> > I've bunch of php files in many directories
> > and I need to find a text string in them "Check/Money Order"  
> 
> 'cd' to the lowest dir which contains them all,
> then 'grep -r "Check/Money Order" *.php'.

That will only search *.php files in the current directory, you need

grep -r --include='*.php' 'Check/Money Order' .

or drop the --include option to search all files. Use single quotes to
stop the shell from trying to interpret anything.


-- 
Neil Bothwick

Why do they call it a TV set when you only get one?


pgpagZLs4RsaT.pgp
Description: OpenPGP digital signature


[gentoo-user] apcupsd - not emailing me when power down

2015-06-06 Thread Joseph

My remote box is connected direclty to apcups and it is running "apcupsd"
However, when I pull the cord out of the wall the "onbattery" script is not email me 
anything.


My configuration: apcupsd.conf

UPSCABLE usb
UPSTYPE usb
DEVICE
POLLTIME 60
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 60
MINUTES 10
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0

onbattery - script suppose to be called by "/etc/apcupsd/apccontrol" and 
execute it.
What am I missing?

--
Joseph



Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Alan McKinnon
On 06/06/2015 18:45, Joseph wrote:
> I've bunch of php files in many directories and I need to file a text
> string in them "Check/Money Order"
> 
> I've tried:
> find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
> it doesn't work.
> 
> What is a better method of searching files?


Define "doesn't work" in this context.

My guess is that the string you want isn't actually there.
If it is there, provide a sample of the source text containing the string.

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: OT: is your metadata safe?

2015-06-06 Thread Bruce Hill
On Fri, Jun 05, 2015 at 05:38:57PM +, James wrote:
> 
> SS7 (The north American "switching standard") where the tariffs are still
> enforced is where the phone "meta-data" comes from regardless of how it is
> originated. Now, All data from an ISP, Telco
> web company, social media or anything else can all be moved between "ICPs"
> for business (sales) purposes now via this document and many others. What's
> new is the Feds will be paying gargantuan sums of money to the telcos now
> to keep data they already maintain.
> 
> Yes this is the back door that has always existed and all advanced countries
> use it. The "agencies" just buy the data from offshore sources;
> thus circumventing domestic restrictions. That was/is a fundamental tenet of
> "signal intercept".
> 
> Did you notice that after the fall, of the Berlin wall (nov 1989), the good
> ole USA needed a new boogey man to justify spending billions and billions to
> keep us secure? The  Internet security business opened in 1990 via public
> access to the Internet.
> 
> 
> Soon it will be those evil Chinese. Taxpayers pay; so the politicians
> and can play. There has to be a boogey man, to justify spending billions
> on keeping us safe.
> 
> The Onion with strong encryption does delay the process. But there's 
> too much advanced hardware available if they really want to decipher
> a particular stream of data.

"Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former."



Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Alexander Kapshuk
On Sat, Jun 6, 2015 at 8:46 PM, Joseph  wrote:

> On 06/06/15 20:09, Alexander Kapshuk wrote:
>
>On Sat, Jun 6, 2015 at 7:45 PM, Joseph <[1]syscon...@gmail.com> wrote:
>>
>> I've bunch of php files in many directories and I need to file a
>> text string in them "Check/Money Order"
>> I've tried:
>> find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
>> it doesn't work.
>> What is a better method of searching files?
>> --
>> Joseph
>>
>>   grep -ls 'Check/Money Order' `du -a | sed '/\.php$/!d;s/.*\t//'` # grep
>>   will complain that the args list is too long if the number of files
>>   found is too great.
>>   Otherwise, this might work for you:
>>   find dir -type f -name \*.php | xargs grep -sl 'Check/Money Order'
>>
>
> Thanks, this worked for me, it searches in current and below dir.
>
>
>
Good to hear.


Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Joseph

On 06/06/15 20:09, Alexander Kapshuk wrote:

  On Sat, Jun 6, 2015 at 7:45 PM, Joseph <[1]syscon...@gmail.com> wrote:

I've bunch of php files in many directories and I need to file a
text string in them "Check/Money Order"
I've tried:
find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
it doesn't work.
What is a better method of searching files?
--
Joseph

  grep -ls 'Check/Money Order' `du -a | sed '/\.php$/!d;s/.*\t//'` # grep
  will complain that the args list is too long if the number of files
  found is too great.
  Otherwise, this might work for you:
  find dir -type f -name \*.php | xargs grep -sl 'Check/Money Order'


Thanks, this worked for me, it searches in current and below dir.

find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'

--
Joseph



Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Philip Webb
150606 Joseph wrote:
> I've bunch of php files in many directories
> and I need to find a text string in them "Check/Money Order"

'cd' to the lowest dir which contains them all,
then 'grep -r "Check/Money Order" *.php'.

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




Re: [gentoo-user] search files for "text string"

2015-06-06 Thread Alexander Kapshuk
On Sat, Jun 6, 2015 at 7:45 PM, Joseph  wrote:

> I've bunch of php files in many directories and I need to file a text
> string in them "Check/Money Order"
>
> I've tried:
> find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
> it doesn't work.
>
> What is a better method of searching files?
> --
> Joseph
>
>
grep -ls 'Check/Money Order' `du -a | sed '/\.php$/!d;s/.*\t//'` # grep
will complain that the args list is too long if the number of files found
is too great.

Otherwise, this might work for you:

find dir -type f -name \*.php | xargs grep -sl 'Check/Money Order'


[gentoo-user] search files for "text string"

2015-06-06 Thread Joseph

I've bunch of php files in many directories and I need to file a text string in them 
"Check/Money Order"

I've tried:
find -type f -print0 | xargs -r0 grep -F 'Check/Money Order'
it doesn't work.

What is a better method of searching files?
--
Joseph



Re: [gentoo-user] which keymap and keyboard setup

2015-06-06 Thread Alan Mackenzie
Hello, Peter

On Sat, Jun 06, 2015 at 02:25:17PM +0100, Peter Humphrey wrote:
> On Saturday 06 June 2015 11:22:45 Alan Mackenzie wrote:
> > :-)  I have a Filco mechanical keyboard, which works well.  Does your new
> > keyboard need more desk space than a standard one?  That would be a
> > negative feature for me.

> I wonder how much better these are than my 105-key Cherry with its mechanical 
> key switches. It isn't quiet, but it doesn't need to be since I'm the only 
> one 
> here. I deliberately went for a proper keyboard rather than those nasty 
> rubber-sheet jobs.

My Filco has Cherry keys in it.  I seem to remember from researching it a
few years back, Cherry keys come in several weights of action, and some
of them have an audible click, some don't.  An audible click would drive
me crazy.

> -- 
> Rgds
> Peter

-- 
Alan Mackenzie (Nuremberg, Germany).



Re: [gentoo-user] Dual OS clock issues

2015-06-06 Thread Daniel Frey
On 06/05/2015 03:29 PM, Fernando Rodriguez wrote:
> The main problem is that Windows will change the local time twice a year on 
> DST zones, aside from NTP how can Linux tell if the time is adjusted? 

Windows can be set to not do DST updates, I've set this option in the
time control panel for both dual-boot Windows installs as I don't use
them that often.

Dan




Re: [gentoo-user] which keymap and keyboard setup

2015-06-06 Thread Peter Humphrey
On Saturday 06 June 2015 11:22:45 Alan Mackenzie wrote:
> On Fri, Jun 05, 2015 at 11:33:47PM +0200, lee wrote:
> > BTW, this keyboard is awesome.  It's just as if you had a Model M, but
> > still new, and there isn't anything better available new.  I've been
> > using those for about 20 years now and wanted a new one since quite a
> > while, now finally managed to get a Unicomp ... Get one if you can; live
> > is too short for bad keyboards.
> :
> :-)  I have a Filco mechanical keyboard, which works well.  Does your new
> keyboard need more desk space than a standard one?  That would be a
> negative feature for me.

I wonder how much better these are than my 105-key Cherry with its mechanical 
key switches. It isn't quiet, but it doesn't need to be since I'm the only one 
here. I deliberately went for a proper keyboard rather than those nasty 
rubber-sheet jobs.

-- 
Rgds
Peter




Re: [gentoo-user] How can I block incomming tor-traffic?

2015-06-06 Thread Jonathan Moseley
You have to configure it to block all tor proxies. I don't own any servers
but that seems like the most logical thing to do.

On Sat, Jun 6, 2015, 09:12 Stroller  wrote:

>
> On Sat, 6 June 2015, at 12:04 pm, Jarry  wrote:
> >
> > …  (ip-lookup of source addresses always points
> > to tor-exit.watever). How can I block this tor-traffic completely?
> >
> > How can I feed this list to iptables? Is there some ready-to-use
> > solution, or do I have to parse this list through some script
> > I have to write first?
>
> I would have thought you could just have the webserver deny access to the
> tor-exit.watever domain.
>
> For Apache, ctrl-f "domain" on this page:
> http://httpd.apache.org/docs/2.2/howto/access.html
>
> NB: if you google "how to block tor", DNS based denial seems to be the
> recommended solution:
>
>https://www.torproject.org/docs/faq-abuse.html.en#Bans
>https://www.torproject.org/projects/tordnsel.html.en
>
> If you wanted to run a daily "add to iptables script" then you could
> extract those IPs with:
>
>curl https://check.torproject.org/exit-addresses | grep ExitAddress |
> cut -d ' ' -f 2
>
> This is a bit primitive, but you can see it works.
>
> Stroller.
>
>
>


Re: [gentoo-user] How can I block incomming tor-traffic?

2015-06-06 Thread Stroller

On Sat, 6 June 2015, at 12:04 pm, Jarry  wrote:
> 
> …  (ip-lookup of source addresses always points
> to tor-exit.watever). How can I block this tor-traffic completely?
> 
> How can I feed this list to iptables? Is there some ready-to-use
> solution, or do I have to parse this list through some script
> I have to write first?

I would have thought you could just have the webserver deny access to the 
tor-exit.watever domain.

For Apache, ctrl-f "domain" on this page: 
http://httpd.apache.org/docs/2.2/howto/access.html

NB: if you google "how to block tor", DNS based denial seems to be the 
recommended solution:

   https://www.torproject.org/docs/faq-abuse.html.en#Bans
   https://www.torproject.org/projects/tordnsel.html.en

If you wanted to run a daily "add to iptables script" then you could extract 
those IPs with:
 
   curl https://check.torproject.org/exit-addresses | grep ExitAddress | cut -d 
' ' -f 2

This is a bit primitive, but you can see it works.

Stroller.




Re: [gentoo-user] which keymap and keyboard setup

2015-06-06 Thread Alan Mackenzie
Hello, Lee.

On Fri, Jun 05, 2015 at 11:33:47PM +0200, lee wrote:
> Hi,

> which keymap are we supposed to use for a keyboard that has 122 keys?

I think you might have to roll your own.  As a warning, this can't be
done in a single hour.

As a matter of interest, what are all the extra keys for?  What legend is
embossed upon them, and where are they, physically, relative to the
"qwerty" part of the keyboard?

My comments from this point on are about the console keyboard.  I don't
know much about X keyboards, though I do have a little utility,
xfce4-xkb-plugin, in my XFCE which swaps from British to German layout at
the click of a mouse.  My console keyboard is an extensively enhanced
version of a British layout, with the seven German letters on
a/o/u/s, and many extra key combinations that are needed in Emacs,
together with combinations for arrow-keys, etc.

> And which keyboard type are we supposed to specify?  There's pc_102,
> pc_105 and whatnot; is there such a thing as pc_122, too?

I doubt it.  Probably, you'll be just fine with pc_105.  Try it!  (Where
is this set, by the way?  I set mine to pc_105, but forgotton where I did
it).

> So far, I plugged the keyboard in (it's USB) and it has a layout I can
> expect (which is kinda amazing), so I'm typing on it now.  What I
> want is a keyboard configuration that corresponds to the labels on the
> keys (which is an US layout) as a starting point, and a way to switch
> between the US layout and a layout adapted to German.  Most of what I
> type is in English, and the US layout is much better suited for
> programming, so for the few cases I do need the extra keys required for
> German, I want to be able to switch layouts by pressing a key.  That
> goes for both console and X11 --- my experience is that you first have
> to get the keyboard set up correctly for the console before you have a
> chance to get it to fully work with X11.

I don't know of any way of switching the console keyboard as easily as
you probably want.  To switch layouts you need loadkeys (a utility
program very close to the kernel).  As I said, my workaround here is to
put the German letters on  combinations.  It surprised me just how
seldomly ä,ö,ü,ß are actually used in German text.

You could put the string "loadkeys /home/lee/kbd-d.map.gz" (and a
similar one for kbd-e.map.gz) on some difficult-to-type-accidentally key
combination, with which you'd be able to change layouts from a bash
command line.  Just beware that the the same key layout is used by all
the virtual terminals - there's no way of setting a key layout for just
one VT.

I would recommend you to start by copying a standard keyboard layout from
/usr/share/keymaps/... (or dumping your current one with dumpkeys), then
enhancing it.  Read the man pages for loadkeys, dumpkeys, keymaps, etc.
They are in package sys-apps/kbd.

To find out what the keycodes are for "obscure" keys, use showkey.

If you'd like a copy of my keyboard layout to help you on your way, just
drop me a personal email.

> The keyboard shows up as: "Unicomp Inc. Surf Ruffian USB 122 Keyboard v
> 2.50".  Xev shows that the function keys F13--F24 yield the same scan
> codes as F1--F12.  I still have a 105 key PS/2 keyboard plugged in, and
> nothing is prepared for the 122 key keyboard, so that might limit what
> scan codes are being seen.


> BTW, this keyboard is awesome.  It's just as if you had a Model M, but
> still new, and there isn't anything better available new.  I've been
> using those for about 20 years now and wanted a new one since quite a
> while, now finally managed to get a Unicomp ... Get one if you can; live
> is too short for bad keyboards.

:-)  I have a Filco mechanical keyboard, which works well.  Does your new
keyboard need more desk space than a standard one?  That would be a
negative feature for me.

-- 
Alan Mackenzie (Nuremberg, Germany).



Re: [gentoo-user] How can I block incomming tor-traffic?

2015-06-06 Thread Rich Freeman
On Sat, Jun 6, 2015 at 7:04 AM, Jarry  wrote:
> Hi Gentoo-users,
>
> my web-server gets constantly abused by users which appear to be
> using tor-network (ip-lookup of source addresses always points
> to tor-exit.watever). How can I block this tor-traffic completely?
>
> I know I can get the list of tor exit-nodes on:
> check.torproject.org/exit-addresses
>
> How can I feed this list to iptables? Is there some ready-to-use
> solution, or do I have to parse this list through some script
> I have to write first?
>

However you do it, please don't use whatever approach half the
websites seem to be using, which ends up blocking relay nodes as well
as exit nodes.  I run a relay-only node and it seems like random
websites block me all the time.  So, I just route all my non-server
traffic through an anonymous vpn, which works fine, though likely
being the source of just as much abuse (by others).

There seem to be ip reputation services out there which don't
distinguish between tor exits and relay nodes.

Every once in a while I force a new dhcp lease on the IP used by tor,
and I'm sure some other random user on my ISP then wonders why half
the internet no longer works.

The website you listed does appear to list only exit nodes - my node
doesn't appear on the list.

-- 
Rich



[gentoo-user] How can I block incomming tor-traffic?

2015-06-06 Thread Jarry

Hi Gentoo-users,

my web-server gets constantly abused by users which appear to be
using tor-network (ip-lookup of source addresses always points
to tor-exit.watever). How can I block this tor-traffic completely?

I know I can get the list of tor exit-nodes on:
check.torproject.org/exit-addresses

How can I feed this list to iptables? Is there some ready-to-use
solution, or do I have to parse this list through some script
I have to write first?

Jarry
--
___
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.