[nflug] for the crafty scripter

Frank Pirrone frankpirrone at gmail.com
Sun Nov 18 10:35:51 EST 2007


Cyber Source wrote:
> Hello All,
>  In tweaking the latest Gusty Gibbon, I have run into a problem that 
> was driving me nuts (don't reply with the corny joke about that saying 
> Bob, heard it a hundred times ;)). Anywho, this distro absolutely 
> ROCKS. Cmon, plugins on the fly?? If I were an M$ stock holder, I 
> would be sell, sell, sell.
>  OK, I thought I found a bug in Gutsy but it turns out to be a problem 
> with the way I would do things. Problem was, I found that I could NOT 
> add a user via the users-admin app. It would create the group but 
> nothing in /etc/passwd or /etc/shadow. Did some googling, found 
> nothing exactly similar. What I did find is that if I don't put 
> anything in /etc/skel, I could create the user just fine. If I put 
> some things in /etc/skel, I could still create the user. However, if, 
> like I would in the past do a (while in /home/peter) "tar cf - . | (cd 
> /etc/skel && tar xf -)", I could NOT create the user after, it would 
> show the added user until I closed and reopened the app, but no 
> /home/newuser would be made, no entry in passwd or shadow, only the 
> group would be added. I would do this so I could edit my /home with 
> all the tweaks I wanted and then the added user would have all the 
> same settings, with a couple of modifications needed after. However, 
> as in Edgy, this does not work anymore for whatever reason, there must 
> be something in my hidden folders or files that is pissing off the 
> mechanism or users-admin in /etc/skel.
> Workaround then in Edgy was to just tar up the /home/peter, create the 
> new user, remove his home and untar and use that for his home, 
> changing the name and ownerships of course, all was good.
> HOWEVER, this method still works but causes other problems now in that 
> it appears a lot more files seem to have the old instance and 
> reference to /home/peter, where it should be now /home/newuser. If I 
> grep the files for all instances of /home/peter, I see alot more than 
> it use to, before it was mainly a problem with firefox, as it would 
> have a hard link in one of the files to the previous owner.
>  SO, still here? For those with long attention spans....My question is 
> this. Since I can't seem to find ANY docs on /etc/skel and the tricks 
> that may be used and/or a way to duplicate a users whold environment, 
> as this really cuts down on my time when adding new users, etc..
>
> What would be a command that I could find all instances of 
> "/home/peter" in all the files of the new users and change them to 
> "/home/newuser"? As this seems to be the easiest method I can think 
> of. Thoughts? Ideas?
>
>
> p.s. One of the reasons for this, was that I noticed that while logged 
> into the new user, a new screen saver, called Picture Folder, was 
> displaying random pics from web sites that I went to while logged in 
> as peter. No, no porn but it got me to thinking, this little 
> screensaver could be a real embarrassment to some people, lol. NOTE: 
> They still showed, even though before I created the new user from 
> peter, I had cleared the history, so it's caching the pics somewhere 
> else.
>
> Ok, done. TIA
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>
Cyber,

Not attention span problem but gotta run to NYSCATE in Rochester where 
I'm presenting on F/OSS soon.

Try:

replace "/home/peter" "/home/newuser" -- *

that's two dashes meaning all instances and wild card asterisk meaning 
all files.  I believe this is a MySQL utility, or was at one time.  Very 
useful, and used many times...

Frank


More information about the nflug mailing list