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 Oct 2016, 16:57
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
GetPupSave 3.0 Pet
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Sat 09 May 2015, 01:23    Post subject:  GetPupSave 3.0 Pet
Subject description: whypet
 

What is it? this pet is a command which returns the partition, file-system, and path to your active PupSave file or folder.

Why use it? it's handy if you multiboot several frugal puppies, and you forgot which one you are booted into Razz. the advantage of the getpupsave command is that it's a command-- more convenient than remembering and manually digging into system files.

requirements tested only on xSlacko so far.

you use it like this:
Code:
# getpupsave


sample output:
Code:
# getpupsave
PUPSAVE='sda1,ext2,/xSlacko/slackosave-My'
#

enjoy Smile


Technical details

puppiness quotient: 1 line of code.

this pet puts a file in your bin containing the following script:
Code:
#!/bin/bash
# read PUPSAVE value from file /etc/rc.d/PUPSTATE
cat /etc/rc.d/PUPSTATE | grep PUPSAVE


3.0 has been changed to safer code. Code base has been reduced by 50% -- from 2 lines to 1 line Wink
getpupsave-3.0.pet
Description 
pet

 Download 
Filename  getpupsave-3.0.pet 
Filesize  364 Bytes 
Downloaded  98 Time(s) 

Last edited by johnywhy on Thu 14 May 2015, 03:58; edited 12 times in total
Back to top
View user's profile Send private message 
nilsonmorales


Joined: 15 Apr 2011
Posts: 863
Location: El Salvador

PostPosted: Sat 09 May 2015, 01:41    Post subject:  

Nice job johnywhy
You're becoming a hacker Very Happy
nice nice, congrat

_________________
My blog | | Github


Back to top
View user's profile Send private message 
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Sat 09 May 2015, 03:49    Post subject:  

thx Nilson!

i thought it might be cool if i attach the actual pet file :/

see OP

_________________
Now: PupTarhNOP
Tops: Vlina-R2 LxPrecise Racy xSlacko
Used: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
Watching: Quirky-April Zagreb RapidPup
i ♥ Puppy
Back to top
View user's profile Send private message 
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Mon 11 May 2015, 06:52    Post subject:  

Version 3.0 released, changed to safer, shorter code:
Code:
cat /etc/rc.d/PUPSTATE | grep PUPSAVE

pet in op

_________________
Now: PupTarhNOP
Tops: Vlina-R2 LxPrecise Racy xSlacko
Used: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
Watching: Quirky-April Zagreb RapidPup
i ♥ Puppy
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Mon 11 May 2015, 12:41    Post subject:  

Hello, johnywhy.

