Jump to content

Clutter Learns Linux


Cluttermagnet

Recommended Posts

. . however, to note that it created a 4.6M pdf document from an ~100k .png. Also, it displays, when clicked on, rotated 90 degrees counter- clockwise . . . .
In that case I am sure you will like the "Export as PDF" feature in OpenOffice, that Fran pointed out, better ;):whistling: Bruno
Link to comment
Share on other sites

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

  • Cluttermagnet

    458

  • Urmas

    207

  • Bruno

    143

  • V.T. Eric Layton

    87

O, here are a couple of other ones:Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktophttp://www.howtoforge.com/display_my_compu...n_gnome_desktopChanging the Console resolution in Ubuntuhttp://www.t94xr.net.nz/?p=167Opening Files With A Single Click Instead Of A Double Click In GNOMEhttp://www.howtoforge.com/gnome_single_mouseclick

Link to comment
Share on other sites

V.T. Eric Layton

Maybe Clutter has learned Linux completely already. Some folks are fast learners, unlike you and I. B)

Link to comment
Share on other sites

here's my favorite tweak. ya know those little yellow popup tool tips thingys in the menus? works on ubuntu. i guess fedora uses different gconf version, i can't find it.

tool tips gnomeIf you are using Gnome, press Alt-F2 to get the Run box and type in "gconf-editor", then press Enter. When the gconf-editor appears, navigate in the tree on the left to /apps/panel/global/ and locate the setting tooltips_enabled in the setting to the right. Remove the checkmark beside tooltips_enabled and exit gconf-editor. Shazam - no more tooltips!
Link to comment
Share on other sites

V.T. Eric Layton

Of course, you have to have gconf editor installed first. It's a useful tool in Gnome. If you don't have it already, it's available in most distros' repos. B)

Link to comment
Share on other sites

Cluttermagnet

Hi, all-Well, I just got a little busy and could not spend as much time on the computers. I have been using Ubuntu 6.06 regularly (every day), about 50 percent of my time in Linux, 50 percent in 98SE.I was so happy to see how easy they have made it to set up HP printers in Ubuntu. Bravo! :teehee: I still want to set up a script to mount my (empty) zip drive at bootup. Trouble is, when I really read closely for understanding, I get confused about Bruno's writeup for making bash scripts. I think I understand most, but just not all about that. The problem with that tutorial is there is some superfluous code in that post, between the "code" examples. I can't tell how that applies to the code items. For example, I see "<i>" before and "<Esc>" and "<ZZ>" after. What is the purpose of this?Also: "First a little script:" The coded item, does it open up an editor utility called "vi"? And in that editor creates a script called "del"? And the script itself would be the next group of code with the ".../bin/bash... and ending with "End script"? That whole sequence is a bit confusing. Sorry. Everything else in the procedure makes sense to me, except for this part about the bash script.

Link to comment
Share on other sites

Of course, you have to have gconf editor installed first
thanks eric, i didn't think of that.cluttermagnet...you're doing great, i'm learning a lot, :teehee: Edited by cybormoron
Link to comment
Share on other sites

I get confused about Bruno's writeup for making bash scripts. I think I understand most, but just not all about that. The problem with that tutorial is there is some superfluous code in that post, between the "code" examples. I can't tell how that applies to the code items. For example, I see "<i>" before and "<Esc>" and "<ZZ>" after. What is the purpose of this?Also: "First a little script:" The coded item, does it open up an editor utility called "vi"? And in that editor creates a script called "del"? And the script itself would be the next group of code with the ".../bin/bash... and ending with "End script"? That whole sequence is a bit confusing. Sorry. Everything else in the procedure makes sense to me, except for this part about the bash script.
Hi Clutter . . . in that tip I make use of the Vi editor, which is indeed a bit confusing for new users.I will make a "translation" ( using another editor suited for new users ) of that Tip for you later today, I am sure things will be clear after reading that "translation".:teehee: Bruno
Link to comment
Share on other sites

