*** scooper has quit (Ping timeout: 480 seconds) | 10:35 | |
*** scooper has quit (None) | 10:54 | |
*** Mulbah has quit (Remote host closed the connection) | 12:49 | |
Mulbah | Good morning Mr. Cole | 12:59 |
---|---|---|
tboimah | Good morning ubuntourist | 12:59 |
ubuntourist | tboimah, Mulbah Hello gents. | 12:59 |
Mulbah | How are you doing | 13:00 |
tboimah | Good and you | 13:00 |
Mulbah | so what is the goal | 13:01 |
Mulbah | for today | 13:01 |
ubuntourist | I was out making music all afternoon yesterday. And I have "Irish skin" 😉 a few minutes in the sun and I burn. I don't tan. | 13:01 |
ubuntourist | But other than that, pretty good. | 13:01 |
ubuntourist | I'm bad at planning goals. | 13:02 |
ubuntourist | I'll start with a question: | 13:02 |
ubuntourist | Was the explanation of directories helpful and do you have more questions about that? | 13:03 |
Mulbah | Yeah it was | 13:04 |
Mulbah | and also the tile | 13:04 |
ubuntourist | (Eventually, there is one directory in that list which you will become "intimate" with: /etc/. And maybe /var/log/. But the rest I rarely need to look at. | 13:05 |
ubuntourist | Mulbah, the tile? | 13:06 |
Mulbah | yeah this ~ | 13:06 |
ubuntourist | Oh, "tilde" There's a "d" in it. | 13:06 |
Mulbah | Oh thanks for the correction | 13:07 |
Mulbah | can we use tmate | 13:08 |
ubuntourist | (It is pronounced "till-deh"... Well that's my best appproximation of the pronunciation.) | 13:08 |
ubuntourist | Yup. Crank it up and send me the link. | 13:08 |
tboimah | ssh smbeLLzpACV4gD2RXuQSyMXGY@lon1.tmate.io | 13:08 |
ubuntourist | So... tboimah are you caught up on environment variables? Mulbah and I worked with $HOME and the general concept of environment variables. | 13:11 |
tboimah | yeah we did it together | 13:12 |
Mulbah | I explain it to he | 13:12 |
ubuntourist | (And the tilde ~ which is almost like $HOME.) | 13:12 |
Mulbah | suer | 13:12 |
ubuntourist | OK then. Let's continue a little bit more with that. | 13:12 |
ubuntourist | The "set" command can be used to either temporarily change the value of an environment variable, or list values of all the current environment variables. | 13:13 |
ubuntourist | We talked a little about "default" values -- These are the values that are either automatically established every time you boot or login, OR they are just "assumed" to be whatever would be the most logical choice. | 13:15 |
ubuntourist | For example, when you write HTML, the default color of the background is white, and the default color of the text is black. | 13:16 |
ubuntourist | Using CSS you can change them but the most common, logical choice is black text on a white background. | 13:16 |
ubuntourist | We won't worry too much about unset default values for now. But we will look at the values that are explicitly set when you boot or login. | 13:17 |
Mulbah | okay | 13:18 |
ubuntourist | Type "set" in the terminal (set followed by ENTER) | 13:18 |
tboimah | you will see a lot of python language | 13:18 |
ubuntourist | As you can see, it's a very long list. How would you see it a screen at a time? | 13:19 |
*** shmohamud has quit (Remote host closed the connection) | 13:21 | |
ubuntourist | (How would you show the list of varialbles so that you can scroll through it slowly, one screen at a tme? I saw it appear as you were searching through the history...) | 13:22 |
ubuntourist | Oops. Something crashed. I've been kicked out of tmate. | 13:25 |
mcssguest_ | yeah | 13:25 |
*** Thomas_ has quit (Read error: Connection reset by peer) | 13:25 | |
*** mcssguest_ has quit (Read error: Connection reset by peer) | 13:25 | |
ubuntourist | I tried using the SSH again and briefly connected to "sysadmin@solidarity" or something like that, but got kicked out again. | 13:26 |
ubuntourist | Trying a third time... | 13:26 |
Thomas_ | ssh zM5XVzBzmHBf5rnqTh5KBQzHa@lon1.tmate.io | 13:27 |
Thomas_ | ubuntourist please ssh into that link to reconnect on tmate | 13:28 |
*** scooper has quit (None) | 13:28 | |
ubuntourist | So. we're trying to make the "set" command show variables, but not so fast that you cannot read the results... | 13:30 |
*** Mulbah has quit (Ping timeout: 480 seconds) | 13:30 | |
*** tboimah has quit (Ping timeout: 480 seconds) | 13:30 | |
*** fkoikoi_ has quit (None) | 13:31 | |
ubuntourist | ACTION is waiting for ideas or experiments in the terminal window. | 13:33 |
tboimah | what ideas did you want ubuntourist? | 13:33 |
ubuntourist | I want to know how you would show the evironment variables but not have them scroll off the screen so fast. | 13:34 |
mcssguest_ | okay | 13:34 |
ubuntourist | That's it. | 13:35 |
ubuntourist | "most" would be better than "more". | 13:35 |
*** fkoikoi has quit (Ping timeout: 480 seconds) | 13:35 | |
mcssguest_ | okay | 13:35 |
ubuntourist | "q" to quit, and try again with "most" | 13:36 |
mcssguest_ | Sir | 13:36 |
ubuntourist | As we talked about before, the two wonderful features of most are the ability to display binary unreadable files without messing up your terminal window, and the abilty to scroll left and right. | 13:37 |
ubuntourist | Use your left and right arrows while using the "set | most" and see how you can move left or right on long lines. | 13:38 |
ubuntourist | OK. | 13:39 |
ubuntourist | Now, we're gong to search the results. Type "/PWD" | 13:39 |
ubuntourist | Sorry, without quitting. | 13:40 |
ubuntourist | Do it while still in "set | most" | 13:40 |
ubuntourist | So, you are still in the list, but you searched the list for PWD to find what the value of PWD is. | 13:41 |
tboimah | the value for pwd is /home/sysadmin | 13:41 |
ubuntourist | It fails the second time because it is searching a second time for the string PWD and there is only one occurance So it can't find a second one. | 13:41 |
ubuntourist | PWD stands for "Print Workiing Directory" . It is also a command "pwd" when you are not in "set | most" | 13:42 |
tboimah | sure | 13:43 |
mulbah | yeah | 13:43 |
ubuntourist | Your "working directory" is the same as your "current directory". Quit most, and cd to some other directory and try the command again. | 13:43 |
ubuntourist | (try the set | most and /PWD again, I mean.) | 13:43 |
tboimah | it print the current working directory that you are working in | 13:44 |
ubuntourist | Right, and Bash keeps track of that by resetting the environment variable. | 13:45 |
tboimah | it reset the value for pwd to /home/sysadmin/Desktop | 13:45 |
ubuntourist | And see how there is now an "OLDPWD"? You did a "cd" that brought you back to your home directory before trying the set | 13:46 |
ubuntourist | Now there should be two results in the search "OLDPWD" and "PWD". | 13:46 |
ubuntourist | (While using most, "T" will go to the "Top" of the list and let you search from the beginning again.) | 13:47 |
ubuntourist | Because you're at the search prompt, you have to give it something to search for.. If you type "q" it won't quit, it will search for "q". | 13:50 |
mulbah | Okay | 13:50 |
ubuntourist | Antother way to search your environment vatiables -- and LOTS of other things, is to use "grep" and learn everything you can about "regular expressions") | 13:51 |
ubuntourist | As systems administrators, "find", "grep", "most" and "man" will become some of your best friends. | 13:52 |
ubuntourist | And the pipe character "|" | 13:53 |
ubuntourist | grep can become very complicated. Really "regular expressions" which is what grep searches for, can be very complicated. | 13:53 |
ubuntourist | But we will stick to simple use. | 13:54 |
ubuntourist | You see that the man page has syntax highlighting: bold text, and at the bottom of the screen a message. | 13:55 |
ubuntourist | By default, man is using a pager. "most" is a better pager. | 13:55 |
ubuntourist | Try thiis: | 13:56 |
ubuntourist | set | grep PAGER | 13:56 |
ubuntourist | Ok... So, man is using a default pager, and there is no environment variable named PAGER. | 13:57 |
ubuntourist | (For comparison try "set | grep HOME" and "set | grep PWD" | 13:57 |
ubuntourist | ACTION waits while people try those two commands. | 13:58 |
*** tboimah has quit (Remote host closed the connection) | 13:58 | |
ubuntourist | Bother. I thought the connection was more reliable... | 13:59 |
mulbah | The network is giving little bit problem today sorry for that | 14:00 |
ubuntourist | Are you both in the same place? tboimah what was the last text you saw from me. | 14:00 |
ubuntourist | Are you both in the same place? tboimah what was the last text you saw from me? | 14:00 |
tboimah | wait for people to try the two command | 14:00 |
tboimah | that was the last text | 14:01 |
ubuntourist | And... tmate dropped me... | 14:01 |
tboimah | yeah | 14:01 |
tboimah | ssh YV4cbcr4EKSSpbhsFk2wzKVfr@nyc1.tmate.io | 14:02 |
tboimah | ssh that to reconnect please | 14:02 |
ubuntourist | I'm connected but stuck. | 14:04 |
ubuntourist | OK. Back again. | 14:04 |
ubuntourist | Now the two commands that I asked you to type for comparison. | 14:04 |
ubuntourist | Oh, I see you already tried one of the two: the "set | grep HOME" | 14:05 |
ubuntourist | the other was "set | grep PWD" | 14:05 |
*** tboimah has quit (Remote host closed the connection) | 14:06 | |
ubuntourist | (I see "s" but it looks like the connection is dropping again. We REALLY need to find a more reliable connection.) | 14:06 |
ubuntourist | I'm not sure how to proceed if every command is interrupted by network drop-out. | 14:08 |
mulbah | sorry that will not happen again the connection problem have been fax | 14:08 |
tboimah | I just try the two command did you see it | 14:08 |
tboimah | ssh 3XVesaHkKUShTWNMvHcSzadAx@lon1.tmate.io | 14:09 |
ubuntourist | tboimah, I didn't see the "set | grep PWD" but that's okay. | 14:09 |
tboimah | can you please ssh into that link please so that we can proceed | 14:09 |
ubuntourist | So you can see that it found "PWD" three times. | 14:10 |
ubuntourist | PWD=... | 14:10 |
ubuntourist | OLDPWD=... | 14:10 |
ubuntourist | and then this blg long line that starts with "if" | 14:10 |
ubuntourist | I did it with most the second time so that it would be clear that the third "PWD" was on a very long line. | 14:11 |
ubuntourist | Without most, that might be less clear that the third is one very long line. | 14:12 |
ubuntourist | We're going to temporarily improve "man" | 14:12 |
ubuntourist | type | 14:12 |
ubuntourist | export PAGER=most | 14:12 |
ubuntourist | set | grep PAGER | 14:13 |
ubuntourist | We've just created an environment variable named PAGER and set its value to most | 14:14 |
ubuntourist | now try "man grep" | 14:14 |
ubuntourist | Before, "man" was using its own pager. But, "man" checks to see if there is an environment variable named "PAGER" and if there is, | 14:15 |
ubuntourist | it uses the value of it for its pager instead of using its default built-in pager. | 14:15 |
ubuntourist | Now you get color, and left-right scrolling, and a lot of other things that the built-in pager won't give you. | 14:16 |
ubuntourist | (and you get "/" searches, but I think the default pager also does "/" searches.) | 14:17 |
ubuntourist | the "PATTERNS" mentioned at the top of the page are called "regular expression" patterns | 14:18 |
ubuntourist | search for "regular expressions" (no quotes) | 14:18 |
ubuntourist | OK, it found the first occurance. Now just type "/" then enter, and it will find the next one. | 14:19 |
ubuntourist | And again. | 14:19 |
ubuntourist | OK stop. | 14:20 |
ubuntourist | See near the bottom of the screen there is a heading "REGULAR EXPRESSIONS". | 14:20 |
ubuntourist | That is the part of the man page for grep that explains what they are and how they work. | 14:21 |
ubuntourist | (It's a VERY complicated topic, So we're not going to talk about that today.) | 14:21 |
ubuntourist | Today is more about setting environment variables, seeing the effect, and being able to search for the values of environment | 14:22 |
ubuntourist | variables using "set | most" with the "/" and "set | grep HOME" (or "set | grep PWD" or "set | grep ...some other variable..." | 14:23 |
ubuntourist | q to quit. | 14:23 |
ubuntourist | If you logged out or closed the terminal window or rebooted, bash will forget that you've created the PAGER variable, and | 14:24 |
ubuntourist | "man" will go back to its old built-in pager. | 14:25 |
ubuntourist | (There are other programs besides "man" that use a pager and will check to see if you have overridden the default pager by choosing your own.) | 14:25 |
ubuntourist | But, we can make it permanent. | 14:26 |
ubuntourist | I'm hoping you are already comfortable with nano or vim. (I don't know vim well. I use emacs as my editor..) | 14:26 |
mulbah | yeah we have small idea on vim | 14:27 |
ubuntourist | Which editor do you you use and can you work quickly with it in case the connection drops? | 14:27 |
mulbah | but we are using VS code editor | 14:27 |
tboimah | nano vim and VS code | 14:28 |
ubuntourist | OK, whichever one you feel best at / most comfortable with. | 14:28 |
ubuntourist | Edit the file ".profile" (The filename starts with a period.) | 14:29 |
mulbah | I think it will be okay if we used Vim | 14:29 |
ubuntourist | If you use vim or nano I can see what you're doing. If you use VS I won't be able to watch. | 14:29 |
ubuntourist | So you can use nano for now. Or install vim. | 14:30 |
tboimah | okay | 14:30 |
ubuntourist | We sometimes fight "editor wars" 😉 where the emacs users and the vim users argue about which editor is better. | 14:32 |
mulbah | me I think vim is better | 14:33 |
ubuntourist | https://en.wikipedia.org/wiki/Editor_war | 14:33 |
*** ubuntourist has left #novawebdev (Leaving) | 14:33 | |
ubuntourist | Oops. That was my mistake: I clicked the wrong "close" button and closed IRC accidentally. | 14:35 |
mulbah | okay | 14:35 |
mulbah | we understand | 14:35 |
ubuntourist | Anyway, you vim users are my enemy. 😉 | 14:36 |
ubuntourist | I lost the ssh connection, but instead of continuing to get dropped, I will just tell you what to do, and then connect and check. | 14:36 |
ubuntourist | add two lines to the end of the .profile file: | 14:37 |
ubuntourist | # 2023.06.26 - Change the standard pager to "most" | 14:37 |
ubuntourist | export PAGER=most | 14:38 |
ubuntourist | (then save the file and quit after those two lines above.) | 14:38 |
ubuntourist | I can see what your 're doing. DON'T SAVE. Just quit. | 14:40 |
ubuntourist | We're switching to nano because, it's not a mess to work with. This is why I hate vim. | 14:41 |
ubuntourist | DON'T SAVE, | 14:41 |
ubuntourist | Jyst quit | 14:41 |
ubuntourist | We don't want to mess the file up. | 14:41 |
tboimah | okay | 14:42 |
ubuntourist | Let's make a copy first. | 14:42 |
mulbah | done | 14:42 |
ubuntourist | cp .profile .profile.save | 14:42 |
mulbah | a copy of .profile | 14:42 |
ubuntourist | now "nano .profile" | 14:43 |
mulbah | done | 14:43 |
ubuntourist | Down to the bottom. | 14:44 |
ubuntourist | And the two lines from above: | 14:44 |
ubuntourist | # 2023.06.26 - Change default pager to "most" | 14:45 |
ubuntourist | export PAGER=most | 14:45 |
tboimah | what did you mean by the two line from above | 14:45 |
ubuntourist | AT the bottom! | 14:45 |
ubuntourist | You were already at the bottom. DON'T go up. Don't change anything else | 14:46 |
ubuntourist | And add a blank line before the "#" line to make it look better. | 14:47 |
ubuntourist | Before. Not after. | 14:47 |
mulbah | done | 14:48 |
ubuntourist | It looks weird on my screen but I'm going to guess it's okay. | 14:48 |
ubuntourist | Ctrl-X to exit and type "y" when it asks if you want to save. | 14:49 |
ubuntourist | Enter again. | 14:49 |
mulbah | should i save it | 14:49 |
ubuntourist | Yes | 14:49 |
ubuntourist | most .profile | 14:49 |
ubuntourist | Later you can take out the empty line after the #. But it's good enough for now. | 14:50 |
ubuntourist | The first line is a comment It is ignored, but if you look at the file later, you will see that comment and know when you changed it. | 14:51 |
ubuntourist | (When I make changes I usually include my initials as well.) | 14:52 |
ubuntourist | So, when you are both doing systems administration on the same computer, it will be helpful to know WHICH one of you | 14:52 |
ubuntourist | made a change, and which day you changed it. | 14:52 |
ubuntourist | For me, I would normally have the comment: | 14:53 |
ubuntourist | # 2023.06.26 KJC - Change default pager to "most" | 14:53 |
ubuntourist | And sometimes I repeat that comment at the top of the file, so that I have several lines together, each one with a date and my initials. | 14:54 |
ubuntourist | That way I can see the history of entire file. | 14:54 |
ubuntourist | Every time you open the terminal, ".profile" is read automatically. | 14:54 |
ubuntourist | It is where you can change or add environment variables. | 14:55 |
ubuntourist | NOW when you reboot, or logout or close and open the terminal window, PAGER will always be set. | 14:55 |
ubuntourist | You've made the environment variable permanent. | 14:56 |
ubuntourist | (If you don't like it, you can just go back to .profile, and delete the two lines. Or maybe you'l find an even better pager, and you can set PAGER to a new value.) | 14:56 |
ubuntourist | But, I mentioned that Linux is a multi-useer system. We have changed tha pager for the user named "sysadmin" | 14:57 |
ubuntourist | But if there were other users, they would not have a PAGER variable, and "man" -- and other programs -- would stay with their default behavior. | 14:58 |
ubuntourist | We'll experiment a little more with environment variables and expansion stuff in chapter 7, and we'll talk about | 14:59 |
ubuntourist | how to make PAGER affect ALL users on a system using files in the /etc/ directory. | 15:00 |
ubuntourist | But that's enough for today. You now have a "permanent" better pager. Yay! 😉 | 15:00 |
ubuntourist | Tiem for me to go do other things. | 15:00 |
mulbah | Okay | 15:00 |
tboimah | okay thanks for today | 15:01 |
mulbah | Thanks for the day Mr. Cole | 15:01 |
mulbah | you really make my day fine | 15:01 |
tboimah | hava a nice day | 15:01 |
mulbah | bye | 15:01 |
mulbah | ACTION singing out for the day | 15:02 |
ubuntourist | Play around with "set | grep" and "set| most". Start thinking about what some of those variables are for. | 15:02 |
ubuntourist | Bye for now. | 15:02 |
mulbah | okay | 15:02 |
*** tboimah has quit (Ping timeout: 480 seconds) | 15:10 | |
*** mulbah has quit (Ping timeout: 480 seconds) | 15:10 | |
*** ubuntourist has quit (Remote host closed the connection) | 15:20 | |
*** shmohamud has quit (Read error: Connection reset by peer) | 16:36 | |
*** shmohamu_ has quit (Ping timeout: 480 seconds) | 16:45 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:13 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:22 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:41 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 18:00 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 18:32 | |
*** shmohamud has quit (Read error: Connection reset by peer) | 18:37 | |
*** shmohamu_ has quit (Ping timeout: 480 seconds) | 18:47 | |
*** shmohamud has quit (Remote host closed the connection) | 18:52 | |
*** shmohamud has quit (Remote host closed the connection) | 19:03 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 19:13 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 20:14 | |
*** shmohamud has quit (Remote host closed the connection) | 20:43 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 20:57 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 21:13 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 21:46 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!