Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 01 Aug 2015, 14:21
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
New slocate Wrapper
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [36 Posts]   Goto page: 1, 2, 3 Next
Author Message
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Sun 22 Feb 2015, 20:13    Post subject:  New slocate Wrapper
Subject description: Find any system file in a jiffy
 

EDIT, March 2, 2015 --
Here is a mostly cosmetic update:

* Black ticker tape background effect removed from ANSI text colors in
__ main scripts. Please let me know how that fits with your urxvt defaults;

* More to the point icons (both with Creative Commons licence, as far as
__ I can tell);

* More to the point category in the *.desktop files: X-FilesystemFind;

* Both *.desktop files now use the proper "springboard" for the scripts.
(The search one was previously launching the search script directly.
Sorry for the oversight.)

Constructive feedback always appreciated. Happy file searching! BFN.

musher0

PS. Version 1e is kept for reference for the time being. The newest
version can be downloaded from my new "public" Cloud at SME or from
the download window below.
~~~~~~~~~~~~~~~
Hello, people.

This is the continuation of a project that first evolved through the thread at:
http://murga-linux.com/puppy/viewtopic.php?p=824968&sort=lastpost#824968

I'm being asked to create a separate thread by gcmartin so that members are able to
follow the progression of this PET. The move may be useful in the sense that the focus
will be only on this wrapper. The thread won't be "distracted" by other on-going
projects. BTW, this is absolutely not a judgment on the validity of those other projects,
it only stems out of a practical consideration.

I will try to progressively transfer all my posts from the former thread here, so please
bear with me. However the reader may miss out on the logic or the progress of the
discussion, so please refer to that initial thread if need be.

Thanks for your patience.

musher0

~~~~~~~~~~~
So here is the first installment (or latest version, depending on which thread you're
considering!) of this on-going slocate wrapper. It's already very usable.
BFN.
PuppyTerrier-01g_BIL.pet
Description 
pet

 Download 
Filename  PuppyTerrier-01g_BIL.pet 
Filesize  43.82 KB 
Downloaded  78 Time(s) 
PuppyTerrier-01e_BIL.pet
Description 
pet

 Download 
Filename  PuppyTerrier-01e_BIL.pet 
Filesize  37.19 KB 
Downloaded  78 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Thu 05 Mar 2015, 16:49; edited 8 times in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Sun 22 Feb 2015, 20:17    Post subject:  

Features, in reverse order :

Moved from http://murga-linux.com/puppy/viewtopic.php?p=829853&sort=lastpost#829853

~~~~~~~~~~~~~~~
Edit, Febr. 22, 2015, 11:22 p.m. EST

Hello!

Replaced the old attachment with this one: PuppyTerrier-0.1e_BIL. This one:

* ignores any Puppy iso that may be mounted

* incorporates a pinstall.sh to add a line to /etc/group (see 1st post at top of this page).
Thanks to Smokey01 for catching it. Basically, the pinstall.sh does this:
Code:
echo "slocate::21:root,spot,fido" >> /etc/group

As an apology to users of previous versions, I'm including it separately.

BFN. musher0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hello again, all!

This grind incorporates
* the latest remarks from Smokey01, except the one-place storage suggestion
(more on this below), plus:

* it's transparently bilingual French-English (meaning:
__ the user is not asked the language to work in and never sees the translation in the
__ other language. It's all "sensed" from the system LANG variable.

* Safety check introduced in the 2 launchers. If you happen to want to use the scripts
__ at the same time the automatic update is being done, you'll be asked to wait a
__ couple of minutes.

* Touch-ups to the layout.

* Restored the sliding bar in the search window, for practical reasons: people may
__ need to browse back to check a particular item, since the results cannot be loaded
__ in a text reader or browser.

@Smokey01: I'll try centralizing the Db's later. Results of try-outs are not convincing
at this time.

So there you have it! Enjoy!

musher0
pinstall.sh.zip
Description  Unpack anywhere, make executable and run. Beforehand, please make sure that you
don't already have an slocate line towards the bottom of your /etc/group file.
zip

 Download 
Filename  pinstall.sh.zip 
Filesize  300 Bytes 
Downloaded  83 Time(s) 
pinstall.sh.zip
Description  Unpack anywhere, make executable and run. Beforehand, please make sure that you
don't already have an slocate line towards the bottom of your /etc/group file.
zip

 Download 
Filename  pinstall.sh.zip 
Filesize  300 Bytes 
Downloaded  71 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Sun 22 Feb 2015, 20:25    Post subject:  

Moved from:
http://murga-linux.com/puppy/viewtopic.php?p=829534&sort=lastpost#829534