Here is the "Translation" :teehee:BASH SCRIPT ( for Cluttermagnet, adapted to Ubuntu )Keeping it simple: You know by now that "rm" removes a file, permanently !Wouldn't it be nice if we could move it to the recycle bin with a simple command instead ?We're gonna make that command and call it: "del"( YES ! making our own commands ! )First a little script:

$ gksudo gedit /usr/bin/del

Here is the text for the script, copy and paste it in the empty file:

#!/bin/bashmv $1 ~/Desktop/Trash#End script
( NOTE: The first line tells your computer it is a bash script, the second line is the code the script should execute, the third line tells your computer the script ends there. )Now, save the file and make it executable with the following command:
$ sudo chmod 0775 /usr/bin/del

Now if we first create a test file called : "tessst"

$ touch tessst

We can delete the file with your own created "del" command:

$ del tessst

REMARK: It will execute the script and do the same as: "mv tessst /home/bruno/Desktop/Trash"Sure this was a very short example, a 3 line script, it only holds one command, but you could put as many lines in the script as you want and execute it with a four letter word.If there are more commands in the script it will execute them in the order that they are noted down.Because /usr/bin is in your "path" you only have to type "del" to execute it.If you have to do complicated commands in a certain order on a regular basis, make a little bash script, put it in your "path" and give it a name that's easy to remember.Next time we'll make a simple backup script, to backup and gzip the contents of your /home directory.More about bashscripts see: Introduction to bash Shell Scripting:w00t: BrunoPS: Urmas, can you check if "gksudo" is a command Ubuntu knows about ?

Link to comment
Share on other sites

Cluttermagnet
$ gksudo gedit /usr/bin/del

(For completeness:)I open "Applications/Accessories/Terminal" from the drop-down menu in the top 'panel' (toolbar) of Ubuntu...I type in the "gksudo gedit /usr/bin/del" command line...User log in window appears and I log in...
"GnomeUI-WARNING **: While connecting to session manager:Authentication rejected, reason : None of the authentication protocalls specified are supported and host-based authentication failed."
BUT- It did open up a gedit window "del (/usr/bin)"I entered the code, exactly as given. into the gedit window, but of course, nothing happens, so far as I can tell. If I hit Enter, I just get the cursor on a 4th line in gedit. gedit just sits there waiting for Clutter to tell it something to do... :whistling: :hysterical:BTW remember, guys, Clutter has done *nothing* yet, so far as setting up any additional users or permissions. That lesson has yet to be learned. Whatever default user set up by Ubuntu during installation is the *only* one presently active. I have no real concept, yet, about setting up permissions in Linux... As I said earlier in this very long thread, Clutter is still at Remedial Pre-Ubuntu 010B.True Ubuntu 100/101 is next semester... :hysterical: Edited by Cluttermagnet
Link to comment
Share on other sites

(User log in window appears and I log in...)"GnomeUI-WARNING **: While connecting to session manager:Authentication rejected, reason : None of the authentication protocalls specified are supported and host-based authentication failed."BUT- It did open up a gedit window "del (/usr/bin)"
Yup... that warning is something you'll get used to... a "nothing" error message.
I entered the code exactly as given. into the gedit window, but of course, nothing happens, so far as I can tell. If I hit Enter, I just get the cursor on a 4th line in gedit. gedit just sits there waiting for Clutter to tell it something to do... :whistling: :hysterical:
OK... what you need to do is first delete the empty lines you've created with <enter>, then save the file (and after that you can close Gedit). And then proceed:
Now, save the file and make it executable with the following command: <and so on>
:thumbsup:Oh...
PS: Urmas, can you check if "gksudo" is a command Ubuntu knows about ?
Yessiree, it's kosher... although me, I'm baaaaad... I usually just "sudo gedit". Hasn't broken anything (that I know of) yet. :rolleyes: Edited by Urmas
Link to comment
Share on other sites

Cluttermagnet

