Hello Everyone,
Even those you'd think would know everything there is to know about Linux and Puppy might not know or remember even what you'd call the "Linux Basics" even a newbie would know that!

Here's an example I'd forgot about ldd what is ldd well if you open a terminal in a folder with say libflashplayer.so ldd will tell you what dependencies libflashplayer.so requires to work correctly.

Forum members dawnsboy and Michalis reminded me of that and this got me thinking "Knowledge is Power" lets get these little what you might call simple tips down in a forum post for everyone to read and learn.

Lets say that new forum member "boo" reads your tip and discovers through learning and experiment like I did how to get an app working, gets the satisfaction like I did and gets hooked and searches to learn more here on the forum as well as on the web and other forums.

Now a year or two pass by and "boo" has become quite the Linux expert and through a twist of fate answers a post you have made providing you with the required fix you need all because of the simple tip you posted.

So lets get posting and improve everyone's knowledge including your own._________________Legacy OS 2017 has been released.

I think my favourite tip about Linux is that just about everything appears in the filesystem. There is some useful stuff in there!

For example, /proc gives access to a load of system info. This knowledge allows me to monitor the DC input to my elderly laptop with very unwell battery and pop up a dialog box to warn if the power lead falls out, before the battery dies.

Second tip is to put this script in /root/Startup/ - any executable in this directory will run when the system starts.

This script may be specific to this Toshiba laptop, but digging around in /proc/acpi/ should reveal where the useful parts are for your system.

Code:

#!/bin/bash
# AC Power monitoring script
# This script monitors the AC power connection every 30 seconds
# and pops up a message box if the power is disconnected

# AC Power state is available in: /proc/acpi/ac_adapter/ADP1/state
# Power disconnected, file contains: state:<spaces>off-line
# Power connected, file contains: state:<spaces>on-line