~~~~~~~~~~~~~~~
Puppus Dogfellow wrote:
(...)
cool, musher. works well and is very fast. is there a way to read the .db files as text or
html, or a way to convert the databases to something a browser or text editor can
read? could you add (something like) output to file.txt as a choice for each of the
databases created?

thanks in advance.


Thanks, Puppus.

As to your request, best I can do is attached. (For you -- and others -- to test.
If you find it useful, I'll include it as an extra in the next version. Because the files ls
creates are large, and that the directories are not mentioned on each line, it shouldn't
become the main script IMO.)

I tried loading the slocate db's in a text editor, and it loads only the first byte.
You can read an slocate db using less, but it's meaningless, because only some (?)
filenames are visible, and they are separated by code (perhaps vars for the folders,
I really don,t know).

This attached script uses ls instead of slocate. The db files created are huge, by
comparison, but they can be read in any text editor, or in a browser.

Same principle, meaning: the db's are on the indexed drive.

I hope that helps.

BFN.

musher0
~~~~~~~~
PS. It's a variant of a script I uploaded previously on this thread..
MntFilesLst-01-ls-txt.sh.zip
Description 
zip

 Download 
Filename  MntFilesLst-01-ls-txt.sh.zip 
Filesize  1.07 KB 
Downloaded  84 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Sun 22 Feb 2015, 20:27    Post subject:  

Moved from: http://www.murga-linux.com/puppy/viewtopic.php?p=830109&sort=lastpost#830109

~~~~~~~~~~~~~~~~~~

Ok, folks.

Drums rolling, curtains up... I give you: PuppyTerrier-01! Very Happy For you to test!
I think that, in this *pet, I've solved all the "spiney" points we've uncovered so far.

* First, my apologies to Smokeyp01, who doesn't get a GUI...

__ However we have ANSI colors, and IMO, there's basically no difference between
__ typing in a GUI and typing in a CLI window, since typing is typing, eh?

__ The allergenic CLI aspect (for some people) is, I believe, largely mitigated by
__ the use of *.desktop files. Two scripts will appear in your menu, one for
__ constructing/updating the db's and one for searching them.

* the external drive db's stay on the external drives, so there's minimal hit on the
__ internal Puppy size. Only the index of the Puppy internal files is stored internally.
__ This feature makes slocate available for all types of Puppy configurations, either
__ full, frugal or CD/DVD. I paid particular attention to this feature.

* the search script searches everything each time, the Puppy OS and the mounted
__ external drives.

* updating takes 2-3 seconds max on my rig (I have +/- 165 Mg's worth of files on
__ 8 partitions.)

* the automatic launch through Startup has been "niced", using Uten's hint and
__ K. Lindsay's (the author of slocate) own one-liner for "croning" slocate.

* Speaking of which, the original slocate config. and script in /etc have been
__ removed, we don't need them with Médor's script.