Uh-Save it? Or Save To (save to where?)In the same window where I had the error message, I typed that line to 'make it executable'. I had to type in even the "$" before the "...sudo chmod..." I don't know if this command was executed. In any case, I doubt Linux knew where to save it to. Of course, I want it to go into .../etc/rcS.d (right??)(Of course, the file "del" is not in rcS.d)I think I need to completely redo this procedure. I doubt the Terminal program is really listening to me if I have to enter the "$" prompt myself at the beginning of a line... :hysterical:

Edited by Cluttermagnet
Link to comment
Share on other sites

I don't know much but I do know that you don't type in $ or #Those are posted along with the code line just so you know if you are in normal user mode or super-user or root mode. (that's just the prompt like > in windows).When terminal comes up do you see $ or # ?

Edited by zlim
Link to comment
Share on other sites

Cluttermagnet
I don't know much but I do know that you don't type in $ or #Those are posted along with the code line just so you know if you are in normal user mode or super-user or root mode. (that's just the prompt like > in windows).When terminal comes up do you see $ or # ?
Yes. A fresh launch of Terminal opens a window with the "$" prompt at the beginnning of the line. Actually, "user@user-desktop:~$ " with a black cursor rectangle just winking away at me to the right of the "$". Edited by Cluttermagnet
Link to comment
Share on other sites

Save it? Or Save To (save to where?)
It is "save" ( because in the command just before "gksudo gedit /usr/bin/del" you did already create the "/usr/bin/del" file. )See, Clutter, allow me one remark: The BashScript Tip is actually a tip for the advanced user, it assumes you know how to use the Vi editor and Bash . . . that is why you are having troubles getting this right.Now, basically this is not a problem, because you do learn from your questions and mistakes and in the end you will get the message and now how to make a bash script :DB) Bruno
Link to comment
Share on other sites

Cluttermagnet