# define script name for use in dialog box titles
cScriptName=${0##*/}

Many people don't know how to upload a text file to the forum quickly and easily. Consequently we often get some very long posts. The forum will accept .gz and .zip files as attachments. So the quickest and easiest way I find to compress a single file is with gzip.

To gzip a file open a terminal (usually rxvt or urxvt in Puppy). If your file is in your "/root" directory type:

Code:

gzip /root/myfile

where my file is the file you want to zip.
This is great for long log files so others more knowledgeable can help you with your issues.

Conversly, if you download a "gzip" file , say myfile.gz, it will probably be saved in "/root/my-documents" or "/root/downloads". Unzip it in a terminal emulator with:

Code:

gunzip /root/my-documents/myfile.gz

and the file will be extracted in /root/my-documents. Obviously you replace "my-documents" with "downloads" if it is in /root/downloads.

G0XAN, That is a *dandy* little script you got there. I was looking for a answer to that problem a few days ago myself. I had to modify the path to the state file for my laptop config and extended the test period to 10 minutes, after that it works like a champ! Here is my version in case anyone wants to see the differences for their own tweaking.

Code:

#!/bin/bash
# AC Power monitoring script
# This script monitors the AC power connection every 30 seconds
# and pops up a message box if the power is disconnected

# AC Power state is available in: /proc/acpi/ac_adapter/ADP1/state
# Power disconnected, file contains: state:<spaces>off-line
# Power connected, file contains: state:<spaces>on-line

# define script name for use in dialog box titles
cScriptName=${0##*/}

while [ 0 ] # repeat for ever
do
if grep -q off-line /proc/acpi/ac_adapter/AC/state #-----------Modify this line for your path to the state file....
then
vMessage="Mains power failure!"
Xdialog --left --title $cScriptName --msgbox "$vMessage" 10 50
fi
sleep 600 # sleep for 600 seconds (10 minutes)-------Modify this line for your time interval....
done

Here's a tip I posted some time back. The original purpose was to get spell checking with Sylpheed, which had been compiled without built-in spell checking. This is useful as an example of a work around for other purposes. You don't have to use options like the external editor hook in Sylpheed for the original purpose. (Of course, you must install the aspell dictionary for the language you want to use.) For most people this will be useful only as an example of how to launch a program which runs in a terminal window.

At present, I'm on a machine fast enough to use Abiword for spell checking. You simply install the dictionaries you use under Abiword, and select the option for automatic spell checking. Then you define Abiword as your external editor. Because Abiword is part of standard Puppy this is a quick hack for getting spell checking if you replace Seamonkey mail with Sylpheed. (Seamonkey mail has its own spell checking, using a different program and dictionaries.) I haven't used the older hack in a while, because Abiword is good enough, on this machine, even if it doesn't know to ignore links in email.

On older versions of Puppy, there is a Gtkspell package that works, and has less overhead, but it hasn't been updated to work with Puppy 4 series.

prehistoric wrote:

There are versions of Sylpheed with built-in spell checking, but the ones making it into Puppy packages generally don't have it. I can't comment on Sypheed under 4.0 because I'm not running that, but I have long used it under 3.01 with a hack that gives me simple spell checking, if not the best interface. I have defined the external editor, (common preferences->details->external commands) as follows:

Code:

rxvt -e aspell -e -c %s

This tells it to run aspell in a terminal with email rules and interactive correction on the file passed to the command. Most of the time the correction I want is in the first 3 alternatives it presents.

I keep thinking I'll get around to installing gtkspell and keep forgetting, because this is just good enough for the present.

Suppose you are using an rxvt console to get debugging information by running a command that is producing error messages. How do you get those messages into a text editor?

prehistoric wrote:

dougeeebear wrote:

...Is there a way to copy/paste with that stupid console?
Is there something better with some features and tabs?

Open a text editor window, select the text you want in the console window, then center click in the editor window to copy to the editor. (You can emulate center click by clicking both right and left buttons simultaneously.)

Old Unix hands will remember using tee to send or append output to a file, while still seeing it on the console. Puppy has busybox tee. You can merge error output with standard, if cryptic, command line syntax, used here to save output from a make command used to build a program.

Code:

make 2>&1 | tee build.log

There is also a utility called script on many Linux systems which records entire terminal sessions. Has anyone packaged this for Puppy?

There may be a little confusion about that last command. Tee splits the output stream and sends one branch to the file, the standard output from tee still appears on the console, if not directed elsewhere. This way tee can be used for debugging long pipelines of commands. Just insert tees where you want to capture output.

Here's an exchange I just ran across. The original problem was putting the wrong link in the box for pwget. (A link to a directory, not a file.) This is explained further down.

In the process, we learn about a robust command for downloads. Before I found Puppy Linux, I used this method to build an entire system from source, before I got the GUI working. If the Linux system you're on doesn't have wget, it probably has serious deficiencies. In the world before flash drives, Tom's root/boot floppy got me many things this way, even on machines where very little worked.

How does one enter an address in pwget to download this iso ?It has the initial address shown in the first post in the thread ie http://www.puppylinux.asia/tpp/NOP which does not name the file in question. If I put this in pwget and give a download folder it shows the console with a link up process then this disappears and the download folder appears. If I add the ISO in question ie http://www.puppylinux.asia/tpp/NOP/puppy-431-boxpup.iso Then the same thing happens that is ,the console appears then disappears and the download folder appears. Am I missing something. I have downloaded ISO s before when the link has the whole address including the name of the ISO and had no problem.I put it down to premature senility but hope there is a better answer.

Roy wrote:

I do not know about pwget, but if you use the following commands in Puppy's desktop Console, it will work:

Should you need to interrupt your download for any reason, simply press Ctrl+C to pause it. Using your keyboard's Up Arrow will bring back the original command shown in the code window above; pressing Enter with your blinking cursor at the end of that command line will resume the file transfer. Using this command line with the '-c' in it will also cause the transfer to restart on its own if the connection is temporarily interupted.

-Roy

Quote:

Roy Thanks for that,it worked perfectly.I dont know why the pwget setup did not work but the CLI system is perfect. Unfortunately to some of us the Console stuff has to be spelt out.I only know enough about this stuff to know what I dont know, Also people who are working in a system that they deeply understand have trouble realising that others in another area havent a clue what they are talking about.
Anyway thanks again ,I guess that this just proves that if you want to know the answer you must ask the question.
Regards D.

Roy wrote:

You are right; the command line stuff is not what a typical Windows refugee needs to begin using Linux. Personally, I am extremely grateful for these guys who have gone out of their way to create GUI's for guys like us in the past year or two. I only know the wget commands because the GUI stuff was not available when I first started using Puppy.... BTW, you should notice that the wget commands download to your root directory, unless you open the Console from within another directory OR use 'cd /your/target/directory' before inputing the commands I previously provided.

anonymous newbie wrote:

Roy Unfortunately the wget and pwget seem to fall down on some download sites.I just tried to use it on this site http://lhpup.org/download443.htm#Base/LighthousePup-4.43-d.iso and it it downloaded for a couple of seconds and then declared itself finished.

Roy wrote:

That site does not require a username or password, as far as I know. For wget, your command line should look like this:

Code:

wget -c http://lhpup.org/beta/lhp443/LighthousePup-4.43-d.iso

Note the different web address in my command line, compared to what you were using. To find the correct address, go to the actual download webpage, Right click on the .iso file link, and select Copy Link Location from the drop down menu.

Now when you open your desktop Console, type 'wget -c', add a space with your space bar, and click by pushing down on the center (scroll wheel) of your mouse. This center-click will paste that copied file address into your console.

Hit your Enter key, sit back, and smile....

I think you were trying to download a link that pointed to a web page that contained another link to the file. When you put your mouse pointer over a file name on a web page, look down at the bottom of your Seamonkey screen. If you do not see the actual file name that you are wishing, then it isn't the actual file; it's just another webpage link.

-Roy

Added: Just tried Tom's Root/Boot Floppy on a dual-core system with 2 GB RAM, to see if it would still work. There were some glitches, but overall it did. Considering the changes in computing since this was written, I'd call that remarkable.

For anyone perverse enough to try this themselves, here are a couple remarks. This program uses a non-standard format the Puppy floppy formatter will not create to fit more data on a floppy. There is a Linux program on the download which will access the raw device, and do what is necessary. Not all floppies, or floppy drives, will work, though most I've tried will.

When you try to run this program under Puppy according to his instructions, you will get an error, because Tom assumed the current directory is at the head of your PATH. (This is a terrible security hole for people running as root, and BarryK knows better.) The way around this is to temporarily prefix it to your PATH in a sub-shell.

Code:

(PATH=".:$PATH" ./install.s)

This illustrates a useful trick for setting variables used only in a particular context.
Here's a test, which also illustrates something about quoting and contexts in shell scripts:

I am fairly new to linux and spend a lot of time trying out new versions which I was burning to CD-R's. This created quite few coasters or frizbees, therefore, I began using CD-RW's to burn the new versions.
This has worked great for me. If the version is not a keeper, I simply use pburn to blank the CD-RW and reuse. Some of these have been reused 10-15 times and so far, no problems.
Hope this helps someone.
yarddog

I install my puppy to external usb hard-drive.
Sometimes I make a complete mess of things and cant get back in after spending all day setting things up.
So now I install it all, get to the point where it is working just the way I like it,then boot from a live CD with the hard-drive turned off(so i don't confuse which drives are which),turn on the hard-drive and copy the save file to another location (partition or second hard-drive) then if I make a mess of things, I can just go copy the saved file back over the messed up one.
This is handy for the files that I download too .
I have a folder called saves where I put my downloaded files after I install them and that gets backed up on its own.
I dont think it really needs to be a harddrive, I think you could easily back up to dvdrw or cdrw instead.
Saves hours of putting everything back and means I'm not afraid to try a new application.

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