* As a bonus, Médor's RAM-refreshing line is included in the automatic update.
__ Just comment that line with a "#" if you don't want it or need it. But it's there,
__ I for one find it quite useful. Also...
__ More time intervals have been included in that script. You may want to test what
__ time interval is more convenient for you. (There's a how-to in the script.)

* I thank you all of course, for the fruitful ideas and exchanges you provided in this
__ thread. Thanks are obviously due to the author of slocate, Kevin Lindsay, and to
__ gcmartin, initiator of this thread; also to Slavvo67, Uten and Médor for their
__ respective hints and contributions. Thanks also to Puppus Dogfellow who gave me
__ the little push I needed when I was stumped.

So, please test the attached to your heart's content. Constructive feedback will be
most welcome and will make this little utility even better.

Enjoy!

musher0
~~~~~~~~
Edit -- Previous attachment removed. Please download the newer debugged
version from a few posts down, at:
http://murga-linux.com/puppy/viewtopic.php?p=829558&sort=lastpost#829558

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 2007
Location: South Australia

PostPosted: Sun 22 Feb 2015, 23:45    Post subject:  

I can't remember which revision but slocate seems to be in an endless loop. Check your task manager to see if you are getting the same result. I had to kill the updatdb-all.sh in startup. I will try it again on a fresh frugal as this one is pretty messed up.
_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Mon 23 Feb 2015, 04:42    Post subject:  

smokey01 wrote:
I can't remember which revision but slocate seems to be in an endless loop. Check your task manager to see if you are getting the same result. I had to kill the updatdb-all.sh in startup. I will try it again on a fresh frugal as this one is pretty messed up.


Hi, Smokey01.

Euh... it's a while (1) loop. It's supposed to be endless, if we want the db's to be
continously updated at interval x. Or I'm not getting your meaning?! Smile

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 2007
Location: South Australia

PostPosted: Mon 23 Feb 2015, 05:16    Post subject:  

Yes at whatever interval you set. I think 1.5 hours is what you have the default set at. When I say endless I mean it continually updates the db's not every 1.5 hours.

I even commented out the frequency so slocate -u should never be called but it couldn't be killed with the task manager. As soon as it was killed, another would fire up.

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
gcmartin


Joined: 14 Oct 2005
Posts: 5279
Location: Earth

PostPosted: Mon 23 Feb 2015, 11:02    Post subject:  

does the design logic allow the utility to merely set a cron job for utility operation?
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Mon 23 Feb 2015, 11:10    Post subject:  

gcmartin wrote:
does the design logic allow the utility to merely set a cron job?


I don't know about a proper cron job, but PScheduler doesn't work.
(Validated in this French thread about freeing some RAM:
http://murga-linux.com/puppy/viewtopic.php?p=826747&sort=lastpost#826747
(That page plus the next.)

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Mon 23 Feb 2015, 11:42    Post subject:  

smokey01 wrote:
Yes at whatever interval you set. I think 1.5 hours is what you have the default set at.
When I say endless I mean it continually updates the db's not every 1.5 hours.

I even commented out the frequency so slocate -u should never be called but it
couldn't be killed with the task manager. As soon as it was killed, another would fire up.


Hi, Smokey01.

The man toys with the frequency of the script and then the man complains about the
script having an odd behavior !!! Ah, what can I say, humans... Wink

No, that's not the way to do it. What you did is indeed set a second process in motion;
that's the script's way of saying: "you messed with me."

When that happens, the only way to get out of those loops is to go back to the initial
black console and to restart with < xwin whatever-your-window-manager >. It's the
only way too if you're not satisfied with your time interval: edit it and then restart your
session from the initial black console.

It happened to me a couple of times while testing that automatic script. The script is ok;
human interference... it doesn't like. (Now, where's that tongue-in-cheek icon?) Smile

Let's say that you have set the automatic script to update every hour. The script does
an initial update one minute (after five minutes in the newer versions) after boot-up.
Then it sleeps for an hour. Then it does another update. Then it sleeps for another hour.
And so on.

You'll see it in htop. While it's sleeping, there's a line in htop somewhere saying :
< sleep 1h >. While it's actively updating, you see the name of the auto-update bash
script, plus slocate -bla -bla -u on another line. If you're fast enough, you can catch the
relationship between the calling script and the slocate program, by typing in console
< ps af >. You'll see little lines linking the two processes.

I checked with Médor, and he tells that his while (1) idea was inspired by Puppy's
stay_connected script. So it's quite safe, really.

Set it once, maybe even in the mp editor before you start your X session; save your
change, start your X session, and leave that script alone, let it do its job.

I hope this helps. BFN.

musher0

~~~~~~~~~~~~~~
Illustrations. -- The "perpetual" but "nice-ified" update script takes very little
resources, whether it's active or inactive.

system-resources-slocate-automatic-update_2015-02-23(1).jpg
 Description   It takes very little resources. (Sorry for the squiggly lines!)
 Filesize   22.95 KB
 Viewed   266 Time(s)

system-resources-slocate-automatic-update_2015-02-23(1).jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 945
Location: nyc

PostPosted: Tue 24 Feb 2015, 03:03    Post subject:  

[attempt to chime in on about three or four different discussions from what seems like (glad you sorted out the links, musher...) two threads and six posts?...] the db's don't seem very large, but i can see people wanting them out of root and the solution to have each on a drive is fine, but so would having them all in one db that could be then (hopefully--not sure it would work/slocate can do it) relocated and symlinked back to where slocate was expecting to find it--maybe that could be part of the configuration choices along with an option to never have autoupdating--make that a manual thing since it's a grind on the fan and you're likely to remember the thing you added within the last interval. my two cents.


slavvo's indexer could maybe be updated with tree or something. seems your projects have split a bit compared to the last time i saw them discussed, but since his takes care of the human readable printouts, maybe you needn't bother your script with the issue (edit--forgot that conclusion's already been come to).

i'll make icons for the thing if you want--manual update, slocate search all dbs, slocate search specific db, slocate config--

(or you could just continue to do all the work and i can continue to root you on).

Very Happy
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Tue 24 Feb 2015, 10:46    Post subject:  

Hi, Puppus.

Thanks for the compliment. You're not doing so bad yourself with your p574... Smile

If you have the talent to draw icons, please do! I have no talent for graphics
whatsoever! Smile

The best I can draw is a cat backwards: one big circle for the body, a smaller one for
the head, two small triangles for the ears, and some lines for the whiskers and tail.
See what I mean?! Laughing

As to centralizing the disk db's, my tests point to slocate being averse to it, but I
haven't found what "principle" slocate obeys: on certains drives it does it, on others
not. Or is slocate "sensitive" to which directory the command comes from? I'm still
unsure at this point.

As for me, I'm happy with the way it works now. I like to work with most of my
partitions mounted all the time.

But I understand Smokey01's point of view: he works with one or two partitions
opened at a time, and he needs to know in a jiffy what he's got on his unmounted
drives. A lot of Puppyists like to work like Smokey01 does. So I'm doing various
tests. I'm not promising anything, but I'm working on it.

As to converting the slocate db's, you were the one who discovered that they could
be loaded in gnumeric, right? Is it clear enough to read / understand ? Could you
provide an illustration of the result ? Maybe there are clues in such pictures.

Besides, I thought Slavvo67 was working on a text-able search script...

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 945
Location: nyc

PostPosted: Tue 24 Feb 2015, 11:52    Post subject:  

musher0 wrote:
Hi, Puppus.

Thanks for the compliment. You're not doing so bad yourself with your p574... Smile

If you have the talent to draw icons, please do! I have no talent for graphics
whatsoever! Smile

The best I can draw is a cat backwards: one big circle for the body, a smaller one for
the head, two small triangles for the ears, and some lines for the whiskers and tail.
See what I mean?! Laughing

As to centralizing the disk db's, my tests point to slocate being averse to it, but I
haven't found what "principle" slocate obeys: on certains drives it does it, on others
not. Or is slocate "sensitive" to which directory the command comes from? I'm still
unsure at this point.

As for me, I'm happy with the way it works now. I like to work with most of my
partitions mounted all the time.

But I understand Smokey01's point of view: he works with one or two partitions
opened at a time, and he needs to know in a jiffy what he's got on his unmounted
drives. A lot of Puppyists like to work like Smokey01 does. So I'm doing various
tests. I'm not promising anything, but I'm working on it.

As to converting the slocate db's, you were the one who discovered that they could
be loaded in gnumeric, right? Is it clear enough to read / understand ? Could you
provide an illustration of the result ? Maybe there are clues in such pictures.


Besides, I thought Slavvo67 was working on a text-able search script...

BFN.

musher0



Code:
tree -h -a -l -f -h -H baseHREF -T treehtml1 > thisdir.html


tree gives human readable stuff--can't get the links to do much more than show the paths, but the html file gets produced pretty quickly and is very readable--maybe a pic soon. you could just try it--tree's in all the repos i think. you could also i'm sure make niftier code (if i knew what i was doing, it would be opening the files from the browser tab instead of telling me of its problems).

regarding the icons, i was volunteering (at some indistinct, future time) effort, not skill. i'll make them, but as to whether or not they'll be any good...

Very Happy

i already tried out one of the text searchable scripts--i think yours because i think it was an index on every drive deal. that was more readable than the db in gnumeric, this i think is more readable than the other two.

Quote:

| | | |-- [3.6K] drive48.png
| | | |-- [4.5K] edit48.png
| | | |-- [5.5K] email48.png
| | | |-- [5.9K] floppy48.png
| | | |-- [3.9K] folder48.png
| | | |-- [5.1K] games48.png
| | | |-- [5.7K] help48.png
| | | |-- [3.1K] home48.png
| | | |-- [3.4K] lock-screen48.png
| | | |-- [5.7K] multimedia48.png
| | | |-- [5.3K] optical48.png
| | | |-- [6.0K] paint48.png
| | | |-- [4.3K] pc48.png
| | | |-- [4.9K] pet48.png
| | | |-- [4.0K] printer48.png
| | | |-- [5.4K] save48.png
| | | |-- [4.9K] scanner48.png
| | | |-- [3.7K] shutdown48.png
| | | |-- [4.1K] spread48.png
| | | |-- [4.4K] system48.png



anyway, it looks like that, but the titles are hyperlinks that you can copy, copy as path, or otherwise modify. nested folders push the lines to the right...
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Tue 24 Feb 2015, 17:50    Post subject:  

Hi, Puppus.

As you said, tree is in pretty much any repo, i.e.
http://pkgs.org/slackware-14.1/slackware-i486/tree-1.6.0-i486-1.txz.html

Did I see two "-h" 's in your line above? In any case, trying it now.

BFN.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5681
Location: Gatineau (Qc), Canada

PostPosted: Tue 24 Feb 2015, 18:02    Post subject:  

Hello, again, Puppus.

So you gave us
Code:
tree -h -a -l -f -h -H baseHREF -T treehtml1 > thisdir.html

Care to explain what the parms do? Smile I'm not reading all that doc, no way! Smile

(It did create a huge tree file (88.7 Mb's) with everything in it on my rig.
So we know it works...)

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 3 [36 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0929s ][ Queries: 12 (0.0040s) ][ GZIP on ]