I started all over. I get (in gedit):The file /usr/bin/del is already open.It wants me to decide to: Edit Anyway, or Don't Edit.I choose "Don't edit".I do a "File/Save.This time it asks me for password (again)...BUT- I try to enter pwd, gedit ignores my keystrokes and the stupid cursor blinks merrily away, taunting me... :hysterical:(This time, it does not pop up the password entry window, it is just the line "Password:" and the blinking colon, inside the gedit window...

Edited by Cluttermagnet
Link to comment
Share on other sites

In no particular order... (that's the way I like it :hysterical: )$/#: Ubuntu is a "sudo" distro. That means, by default, user account(s) only. No root. Hence, in terminal, the only prompt is $, the "user prompt".

I think I need to completely redo this procedure.
OK... Let's:First, in Terminal, copy/paste:
sudo gedit /usr/bin/del

Password prompt. Gedit text editor opens the file "/usr/bin/del".In Gedit ("/usr/bin/del"), copy/paste Bruno's "tutorial delete script":

#!/bin/bashmv $1 ~/Desktop/Trash#End script

Save and exit (you can just click the close icon (X) on Gedit's "title bar"... it'll ask you whether to save before exiting... say "yes".)Next, in Terminal, you make the above script executable (I seem to recall you asked about executable text files before... here you go):

sudo chmod 0775 /usr/bin/del

Next, you create a test file (to be deleted with grace and artistry using the brand new script) in your HOME DIRECTORY:

touch tessst

(You can open Nautilus (file manager) and check... after giving that command, there is a file called "tessst" in there.)ANNNNND - TA-DAA... the moment of truth... testing the script:

del tessst

(In Nautilus, check your Home Directory... the "tessst" file is gone. It effin' works!) :whistling:

Link to comment
Share on other sites

Cluttermagnet

OK, I completely redo, I enter the "chmod" command in Terminal, it asks me for Password, I enter pwd and hit Enter. New line, cursor is flashing. So did it indeed get made executable? I still don't see it in rcS.d. Should I see it there? Does it just know to put this script in rcS.d? Or do I have to explicitly tell it to put it there?Duhhhhhhhhhhhhhh....It works exactly as it should! You guys had created the expectation in my mind that a file "del" should show up in rcS.d. This is not the case. BUT my command "del" does indeed delete (move?) the file "tessst" I created in my home directory. Whew! :hysterical:

Edited by Cluttermagnet
Link to comment
Share on other sites

First, in Terminal, copy/paste:
sudo gedit /usr/bin/del

Password prompt. Gedit text editor opens the file "/usr/bin/del".In Gedit ("/usr/bin/del"), copy/paste Bruno's "tutorial delete script":

#!/bin/bashmv $1 ~/Desktop/Trash#End script

Save and exit (you can just click the close icon (X) on Gedit's "title bar"... it'll ask you whether to save before exiting... say "yes".)Next, in Terminal, you make the above script executable (I seem to recall you asked about executable text files before... here you go):

sudo chmod 0775 /usr/bin/del

Next, you create a test file (to be deleted with grace and artistry using the brand new script) in your HOME DIRECTORY:

touch tessst

(You can open Nautilus (file manager) and check... after giving that command, there is a file called "tessst" in there.)ANNNNND - TA-DAA... the moment of truth... testing the script:

del tessst

(In Nautilus, check your Home Directory... the "tessst" file is gone. It effin' works!) :hysterical:

Looks like that should indeed work . . . . . :whistling: . . . Thanks Urmas !:rolleyes: Bruno
Link to comment
Share on other sites

Cluttermagnet
Looks like that should indeed work . . . . . :hysterical: . . . Thanks Urmas !:whistling: Bruno
Yes, it works! I was expecting something to happen which did not happen. A complete misunderstanding on my part about the role of the directory "rcS.d" in these matters. So I have indeed succeeded in creating and executing with my first script. Now...on to writing the script which will mount my zip drive (empty of diskette) upon booting... Edited by Cluttermagnet
Link to comment
Share on other sites

Cluttermagnet

So now it looks like I need another command line that works something like"gksudo gedit /usr/bin/del" does.This command line would probably include the address to put the new script into rcS.d, right?And the script itself would be the-

#!/bin/bashmknod /dev/hdb4 b 3 64#End script

I have already determined that my 'major' and 'minor' numbers match the "3" and "64" above, on my machine...

Edited by Cluttermagnet
Link to comment
Share on other sites

Now...on to writing the script which will mount my zip drive (empty of diskette) upon booting...
Ahaaaa . . this was why you wanted to learn about scripts :hysterical:
So now it looks like I need another command line that works something like"gksudo gedit /usr/bin/del" does.This command line would probably include the address to put the new script into rcS.d, right?
Try "sudo gedit /etc/rcS.d/zip-mount"And don't forget to make the file executable once it is created: "sudo chmod 755 /etc/rcS.d/zip-mount" :whistling:
And the script itself would be the-
#!/bin/bashmknod /dev/hdb4 b 3 64#End script

Looks 100% Clutter !!:rolleyes: Bruno
Link to comment
Share on other sites

Psssst... kemo sabe... who's "rcS.d"? :whistling:
See the "README" in the /etc/rcS.d directory :hysterical:( all executable files placed in the /etc/rcS.d will be executed at boot ):rolleyes: Bruno
Link to comment
Share on other sites

Okay Clutter, reboot . . . and after the reboot check if the /dev/hdb4 file exists:

$ ls -al /dev/hdb4

if it does the script worked :hysterical: :whistling: Bruno

Link to comment
Share on other sites

Cluttermagnet

Yes, I'd already figured out the function of rcS.d. I think there is a Readme in there which explains it is all scripts executing at bootup.Now, after rebooting,

"Unable to mount the selected volume"
(drive empty);
"Unable to mount the selected volume"
(zip disk inserted and recognized by the drive itself)BUT- This should have been placed in rcS.d as something like "S95......", not as "zip-mount"???".../etc/rcS.d/S95zipnode..." Edited by Cluttermagnet
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...