IRC log of #novawebdev for Monday, 2023-06-26

*** 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
MulbahGood morning Mr. Cole12:59
tboimahGood morning ubuntourist12:59
ubuntouristtboimah, Mulbah Hello gents.12:59
MulbahHow are you doing 13:00
tboimahGood and you13:00
Mulbahso what is the goal13:01
Mulbahfor today13:01
ubuntouristI 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
ubuntouristBut other than that, pretty good.13:01
ubuntouristI'm bad at planning goals. 13:02
ubuntouristI'll start with a question: 13:02
ubuntouristWas the explanation of directories helpful and do you have more questions about that?13:03
MulbahYeah it was13:04
Mulbahand also the tile13: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
ubuntouristMulbah, the tile?13:06
Mulbahyeah this ~13:06
ubuntouristOh, "tilde" There's a "d" in it.13:06
MulbahOh thanks for the correction13:07
Mulbahcan we use tmate13:08
ubuntourist(It is pronounced "till-deh"... Well that's my best appproximation of the pronunciation.)13:08
ubuntouristYup. Crank it up and send me the link.13:08
tboimahssh smbeLLzpACV4gD2RXuQSyMXGY@lon1.tmate.io13:08
ubuntouristSo... tboimah are you caught up on environment variables? Mulbah and I worked with $HOME and the general concept of environment variables.13:11
tboimahyeah we did it together13:12
MulbahI explain it to he13:12
ubuntourist(And the tilde ~ which is almost like $HOME.)13:12
Mulbahsuer13:12
ubuntouristOK then. Let's continue a little bit more with that.13:12
ubuntouristThe "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
ubuntouristWe 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
ubuntouristFor example, when you write HTML, the default color of the background is white, and the default color of the text is black.13:16
ubuntouristUsing CSS you can change them but the most common, logical choice is black text on a white background.13:16
ubuntouristWe 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
Mulbahokay13:18
ubuntouristType "set" in the terminal (set followed by ENTER)13:18
tboimahyou will see a lot of python language13:18
ubuntouristAs 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
ubuntouristOops. Something crashed. I've been kicked out of tmate.13:25
mcssguest_yeah13:25
*** Thomas_ has quit (Read error: Connection reset by peer)13:25
*** mcssguest_ has quit (Read error: Connection reset by peer)13:25
ubuntouristI tried using the SSH again and briefly connected to "sysadmin@solidarity" or something like that, but got kicked out again.13:26
ubuntouristTrying a third time...13:26
Thomas_ssh zM5XVzBzmHBf5rnqTh5KBQzHa@lon1.tmate.io13:27
Thomas_ubuntourist please ssh into that link to reconnect on tmate13:28
*** scooper has quit (None)13:28
ubuntouristSo. 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
ubuntouristACTION is waiting for ideas or experiments in the terminal window.13:33
tboimahwhat ideas did you want ubuntourist?13:33
ubuntouristI want to know how you would show the evironment variables but not have them scroll off the screen so fast.13:34
mcssguest_okay13:34
ubuntouristThat's it. 13:35
ubuntourist"most" would be better than "more".13:35
*** fkoikoi has quit (Ping timeout: 480 seconds)13:35
mcssguest_okay13:35
ubuntourist"q" to quit, and try again with "most"13:36
mcssguest_Sir13:36
ubuntouristAs 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
ubuntouristUse your left and right arrows while using the "set | most" and see how you can move left or right on long lines.13:38
ubuntouristOK.13:39
ubuntouristNow, we're gong to search the results. Type "/PWD"13:39
ubuntouristSorry, without quitting.13:40
ubuntouristDo it while still in "set | most"13:40
ubuntouristSo, you are still in the list, but you searched the list for PWD to find what the value of PWD is.13:41
tboimahthe value for pwd is /home/sysadmin13:41
ubuntouristIt 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
ubuntouristPWD stands for "Print Workiing Directory" . It is also a command "pwd" when you are not in "set | most"13:42
tboimahsure13:43
mulbahyeah 13:43
ubuntouristYour "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
tboimahit print the current working directory that you are working in13:44
ubuntouristRight, and Bash keeps track of that by resetting the environment variable.13:45
tboimahit reset the value for pwd to /home/sysadmin/Desktop13:45
ubuntouristAnd see how there is now an "OLDPWD"? You did a "cd" that brought you back to your home directory before trying the set13:46
ubuntouristNow 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
ubuntouristBecause 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
mulbahOkay13:50
ubuntouristAntother 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
ubuntouristAs systems administrators, "find", "grep", "most" and "man" will become some of  your best friends. 13:52
ubuntouristAnd the pipe character "|"13:53
ubuntouristgrep can become very complicated. Really "regular expressions" which is what grep searches for, can be very complicated.13:53
ubuntouristBut we will stick to simple use.13:54
ubuntouristYou see that the man page has syntax highlighting: bold text, and at the bottom of the screen a message.13:55
ubuntouristBy default, man is using a pager. "most" is a better pager.13:55
ubuntouristTry thiis:13:56
ubuntouristset | grep PAGER13:56
ubuntouristOk... 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
ubuntouristACTION waits while people try those two commands.13:58
*** tboimah has quit (Remote host closed the connection)13:58
ubuntouristBother. I thought the connection was more reliable...13:59
mulbahThe network is giving little bit problem today sorry for that14:00
ubuntouristAre you both in the same place? tboimah what was the last text you saw from me.14:00
ubuntouristAre you both in the same place? tboimah what was the last text you saw from me?14:00
tboimahwait for people to try the two command14:00
tboimahthat was the last text14:01
ubuntouristAnd... tmate dropped me... 14:01
tboimahyeah14:01
tboimahssh YV4cbcr4EKSSpbhsFk2wzKVfr@nyc1.tmate.io14:02
tboimahssh that to reconnect please14:02
ubuntouristI'm connected but stuck.14:04
ubuntouristOK. Back again.14:04
ubuntouristNow the two commands that I asked you to type for comparison.14:04
ubuntouristOh, I see you  already tried one of the two: the "set | grep HOME" 14:05
ubuntouristthe 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
ubuntouristI'm not sure how to proceed if every command is interrupted by network drop-out.14:08
mulbahsorry that will not happen again the connection problem have been fax14:08
tboimahI just try the two command did you see it14:08
tboimahssh 3XVesaHkKUShTWNMvHcSzadAx@lon1.tmate.io14:09
ubuntouristtboimah,  I didn't see the "set | grep PWD" but that's okay. 14:09
tboimahcan you please ssh into that link please so that we can proceed 14:09
ubuntouristSo you can see that it found "PWD" three times. 14:10
ubuntouristPWD=... 14:10
ubuntouristOLDPWD=...14:10
ubuntouristand then this blg long line that starts with "if"14:10
ubuntouristI 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
ubuntouristWithout most, that might be less clear that the third is one very long line.14:12
ubuntouristWe're going to temporarily improve "man"14:12
ubuntouristtype14:12
ubuntouristexport PAGER=most14:12
ubuntouristset | grep PAGER14:13
ubuntouristWe've just created an environment variable named PAGER and set its value to most14:14
ubuntouristnow try "man grep"14:14
ubuntouristBefore, "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
ubuntouristit uses the value of it for its pager instead of using its default built-in pager.14:15
ubuntouristNow 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
ubuntouristthe "PATTERNS" mentioned at the top of the page are called "regular expression" patterns14:18
ubuntouristsearch for "regular expressions" (no quotes)14:18
ubuntouristOK, it found the first occurance. Now just type "/" then enter, and it will find the next one.14:19
ubuntouristAnd again.14:19
ubuntouristOK stop.14:20
ubuntouristSee near the bottom of the screen there is a heading "REGULAR EXPRESSIONS".14:20
ubuntouristThat 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
ubuntouristToday is more about setting environment variables, seeing the effect, and being able to search for the values of environment 14:22
ubuntouristvariables using "set | most" with the "/" and "set | grep HOME" (or "set | grep PWD"  or "set | grep ...some other variable..."14:23
ubuntouristq to quit.14:23
ubuntouristIf you logged out or closed the terminal window or rebooted, bash will forget that you've created the PAGER variable, and14: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
ubuntouristBut, we can make it permanent.14:26
ubuntouristI'm hoping you are already comfortable with nano or vim. (I don't know vim well. I use emacs as my editor..)14:26
mulbahyeah we have small idea on vim14:27
ubuntouristWhich editor do you you use and can you work quickly with it in case the connection drops?14:27
mulbahbut we are using VS code editor14:27
tboimahnano vim and VS code14:28
ubuntouristOK, whichever one you feel best at / most comfortable with.14:28
ubuntouristEdit the file ".profile" (The filename starts with a period.)14:29
mulbahI think it will be okay if we used Vim14:29
ubuntouristIf 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
ubuntouristSo you can use nano for now. Or install vim.14:30
tboimahokay14:30
ubuntouristWe sometimes fight "editor wars" 😉 where the emacs users and the vim users argue about which editor is better.14:32
mulbahme I think vim is better14:33
ubuntouristhttps://en.wikipedia.org/wiki/Editor_war14:33
*** ubuntourist has left #novawebdev (Leaving)14:33
ubuntouristOops. That was my mistake: I clicked the wrong "close" button and closed IRC accidentally.14:35
mulbahokay14:35
mulbahwe understand14:35
ubuntouristAnyway, you vim users are my enemy. 😉14:36
ubuntouristI 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
ubuntouristadd two lines to the end of the .profile file:14:37
ubuntourist# 2023.06.26 - Change the standard pager to "most"14:37
ubuntouristexport PAGER=most14:38
ubuntourist(then save the file and quit after those two lines above.)14:38
ubuntouristI can see what your 're doing. DON'T SAVE. Just quit.14:40
ubuntouristWe're switching to nano because, it's not a mess to work with. This is why I hate vim.14:41
ubuntouristDON'T SAVE,14:41
ubuntouristJyst quit14:41
ubuntouristWe don't want to mess the file up.14:41
tboimahokay14:42
ubuntouristLet's make a copy first.14:42
mulbahdone14:42
ubuntouristcp .profile .profile.save14:42
mulbaha copy of .profile14:42
ubuntouristnow "nano .profile"14:43
mulbahdone14:43
ubuntouristDown to the bottom.14:44
ubuntouristAnd the two lines from above:14:44
ubuntourist# 2023.06.26 - Change default pager to "most"14:45
ubuntouristexport PAGER=most14:45
tboimahwhat did you mean by the two line from above14:45
ubuntouristAT the bottom!14:45
ubuntouristYou were already at the bottom. DON'T go up. Don't change anything else14:46
ubuntouristAnd add a blank line before the "#" line to make it look better.14:47
ubuntouristBefore. Not after.14:47
mulbahdone14:48
ubuntouristIt looks weird on my screen but I'm going to guess it's okay.14:48
ubuntouristCtrl-X to exit and type "y" when it asks if you want to save.14:49
ubuntouristEnter again.14:49
mulbahshould i save it14:49
ubuntouristYes14:49
ubuntouristmost .profile14:49
ubuntouristLater you can take out the empty line after the #. But it's good enough for now.14:50
ubuntouristThe 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
ubuntouristSo, when you are both doing systems administration on the same computer, it will be helpful to know WHICH one of you 14:52
ubuntouristmade a change, and which day you changed it.14:52
ubuntouristFor me, I would normally have the comment:14:53
ubuntourist# 2023.06.26 KJC - Change default pager to "most"14:53
ubuntouristAnd 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
ubuntouristThat way I can see the history of entire file.14:54
ubuntouristEvery time you open the terminal, ".profile" is read automatically.14:54
ubuntouristIt is where you can change or add environment variables.14:55
ubuntouristNOW when you reboot, or logout or close and open the terminal window, PAGER will always be set.14:55
ubuntouristYou'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
ubuntouristBut, I mentioned that Linux is a multi-useer system. We have changed tha pager for the user named "sysadmin" 14:57
ubuntouristBut 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
ubuntouristWe'll experiment a little more with environment variables and expansion stuff in chapter 7, and we'll talk about14:59
ubuntouristhow to make PAGER affect ALL users on a system using files in the /etc/ directory.15:00
ubuntouristBut that's enough for today. You now have a "permanent" better  pager. Yay! 😉15:00
ubuntouristTiem for me to go do other things.15:00
mulbahOkay 15:00
tboimahokay thanks for today15:01
mulbahThanks for the day Mr. Cole15:01
mulbahyou really make my day fine15:01
tboimahhava a nice day15:01
mulbahbye15:01
mulbahACTION singing out for the day15:02
ubuntouristPlay around with "set | grep"  and "set| most". Start thinking about what some of those variables are for.15:02
ubuntouristBye for now.15:02
mulbahokay15: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/!