And it is important to do this because... ? (In other words: I'm a sceptic.) Smile
There's already all sorts of info concerning the Puppy at
/etc/DISTRO_SPECS and at
/initrd/tmp/PUPSAVES

BFN.

musher0

_________________
musher0
~~~~~~~~~~
"The greatest of minds are the ones that never close." | "Les plus grands esprits sont ceux qui ne se ferment jamais."
(starhawk, Resident Philosopher | philosophe en résidence) Wink
Back to top
View user's profile Send private message 
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Mon 11 May 2015, 14:52    Post subject:  

musher0 wrote:
I'm a sceptic.) Smile
There's already all sorts of info concerning the Puppy at
/etc/DISTRO_SPECS and at
/initrd/tmp/PUPSAVES


thx for pointers!

the purpose of my getpupsave command is that it's a command-- more convenient than remembering and manually digging into system files.

your suggestion, /etc/DISTRO_SPECS, does not contain the pupsave path. it contains:
Quote:
#for the partition, path and actual files loaded, see PUPSFS and ZDRV in /etc/rc.d/PUPSTATE


so, it is is telling me i'm looking in the right place: /etc/rc.d/PUPSTATE

your suggestion, /initrd/tmp, is a temp directory, and i've always been taught to be skeptical about the contents of a temp directory-- it's a scrap dir, a throwaway dir, not a reliable source of system data.

so, i feel confident using /etc/rc.d/PUPSTATE. G agrees:
http://murga-linux.com/puppy/viewtopic.php?p=844608#844608

thx!
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Mon 11 May 2015, 20:06    Post subject:  

Hi, johnywhy.

Yes, /etc/rc.d/PUPSTATE is a good source of info in this case.

Beware, though: not all temp files contain junk. Some temp files contain
very important information, some transient information for a particular
script or operation -- sometimes, but also some important info your entire
Puppy session.

Look in your /tmp directory and you'll find many temp files for Internet or
wifi connection, or for mounted partitions (usb and hard drives), for
example. They are temporary files, but you need them, they're not junk.

The same is true for the files at /initrd/tmp/. They contain usual
information about your Puppy and your partitions, among other things.

In console, type
Code:
cd /initrd/tmp
more *

and see for yourself.

BFN

musher0

_________________
musher0
~~~~~~~~~~
"The greatest of minds are the ones that never close." | "Les plus grands esprits sont ceux qui ne se ferment jamais."
(starhawk, Resident Philosopher | philosophe en résidence) Wink
Back to top
View user's profile Send private message 
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Tue 12 May 2015, 00:28    Post subject:  

musher0 wrote:
Beware, though: not all temp files contain junk. Some temp files contain
very important information

For sure, i understand that they are important. But they are transient, and serve specific applications. they are not intended for general use. There's no guarantee they will exist tomorrow, there's no guarantees they will be up-to-date. They are created as transient resources for specific apps, so i don't think it would be a save idea to use Temp dirs for any process that needs to be reliable. Temp files are not meant for that.

thx!

_________________
Now: PupTarhNOP
Tops: Vlina-R2 LxPrecise Racy xSlacko
Used: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
Watching: Quirky-April Zagreb RapidPup
i ♥ Puppy
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Tue 12 May 2015, 01:51    Post subject:  

johnywhy wrote:
musher0 wrote:
Beware, though: not all temp files contain junk. Some temp files contain
very important information

(...) They are created as transient resources for specific apps, so i don't think it would be a save idea to use Temp dirs for any process that needs to be reliable. Temp files are not meant for that.

thx!


Hi, johnywhy.

I beg to differ. In addition to the folders that I mentioned earlier, /var is
full of temporary files that are quite reliable... But I don't want to get into
a verbal fight with you! Like the apprentice sorcerer who doesn't want to
believe what the master sorcerer is telling him Wink, you'll have to discover
the true nature and usefulness of temporary files by yourself!!!

Now, for the purpose of education, please find, make a note of and then
delete ALL the temporary files on your Linux system, one after the other,
very methodically, and see what happens!!! Twisted Evil I guarantee you a
very reliable crash before you're finished!!! Laughing

musher0

_________________
musher0
~~~~~~~~~~
"The greatest of minds are the ones that never close." | "Les plus grands esprits sont ceux qui ne se ferment jamais."
(starhawk, Resident Philosopher | philosophe en résidence) Wink
Back to top
View user's profile Send private message 
johnywhy


Joined: 20 Aug 2011
Posts: 689

PostPosted: Tue 12 May 2015, 02:27    Post subject:  

master Razz

you clearly have experience and knowledge, and i value that.

i don't want to have an argument either. but i value intellectual debate, or at least different perspectives. i appreciate your opinions -- you make me think.

i understand temp files can be very important. i did not say they are not important. yes, i agree with you, i think you're correct.

just saying that the owners of files in temp directories may do whatever they want to those files. Apps have no "contract" to fulfill any user expectations about files in temp. A new version of some app might have different temp files than the last version. Therefor, as a programmer, i would be inclined not to depend on them. Safer to use non-temp files -- just my opinion.

musher0 wrote:
And it is important to do this [pet] because... ? (In other words: I'm a sceptic.) Smile

i'm glad you're a skeptic! skeptics help me do things that are useful and sensible. mainly, i do what's useful and sensible for me, and if someone else finds it useful, great! if not, don't matter Cool

My theory is, if i make something because i need or want it, then it's more likely that someone else will also want it.

quoting my OP-
Quote:
it's handy if you multiboot several frugal puppies, and you forgot which one you are booted into. the advantage of the getpupsave command is that it's a command-- more convenient than remembering and manually digging into system files.
You might not need it, but for me it's very helpful. Lately i've been multibooting like 10 different OS's, and sometimes forget which one i was booted into Embarassed

cheers!

_________________
Now: PupTarhNOP
Tops: Vlina-R2 LxPrecise Racy xSlacko
Used: Puppeee Precise Lucid Wary Tahrpup Quirky Slacko MacPup Saluki Puppy Studio LxPupTarh Lina-Lite Lina
Watching: Quirky-April Zagreb RapidPup
i ♥ Puppy
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Tue 12 May 2015, 11:02    Post subject:  

Hello, apprentice Wink

Indeed, if you have 2 or 3 pupsave files, this little script can be useful
to refresh your memory.

BFN.

_________________
musher0
~~~~~~~~~~
"The greatest of minds are the ones that never close." | "Les plus grands esprits sont ceux qui ne se ferment jamais."
(starhawk, Resident Philosopher | philosophe en résidence) Wink
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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.0521s ][ Queries: 12 (0.0046s) ][ GZIP on ]