Re: [SLUG] search and replace multiple files?

2011-08-02 Thread Marghanita da Cruz

Sonia Hamilton wrote:

I'm looking for a GUI that allows me to search and replace in multiple
files, then leaves open the files that have changed - any pointers?


I regularly open multiple files with the default text editor on Ubuntu 
(which is http://www.gedit.org).


If I close the app, I think, though can't guarantee this, it closes the 
files I haven't changed and asks me whether I want to save the rest.


It may also preserve parameters of the replace command across files that 
are open at any time.


Is that the kind of thing you are looking for?



For example, I want to replace def fubar with def snafu across 50
files. I then want to close all the files that didn't have changes, so I
can investigate the changed files in more detail (yes, I'm refactoring).

PS I know about sed, and how to edit multiple files in vim [1].

[1]
(http://blog.stevenocchipinti.com/2011/05/search-and-replace-in-multiple-files.html).

--
Sonia.



--
Marghanita da Cruz
http://ramin.com.au
Tel: 0414-869202


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] search and replace multiple files?

2011-08-02 Thread Erik de Castro Lopo
Sonia Hamilton wrote:

 I'm looking for a GUI that allows me to search and replace in multiple
 files, then leaves open the files that have changed - any pointers?
 
 For example, I want to replace def fubar with def snafu across 50
 files. I then want to close all the files that didn't have changes, so I
 can investigate the changed files in more detail (yes, I'm refactoring).
 
 PS I know about sed, and how to edit multiple files in vim [1].

Assuming that you are keeping this in git, why not just do the
following:

  a) Make sure everything has been commited.

  b) Use sed/perl/python/whatever to do the changes on the command
 line.

  c) Use git with an external graphical diff program to review the
 changes.

For a graphical diff I use mgdiff (in Debian and Ubuntu at least)
and have two aliases:

  alias git-mgdiff='git diff '
  alias git-diff='git diff --no-ext-diff '

The external diff is set up in $HOME/.gitconfig using:

   [diff]
   external = /home/user/scripts/git-mgdiff-wrapper.sh

and the wrapper script is simply:

#!/bin/bash
mgdiff $5 $2
exit 0

HTH,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] US DOD Distro

2011-08-02 Thread Marghanita da Cruz

15 June 2011: LPS-Remote Access was certified by AFNIC to connect to the GIG 
for general telecommuting use.

...

LPS differs from traditional operating systems in that it isn't continually 
patched. LPS is designed to run from read-only media and without any persistent 
storage. Any malware that might infect a computer can only run within that 
session. A user can improve security by rebooting between sessions, or when 
about to undertake a sensitive transaction. For example, boot LPS immediately 
before performing any online banking transactions. LPS should also be rebooted 
immediately after visiting any risky web sites, or when the user has reason to 
suspect malware might have been loaded. In any event, rebooting when idle is an 
effective strategy to ensure a clean computing session. LPS is updated on a 
regular basis (at least quarterly patch and maintenance releases). Update to 
the latest versions to have the latest protection.

To get started, download the LPS-Public ISO image and burn it to a CD. Read the 
Quick Start Guide for more information.

http://www.spi.dod.mil/lipose.htm
--
Marghanita da Cruz
http://ramin.com.au
Tel: 0414-869202


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] search and replace multiple files?

2011-08-02 Thread Sonia Hamilton
* Nick Andrew n...@nick-andrew.net [2011-08-02 15:44:02 +1000]:
 If it's a problem with leaving the editor open with only changed files,
 then I can suggest something like this:
 
   vim -o $(git status --porcelain | awk ' /^ M/ { print $2 } ')

* Erik de Castro Lopo mle+s...@mega-nerd.com [2011-08-02 18:07:11 +1000]:

 Assuming that you are keeping this in git, why not just do the
 following:
 
   a) Make sure everything has been commited.
 
   b) Use sed/perl/python/whatever to do the changes on the command
  line.
 
   c) Use git with an external graphical diff program to review the
  changes.

Thanks guys for your suggestions! I like the idea of combining
sed/git/vim:

git commit -m cleanup
sed 's/foo/bar' *
vi `git st -s | grep '^ M' | cut -c4-` # edit changed files

Eric, I'll also check out mgdiff.

-- 
Sonia Hamilton
http://soniahamilton.wordpress.com
http://www.linkedin.com/in/soniahamilton


signature.asc
Description: Digital signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] US DOD Distro

2011-08-02 Thread Martin Visser
Marghanita,

Looks like an interesting distro, and obviously there is a good use case for
military personnel needing to use untrusted PCs on a untrusted network.

What I find curious though, from just a quick observation, is that I
couldn't see how they can ensure their customers that you have the genuine
article. While they are publishing MD5 hashes for the ISO, your only test
that they are genuine is that you have used the .mil URL to access them.
They haven't put these behind  a SSL protected web-site or other
chain-of-trust that gives you assurance that the hashes or ISOs have become
compromised. (In other words if someone is doing either a DNS or HTTP
man-in-the-middle attack you wouldn't know).

(And of course, I'm wondering if anyone has looked into this in detail to
determine if it phone's home ;-) )

Regards, Martin

martinvisse...@gmail.com


2011/8/3 Marghanita da Cruz marghan...@ramin.com.au

 15 June 2011: LPS-Remote Access was certified by AFNIC to connect to the
 GIG for general telecommuting use.

 ...

 LPS differs from traditional operating systems in that it isn't
 continually patched. LPS is designed to run from read-only media and without
 any persistent storage. Any malware that might infect a computer can only
 run within that session. A user can improve security by rebooting between
 sessions, or when about to undertake a sensitive transaction. For example,
 boot LPS immediately before performing any online banking transactions. LPS
 should also be rebooted immediately after visiting any risky web sites, or
 when the user has reason to suspect malware might have been loaded. In any
 event, rebooting when idle is an effective strategy to ensure a clean
 computing session. LPS is updated on a regular basis (at least quarterly
 patch and maintenance releases). Update to the latest versions to have the
 latest protection.

 To get started, download the LPS-Public ISO image and burn it to a CD.
 Read the Quick Start Guide for more information.

 http://www.spi.dod.mil/**lipose.htm http://www.spi.dod.mil/lipose.htm
 --
 Marghanita da Cruz
 http://ramin.com.au
 Tel: 0414-869202


 --
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: 
 http://slug.org.au/faq/**mailinglists.htmlhttp://slug.org.au/faq/mailinglists.html

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] US DOD Distro

2011-08-02 Thread peter
 Martin == Martin Visser martinvisse...@gmail.com writes:

Martin Marghanita, Looks like an interesting distro, and obviously
Martin there is a good use case for military personnel needing to use
Martin untrusted PCs on a untrusted network.


Note that there's nothing to prevent something rogue from writing to
your harddisk -- unless they've removed the ATA drivers etc.  But they
can boot from CD/DVD so the ATA drivers must be there...

Peter C

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html