IRC log of #novawebdev for Friday, 2023-09-15

*** tmickelson has quit (Ping timeout: 480 seconds)00:02
*** shmohamud has quit (Remote host closed the connection)00:53
*** shmohamud has quit (Remote host closed the connection)00:56
*** tmickelson has quit (Quit: leaving)01:05
*** shmohamud has quit (Remote host closed the connection)01:20
*** shmohamud has quit (Remote host closed the connection)02:22
scooperGood morning Jeff10:12
scooperI saw your email yesterday that you addressed to the supe.....10:12
scoopersecondly Freena will not be the today10:13
tboimahGood morning Jeff10:49
jelknerwhere in the wrong channel11:00
jelknerlet's meet over in accict11:00
*** scooper has quit (Ping timeout: 480 seconds)11:00
*** jelkner has quit (Quit: Leaving)11:10
*** dcammue has quit (Quit: Leaving)11:11
shmohamudHi Tboimah and Sysadmin11:46
tboimahGood morning shmohamud11:46
shmohamudwhat are you learning these days?11:46
tboimahlinux sysadmin11:47
shmohamudcool cool. Do you have any questions for me? 11:47
tboimahno not now but i will email you if i have any. 11:48
tboimahthanks anyway11:48
shmohamudok11:51
shmohamudsounds good11:51
*** shmohamud has quit (Remote host closed the connection)12:02
*** shmohamud has quit (Remote host closed the connection)12:06
scooperHello Shmohamud12:27
mulbahHello Mr. Cole13:04
ubuntouristHi tboimah hope you're feeling better13:04
ubuntouristHi mulbah 13:04
tboimahGood morning Mr Cole13:04
tboimahYeah Much better them the past days13:04
ubuntouristtboimah, I've just learned that my Irish Flute teacher has come down with COVID. I'm hoping to get the latest vaccine soon, but it will not be available until roughly two weeks from now.13:06
tboimahAhhh okay13:06
mulbahBut we can email you right13:06
ubuntouristtboimah, Monday mulbah and I detoured a bit. 13:07
tboimahYeah i read the log, you too was talking about regex and it sister wildcard13:07
ubuntouristmulbah, I'm not sick. I'm hoping to avoid getting sick. So I am hoping that the newest vaccine will be available soon.13:08
ubuntouristtboimah, ok. if you're feeling "caught up" and don't have questions, I'll continue from the end of Monday's log.13:09
tboimahyeah you can.13:09
ubuntouristI explained to mulbah in e-mail that the reason for Monday's work was that I wanted to find a good example of a system13:10
mulbahokay I pray you shouldn't get sick13:10
ubuntouristconfiguration file that was very large, and filled with comments.13:10
ubuntouristThere is an English expression which you may have read or heard: "He cannot see the forest from the trees"13:11
ubuntouristwhich refers to a situation where there are so many little details that it becomes difficult to recognize the "bigger picture".13:12
ubuntouristBy focusing on every individual tree as a separate, unique object, it can be hard to recognize that the collection of trees are part of a "whole" forest.13:14
ubuntouristSo the goal today:13:14
ubuntouristLook at a HUGE file, and realize that maybe, we can make it "simpler" to see what the file is actually doing.13:15
ubuntouristSo, I think I want to do things a little backwards today.... Hold for one moment.13:15
ubuntouristToday, I'm running the tmate. I want both of you to join me at13:16
ubuntouristssh E96DDEHef7V3Dhx4mgZ22Vzy3@lon1.tmate.io13:16
mulbahssh 3AdYAVvMC23GSDTbPetssFDyQ@lon1.tmate.io13:16
mulbahokay13:16
tboimahokay13:17
tboimahI am connected, can you see me?13:18
ubuntouristI see one extra connection.13:18
ubuntouristOK, looks like you're both here.13:18
ubuntouristSo, on the screen now, you can see Monday's "cd /etc" and the egrep ... | grep ... | sort ...13:20
ubuntouristWe've learned from this that /etc/lvm/lvm.conf has 1961 lines that start with "#".13:22
ubuntouristSo, do either of you remember the command to show how many lines (total) are in a file? (It is a very short command.)13:22
mulbahyeah13:23
mulbahwc -l13:24
ubuntouristmulbah, correct. So, go ahead and see how many lines are in the file we're looking at.13:24
mulbahfor example "most /etc/lvm/lvm.conf | wc -l13:25
ubuntouristNot exactly. No. It's even simpler.13:25
ubuntouristwc -l  lvm/lvm.conf13:26
ubuntourist(We don't need the /etc because we are already "cd /etc"13:26
ubuntouristNope.13:27
ubuntouristThe 1961 is not part of the file name.13:27
ubuntourist1961 is the "answer" to "How many lines start with #?"13:27
ubuntourist1961 lines in the file lvm/lvm.conf start with "#"13:28
ubuntouristAnd the total number of lines in the file is 2302.13:28
ubuntouristSo, out of 2302 lines, 1960 are comments.13:28
ubuntouristThat means that only 341 lines  (2302 -minus 1961)  are actuallyt DOING anything.13:30
ubuntouristThink of your Python programs. If all your lines start with "#" then the "program" does nothing.13:30
ubuntouristSo, looking at the file lvm/lvm.conf, we can see that the comments are designed to instruct a systems13:31
ubuntouristadministrator about how to use this file.13:32
ubuntourist(Don't worry too much about understanding what this file does. It is a list of settings that are used13:32
ubuntouristto control something called the Logical Volume Management (LVM) system. 13:33
ubuntouristThe important idea here is that the comments give you an idea of what the file is for, 13:33
ubuntouristwhere to find more information, and how to  modify the file.13:34
ubuntouristIf you look on the screen now, without scrolling, how many lines are actually doing something?13:35
ubuntourist(How many lines are not comments and not blank?)13:35
tboimah1 line13:35
ubuntouristNope.13:35
mulbahtwo13:36
ubuntouristNope.13:36
tboimahit is three(3) line13:36
ubuntouristYes:13:36
ubuntouristconfig {13:36
ubuntourist          checks = 113:36
ubuntourist            abort_on_errors = 013:37
ubuntouristAbove the "checs = 1" is a description of what the "checks" option setting does.13:37
ubuntouristAbove "abourt_on_errors", again, there is a short explanation of its purpose.13:38
ubuntouristThe entire file is like that: Lots of descriptions of purpose, followed by actual lines that do someting.13:38
jelkner!add Discuss SECOSOL website deployment13:39
LittleWebsterSuccess: "Discuss SECOSOL website deployment" has been added to the agenda.13:39
jelkner!agenda13:39
LittleWebsterThis is the agenda for the next meeting:13:39
LittleWebsterDiscuss SECOSOL website deployment (added by jelkner)13:39
ubuntouristBut that's 2302 lines! It's a LOT to look at.13:39
ubuntouristSo, we're going to cut it down to size and see only the lines that are NOT comments.13:40
ubuntourist(We're also going to eliminate the blank lines from being shown.)13:40
ubuntouristWe're going to use my favorite toy, grep.13:41
ubuntouristReally, we're going to use the fancier "egrep".13:41
ubuntouristSo. we know:13:42
ubuntourist"^" means "at the beginning of a line"13:43
mulbahsure13:43
ubuntourist"[[:space:]]*" meas zero or more spaces or tabs (characters that leave empty space)13:44
ubuntourist"#" is not a special character. So it just means "#" 13:44
ubuntourist".*" means zero or more of... anything. Any character.13:45
ubuntouristAnd finally "$" means "at the end of a line"13:45
ubuntouristWe've also talked about "?" and "+". "?" means zero or one and "+" means one or more.13:47
ubuntouristOK. Think about what you just tried in the command line. Each section between pipes must be a complete command.13:48
ubuntouristTry to explain each part without referring to the other parts, and I think you may see your mistake.13:49
mulbahwho?13:50
ubuntouristWhoever typed in the terminal. (I cannot tell which one of you is typing.13:50
mulbahit's tboimah13:50
ubuntouristOr, whichever one of you wants to try explaining.13:50
mulbahbut I can correct it13:51
ubuntouristtboimah, stop for  a minute. mulbah go ahead.13:51
tboimahokay13:52
ubuntouristSo. Stop mulbah 13:52
ubuntouristAgain, each part of between the pipes must make sense by itself. 13:53
ubuntouristThink about "wc -l" alone, and then egrep egrep "^[[:space:]]*#" alone and finally "lvm/lvm.conf" alone. These do not make sense.13:55
ubuntouristThe first thing on a command line must make sense all by itself. And if you are using a pipe, then 13:55
ubuntouristthat first command must produce output, and the second command after the pipe must accept the output from13:56
ubuntouristthe first command, as input. Then the next pipe is the same: It must accept output from the second13:56
ubuntouristcommand and use it as input to the third command.13:57
ubuntouristAnd you can keep going like that: First command feeds second command feeds third command feeds fourth command, etc.13:57
ubuntouristSo "wc -l" is not a complete command. and "lvm/lvm.conf" is not a command at all -- it is just a file name.13:58
ubuntouristI think maybe I need to slow down...13:59
ubuntouristThe bash error is a little misleading here: It is telling you that you do not have permission to execute "lvm/lvm.conf"14:01
tboimahyeah14:01
ubuntouristas a command. Well, that's for two reasons: First, you are trying to run something in a system-controlled directory and you are not the SuperUser administrator.14:02
ubuntouristBut more important: It's NOT a command, and even with "sudo" it would not run.14:02
ubuntouristIt is a file but it is not a program. It is a file that contains a list of settings and options. It is not an application.14:03
ubuntouristAgan: each part of a pipe must contain an executable command (a program, application, script, or built-in command)14:05
ubuntouristLet me go back to what we're trying to do:14:05
tboimahi think now i got it14:06
ubuntourist"wc -l" doesn't show lines. It shows counts. And we're getting VERY close to the right answer.14:07
ubuntouristStop.14:07
ubuntouristAnalysze the commands that responded 196114:08
ubuntouristStop a minute.14:08
*** mulbah has quit (Ping timeout: 480 seconds)14:09
ubuntouristBefore you continue, explain the line that gave 1961 as a result.14:09
ubuntourist(And I will say that the line with the "most" is even closer to correct, but before continuing, I want one of you to14:11
ubuntouristexplain the line before that one. The one that gave 1961 as a result.)14:11
tboimahThe command is saying that eliminate the blank lines from being shown and also eliminate the comment "#" in the file lvm/lvm.conf14:12
ubuntouristNope.14:13
ubuntouristFirst: Explain what "egrep" is for. Forget about the rest of tle line. forget about "^[[:space:]]*#" lvm/lvm.conf | wc -l14:14
ubuntouristThen explain "^[[:space:]]*#"14:15
ubuntouristThen explain "wc -l"14:15
ubuntouristThree separate explanations. Don't try to put them together yet.14:15
tboimahegrep is a tool that searches for patterns in a specified location14:17
ubuntourist(Or I can try again to break it up and explain it in pieces. And then you can try to put the pieces together.)14:17
ubuntouristACTION waits for an opinion on how to continue...14:18
tboimahokay you can go ahead and explain better14:19
ubuntouristtboimah, Excellent start. (I missed your response at first.)14:19
ubuntouristSo, yes! The first part. exactly right:  egrep a tool that searches for patterns in a specified location14:20
tboimahand ^ in the command mean at the begging14:21
ubuntouristgrep and egrep search files for patterns --- OR they search the output of another command for patterns14:21
tboimah"^[[:space:]]" so the command is saying that at the begging of the line the leave empty space14:22
ubuntouristSo, when you use grep or egrep, you need the command ("grep" or "egrep"), you need a regular expression (regex) pattern,14:22
ubuntouristand you need EITHER a file name at the end OR a pipe at the beginning. The pipe will "feed" the command in the same way as a file would.14:23
ubuntouristgrep and egrep want data from somewhere. If the command before the pipe produces output, then grep or egrep will14:24
ubuntouristread that and use it as the data to search. If there is no pipe, there must be a file for grep or egrep to read and use as data.14:24
ubuntouristAnd the second part "^[[:space:]]*#" is not a command. It is a regular expression (regex) pattern that grep or egrep uses.14:26
ubuntouristThere are MANY other commands, applications, programs, scripts and tools that use regular expression patterns.14:27
ubuntouristWith a little bit of work you can make Python programs work with regular expression patterns.14:27
ubuntouristSo, it's important not to say things like "^ in the command". (Technically, in this case, yes, it's 'part' of 14:29
tboimahokay should i go ahead and explain14:31
ubuntouristthe "egrep" comman line, but it's not part of the command. When you type "nano thomas.txt", thomas.txt isn't 'part' of the "nano" command.)14:31
ubuntouristok...14:31
ubuntouristgo ahead.14:31
tboimah"^[[:space:]]*#" this is saying that at the begging of a line that have empty space and a comment14:32
tboimahand the wc -l is a command that say count the amount of line and print them14:32
tboimahACTION done14:34
jelkner!add Who should represent us at USFWC annual meeting https://info.usworker.coop/civicrm/event/info ?14:34
LittleWebsterSuccess: "Who should represent us at USFWC annual meeting https://info.usworker.coop/civicrm/event/info ?" has been added to the agenda.14:34
jelkner!agenda14:34
LittleWebsterThis is the agenda for the next meeting:14:34
LittleWebsterDiscuss SECOSOL website deployment (added by jelkner)14:34
LittleWebsterWho should represent us at USFWC annual meeting https://info.usworker.coop/civicrm/event/info ? (added by jelkner)14:34
ubuntouristNot bad. But in the computer business (and a lot of other science) precision is everything. So, for number two:14:35
ubuntourist^[[:space:]]*#" is saying at the beginning of a line, ZERO or more empty space followd by a comment character. 14:37
ubuntouristIn other words, we will accept:14:37
ubuntourist#14:37
ubuntourist                              #14:37
ubuntourist       #14:37
ubuntouristbut wie will NOT accept14:38
ubuntouristx = 4      #14:38
ubuntouristmost thomas.txt     #14:38
ubuntouristls -l #14:38
tboimahAhh okay14:39
mulbahMy internet connection trape14:39
mulbahso I did connect14:40
ubuntouristOur pattern says starting at the beginning of the line "^" the ONLY acceptable matches are zero or more spaces "[[:space:]]*" followed by "#".14:40
mulbahso I disconnect14:40
ubuntouristmulbah, I guessed that was the problem.14:40
ubuntouristSo, now  tboimah you've explained the pieces pretty well. Using your three explanations,and understanding what the pipes "|" are for, explain the whole command14:42
ubuntouristegrep "^[[:space:]]*#" lvm/lvm.conf | wc -l14:42
tboimahollay14:42
tboimahokay14:43
ubuntouristWhat did the first command produce as output for the second command?14:43
tboimahthe comman is saying that eliminate any line in the file lvm/lvm.conf that have empty space at the beginning and a comment and print out the amount of line14:47
mulbahno tboimah14:48
ubuntouristNope. Where do you see any indication that the match is eliminated?14:48
mulbahthat isn't what the command is saying14:48
ubuntouristmulbah, 14:48
ubuntouristmulbah, go ahead14:48
tboimahthe command is saying that search any line in the file lvm/lvm.conf that have empty space at the beginning and a comment and print out the amount of line14:49
ubuntouristI wish we had a real, live classroom. ;-) it is hard when both of you are trying to respond, and whoever types the fastest, wins. ;-)14:50
ubuntouristBut yes, tboimah, correct. 14:51
mulbahokay14:51
ubuntouristSo, NOW we actually WANT to eliminate the match. Easy, if you remember which option does that.14:52
tboimahyeah i was not thinking that their is -v in the command14:52
ubuntouristAnd, we don't want to see the number of lines. We want to see the lines.14:52
tboimahno*14:52
ubuntouristtboimah, right again. 14:52
ubuntourist(But we don't want to see the count. We want to see the contents.)14:53
ubuntouristGo ahead in the terminal window.14:53
tboimahyou can only eliminate when you are using -v with the grep or egrep command14:53
ubuntouristJust edit the previous command and add in your fix14:54
ubuntouristYou didn't make the little change to the line to eliminate matches....14:55
ubuntouristI see you've been practicing some of the keyboard shortcuts. Excellent.14:56
ubuntouristBINGO!14:56
tboimahnow it works14:56
*** scooper has quit (Ping timeout: 480 seconds)14:57
ubuntouristWe haven't eliminated the blank lines yet but NOW you are ONLY seeing lines that actually DO work.14:57
ubuntouristAs a systems administrator, you will be faced with problems like "Why is LVM not creating a log file showing me14:58
ubuntouristits activity? I searched for the log file, but could not find it!'14:58
ubuntouristWhen you meet a problem like that, your first thought should be:14:59
ubuntourist"Something is probably wrong with a configuration file somewhere.14:59
ubuntouristSince I am looing for the LVM log file, the configuration for LVM is PROBABLY somewhere in the /etc directories15:00
ubuntouristand PROBABLY has a name that ends with ".conf" or ".config". A good guess would be "lvm.conf"...15:00
ubuntouristlocate lvm.conf15:00
ubuntouristOh, look: There it is /etc/lvm/lvm.conf!15:01
ubuntouristOkay, I found it, but it's HUGE!15:01
ubuntouristLet me see the file without comments.15:01
*** shmohamud has quit (Remote host closed the connection)15:02
ubuntouristOh look: I see that the "syslog" option is set to equal 0, and I suspect that 0 means "false" or "off" or "disabled"15:02
ubuntouristThat's probably why I am not able to find the log: Logging has been disabled!15:03
ubuntouristNow let's look at the whole file with comments to see if my guess is correct....15:03
ubuntourist...15:03
ubuntouristThat'ss the kind of diagnostic thinking that you will be getting a lot of practice with.15:03
tboimahokay15:04
mulbahOkay Mr. Cole15:04
ubuntouristSome files do not use "#" as a comment. For example configuration files that use C++ commenting use "//" to mean "comment"15:05
ubuntouristOthers use ";" instead of "#".15:05
ubuntouristBecause I do this type of thinking about probems ALL THE TIME, I have created an alias to make my life simpler.15:06
ubuntouristalias decomment='egrep -v "^[[:space:]]*((#|;|//).*)?$" '15:06
ubuntouristNow i can "de-comment" with the decomment alias:15:07
ubuntouristdecomment lvm/lvm.conf | most15:07
ubuntourist(And my pattern eliminates the blank lines too.)15:07
tboimahwow! cool15:08
ubuntouristWe can see on the screen now that there is a section called "log" 15:08
tboimah+115:08
ubuntouristwith settings like verbosse, silent, syslog, etc. and they are mostly 0 and 1. So, disabled and enabled.15:09
ubuntouristIf you were wanting the logs to be much larger and more descriptive, you would edit /etc/lvm/lvm.conf, and change "verbose = 0" to "verbose = 1"15:10
ubuntouristenabling it.15:10
ubuntouristBut before finish today, now that I *think* I know how to enable more logging, I can NOW look at the commented version15:11
ubuntouristwith "most" and search for the word "verbose".15:11
ubuntouristNope, that's talking about "checks". "n" to search again...15:12
ubuntouristThere it is: Conviguration option log / verbose: Controls the messages sent to stdout or stderr.15:13
ubuntourist(It's not a great explanation, but it's something. We can see that "silent = 0" has a much longer explanation.)15:14
ubuntouristI'm very proud of my decomment alias, and have shared it with a lot of systems administrators,15:15
ubuntouristbecause it makes the job so much easier..15:15
*** shmohamud has quit (Ping timeout: 480 seconds)15:15
tboimahsure15:15
ubuntouristAnd you can try it on Python code, or anything else that uses "#", ";" or "//" for comments.15:15
ubuntouristMonday, we'll put the "decomment" alias into our .bash_aliases file to make it "permanent".15:16
mulbahAlright15:17
ubuntouristWe looked at a 2302-line file and found out that there are only 96 lines in the file that are actively doing something useful.15:18
ubuntouristmuch easier to look at 96 lines to find out where the trouble is, and THEN search the 2302 lines for that trouble spot.15:19
ubuntourist(That's why we did the work Monday -- I wanted to find a big example with lots and lots of comments.)15:20
ubuntouristYou can see on the list now that there are several files with lots of comments, like /etc/postgresql/13/main/postgresql.conf15:24
ubuntouristwith 623 comment lines.15:25
ubuntouristYou can use the same techniques to see which lines are active...15:25
ubuntouristAnyway, that's all for today!15:25
mulbahAlright Thanks for today Mr. Cole15:26
tboimahOkay thanks for today15:26
tboimahwe really appreciate15:26
mulbahand we promise to practice with the other file15:27
mulbahusing the same techniques15:27
ubuntouristI appreciate the effort you are putting into this. There is a lot to learn, and a lot to remember. So keep good notes for yourselves.15:27
*** ubuntourist has quit (Quit: Leaving)15:27
*** tboimah has quit (Quit: Leaving)15:28
*** shmohamud has quit (Ping timeout: 480 seconds)15:37
*** shmohamud has quit (Remote host closed the connection)15:42
*** mulbah has quit (Ping timeout: 480 seconds)15:43
*** shmohamud has quit (Ping timeout: 480 seconds)16:03
*** mulbah has quit (Ping timeout: 480 seconds)16:12
*** sysadmin_ has quit (Quit: Leaving)16:42
*** shmohamud has quit (Remote host closed the connection)17:29
*** shmohamud has quit (Ping timeout: 480 seconds)17:40
*** mulbah has quit (Ping timeout: 480 seconds)18:02
*** jelkner has quit (Quit: Leaving)18:27
*** shmohamud has quit (Ping timeout: 480 seconds)19:22
*** shmohamud has quit (Remote host closed the connection)20:13
*** shmohamud has quit (Ping timeout: 480 seconds)21:08
*** LittleWebster has joined #novawebdev21:28
fkoikoi!agenda21:57
LittleWebsterThis is the agenda for the next meeting:21:57
LittleWebsterDiscuss SECOSOL website deployment (added by jelkner)21:57
LittleWebsterWho should represent us at USFWC annual meeting https://info.usworker.coop/civicrm/event/info ? (added by jelkner)21:57
fkoikoi!add AOB21:59
LittleWebsterSuccess: "AOB" has been added to the agenda.21:59
*** fkoikoi has quit (Quit: Leaving)22:06
*** shmohamud has quit (Ping timeout: 480 seconds)22:07
*** tmickelson has quit (Ping timeout: 480 seconds)22:39
*** shmohamud has quit (Ping timeout: 480 seconds)22:46
*** shmohamud has quit (Remote host closed the connection)23:37
*** tmickelson has quit (Ping timeout: 480 seconds)23:37

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!