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

*** jelkner has quit (Ping timeout: 480 seconds)01:14
*** ledmer_ has quit (Quit: Leaving)01:32
*** ledmer has quit (Read error: Connection reset by peer)04:08
*** jelkner has quit (Ping timeout: 480 seconds)05:35
*** jelkner has quit (Ping timeout: 480 seconds)10:08
*** jelkner has quit (Ping timeout: 480 seconds)10:43
*** jelkner has quit (Ping timeout: 480 seconds)11:16
*** tboimah has quit (Ping timeout: 480 seconds)11:23
*** svaye has quit (Quit: Leaving)11:30
mulbahHello tboimah12:23
tboimahHow are you doing mulbah?12:23
mulbahtrying oo bro yesterday wasn't easy the malaria was really giving me hard time12:25
tboimahI am so sorry for that bro, I wish you speedy recovery12:25
mulbahbut at less I am little bit okay now12:26
mulbahThanks bro for the concern12:26
tboimahThat is Good to hear12:26
*** tboimah has quit (Remote host closed the connection)12:31
tboimahGood morning Mr. Cole13:01
ubuntouristHi tboimah and mulbah 13:01
ubuntouristI13:01
mulbahHi Mr. Cole13:02
ubuntouristI'm "cooling down" from morning exercise. (I used to travel back and forth to work via bicycle, but now that I am no longer employed, I've become lazy and it is making me fat. So, I am trying to force myself to exercise. I still hatte it. I have to get back to finding places to bicycle to regularly.)13:03
ubuntouristSo, how are you both doing?13:03
tboimahFor me I am Good13:04
mulbahI am not feeling too well13:04
mulbahfor the pass four days now malaria have been giving me hard time13:05
mulbahbut I'm trying small small13:05
ubuntouristmulbah, sorry to hear that. According to Jeff that is a very regular problem in the area, and access to good medicine is very limited.13:06
ubuntouristAny questions or thoughts before we continue diving deep into the Bash shell?13:07
tboimahFor me no13:07
tboimahthe only place i got stuck this gone time is when we start the screen sharing, because of the connection13:09
ubuntouristOK. tboimah I got your e-mail summary. 13:09
mulbahI have no question because I haven't been reading this week because of the sickness13:09
ubuntouristI'm re-reading it now because there was something I wanted to clarify, but I forgot what it was... Hold for a second.13:09
tboimahACTION waiting for ubuntourist13:10
ubuntouristmulbah, if you feel confident that you've understood what is in the IRC chat, that will be good enough.13:11
ubuntouristI need to go back to the book and see what topics I want to cover there.13:11
ubuntouristWe will be getting back to that movie with the "for" loop eventually.13:11
ubuntouristtboimah, I just re-read your message. And it is a good summary. I guess the thing I was concerned about was13:13
ubuntouristthe history that you missed in the terminal session.13:13
tboimahyeah13:13
ubuntouristSince we did that on the server, and used my account, I should have a good history file.13:14
ubuntouristI'm looking at my history now, and checking for important details...13:15
ubuntouristI will send the history to you both via e-mail, and re-explain a few things.13:17
tboimahOkay, thanks13:17
mulbahAlright 13:17
ubuntouristOne thing I wanted to talk about was "diff" diff is a tool that compares two files and shows the differences between them.13:18
ubuntouristThis becomes useful for tasks like comparing a user's .profile to the standard basic profile.13:19
ubuntouristIf the user edits and customizes their personal file, it will be different from the starter .profile in /etc/skel/13:20
ubuntouristSuppose the user did something that breaks their setup. Their .profile (or .bashrc)  started out as identical to the /etc/skel/13:21
ubuntouristversion. So, if you can see which parts are "good" (the parts that have not been changed) and which parts13:22
ubuntouristMIGHT be bad (the parts your user added), you have an easier time looking at the two files.13:23
ubuntouristHold a sec again. I need to set up a good example. (I should have ddone it sooner  but it won't take long.)13:24
tboimahACTION waiting on ubuntourist13:25
ubuntouristSorry, that took longer than I thought.13:29
ubuntouristtmate time...13:29
ubuntouristssh eL6UGaPGebtaQa83EmMWE8HJx@lon1.tmate.io13:30
mulbahshould we tmate13:31
ubuntouristmulbah, yes13:31
ubuntouristmulbah, I pasted in the chat above.13:31
ubuntouristI will explain here what is showing in the terminal.13:33
tboimahokay13:33
ubuntouristdiff /etc/skel/.profile .profile13:33
ubuntouristFor preciseness, I probably should have made the second file ~/.profile. I'll do that now.13:34
ubuntouristIf you are going to adjust the screen size, let me know. It messes up the demonstration if the text keeps changing.13:34
mulbahokay Mr. Cole13:35
ubuntouristTo compensate for the smaller screen size I have added "most" to the command. So what I typed is:13:36
ubuntouristdiff /etc/skel/.profile ~/.profile | most13:36
ubuntouristThe first two lines that you see on the screen tell you which two files are being compared.13:37
ubuntouristNotice one line starts with "---" and the other  with "+++"13:38
ubuntouristThis means that if the second file has lines ADDED to it that were not in the original, they will have a "+" sign at the beginning.13:39
ubuntouristIf the second file has lines REMOVED from the original, they will show up with a "-" prefix.13:39
ubuntouristAnd, newer versions of "diff" add even more help, by adding color. So added lines show up in GREEN and deleted lines13:40
ubuntouristshow up in RED.13:40
ubuntouristIf you CHANGE a line, diff interprets it as you DELETED a line and then ADDED a line.13:41
ubuntouristLet me quickly do that.13:41
ubuntouristThere. I've made some small changes, and previously, I added lines.13:43
ubuntouristThe first line of the file is in WHITE. That means the line has not changed. Both /etc/skel/.profile and ~/profile start with:13:44
ubuntourist # ~/.profile: executed by the command interpreter for login shells.13:44
ubuntouristBefore I continue, the line in CYAN (a shade of BLUE) is a "location" line and starts with "@@".13:45
ubuntouristTo be honest, I forget how the location lines work. I will try to remember to check. But the idea is that it indicates13:47
ubuntouristwhich lines in both files have been changed. 13:47
mulbahThe    -# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login        │·······-# exists.                                                                      │·······-# see /usr/share/doc/bash/examples/startup-files for examples.                 │·······-# the files are located in the bash-doc package.13:48
ubuntouristIt is telling us that we are looking at the first lines in both files (the "-1" and the +1" 13:49
ubuntouristIt shows that I deleted four lines and then added nine lines. (the RED "-" lines and the GREEN "+" lines.)13:51
ubuntouristOh... Wait... I understand from looking what the @@ ... @@ lines mean:13:52
ubuntouristStarting at the first white line, and going to the last white line, the original file started at line 1 and was 8 lines long. 13:53
ubuntouristThe new file changes start at line 1 and is  13 lines long.13:54
ubuntouristSo, the newer file has five additional lines.13:54
ubuntouristNear the bottom, we see @@ -25,3 +30,8 @@.  13:55
ubuntouristThat means in the original file, starting at line 25, there were 3 lines in the "section" being compared.13:55
ubuntouristin the new file, the matching text starts at line 30, but has 8 lines. So five lines were added.13:56
ubuntouristTake a minute and see if you understand.13:56
ubuntouristLet me know when you  are ready to continue or if you have questions.13:57
ubuntouristACTION will wait to hear BOTH of you confirm you are ready before continuing.13:58
tboimahACTION done13:58
tboimahready to continuing13:59
ubuntouristYou can experiment on your own: Create a file with some text in it. Anything. It could be a short essay, or a Python program, or a poem.13:59
ubuntouristMake a copy of it, and change some words in the copy.13:59
ubuntouristthen use the "diff" command to compare the two files.13:59
ubuntouristACTION waiting for mulbah to confirm understanding...14:00
tboimahACTION please excuse me use the bathroom14:00
mulbahYeah I'm getting the understanding14:01
mulbahof it14:01
ubuntouristOK. Good.14:01
ubuntouristEventually, if Jeff has not already shown it to you, we will do a little work with "git"14:01
ubuntouristgit uses "diff" a lot.14:02
ubuntourist(I don't want to type too much today, since mulbah, you're not feeling well, and tboimah is temporarily away.)14:03
tboimahACTION back14:03
ubuntouristDid either of you play  with "git" when Jeff was teaching you? Probably not, but maybe he mentioned it.14:04
tboimahyeah 14:05
mulbahyeah  14:05
mulbahwith vs code terminal14:05
tboimahi have use git before14:05
ubuntouristSo, git keeps a record of changes to files. It does this by using "diff" and saving the differences.14:06
tboimahto push, merge, clone and etc project14:06
ubuntouristFor example, we recently looked at /etc/lvm/lvm.conf and found that it was over 2300 lines long with all the comments.14:06
ubuntouristIf you changed it 10 times, and every time you changed it you told "git", you do not want git to have ten14:07
ubuntouristcomplete copies. That would be over 23000 lines!14:08
ubuntouristYou PROBABLY only made ten very minor changes where you changed one or two lines each time.14:08
ubuntouristSo the first copy in git would be 2300+ lines, but then the first change would be... maybe14:09
ubuntouristfour lines -- two lines changed, which "git" would store as two lines deleted and two lines added.14:10
ubuntouristThe next change might only be deleting a line. Or adding one.14:10
ubuntouristSo now, after ten changes, "git" will have maybe something like 2,340 lines instead of 23,000 lines for the changes to lvm.conf.14:11
ubuntouristA lot of savings in disk space.14:12
ubuntouristGoing back to the diff in the tmate:14:12
ubuntouristThe lines that start with "This file is not" and "See /usr/share/doc/..." are not very different in both versions.14:14
ubuntouristI simply changed the "word wrap" and capitalized the letter "S".  Very minor changes, just to show you some 14:14
ubuntouristRED "-" lines.14:15
ubuntouristYou can see that the text in the bottom of the green section is the same as the red section.14:15
ubuntouristThe more useful changes are the "Last modified" comment and the "2023.09.22" comment.14:16
ubuntouristWhen I edit a  file -- especially a file that I am not including in a "git" repository -- I try to ALWAYS have14:17
ubuntouristthat type of comment at the start.14:17
ubuntouristI just copied the .profile from my personal computer up to the server to show you what I mean about commenting.14:19
ubuntouristI have a record of all the changes that I made to my copy of the original /etc/skel/.profile that was created when I 14:20
ubuntouristinstalled Linxu on my computer.14:21
ubuntouristNow, on the screen, you can see the original part "This file is not read by..." and "see /usr/share/doc/..."14:22
ubuntouristScrolling down a little more,,,14:22
ubuntouristI like to repeat the comment at the top of the file near the actual change. So14:23
ubuntourist# 2019.12.28 KJC - Switched to systemd path for private bin14:23
ubuntouristin the middle of the screen is the same comment that appeared at the top of the file, but now it is14:24
ubuntouristappearing right where I made the change.14:24
ubuntouristLet's "diff" it with the original... There will be LOTS of differences. Mostly GREEN "+" additions to the original file.14:25
ubuntourist(I made a demo directory, because I do not want to have all of my changes in the "real" ~/.profile.14:26
ubuntouristMany of those changes are for my machine only, because I have packages that are not on the server.14:27
ubuntouristSo the changes effect audio, video, programming languages, editors, and other software not on the server.14:27
ubuntouristSo, you can see by scrolling there is very little RED "-" stuff. Almost everything is an addition to the file not a deletion14:28
ubuntouristor a change.14:28
ubuntouristscroll down to the RED.14:28
ubuntouristToo far. You went past the RED.14:29
ubuntouristGood.14:29
ubuntouristStop.14:29
ubuntouristSo. The white lines are the same as in the system-wide /etc/skel/.profile that everyone starts with.14:30
ubuntouristFrom the RED lines, it I can see that I've changed a lot of the file relating to the PATH environment variable.14:31
ubuntouristFrom the GREEN lines, I can see that most of the changes are 14:31
ubuntouristPATH=...:$PATH14:32
ubuntouristIn Python this is like typing:14:32
ubuntouristmy_story = "...The End."14:33
ubuntouristmy_story = "Once upon a time" + my_story14:33
ubuntouristI am taking the original PATH environment variable -- which, last time we learned is where the operating system14:34
ubuntouristtries to find executable programs -- and I'm adding new locations for the system to look for executable programs.14:35
ubuntouristAre you understanding and remembering what we did last time with PATH?14:35
tboimah+114:35
ubuntouristMost of the changes in the file were adding directories for searching to the PATH environment variable.14:38
ubuntouristThere were other environment variables that I created that are used by other programs.14:38
ubuntouristFor your users (mostly students), you may want to set up environment variables for shared resources.14:39
ubuntouristSeveral weeks ago, we looked at creating directories and files that we could share.14:39
ubuntouristWe set permissions so that other users could change files and create files in our personal directories.14:40
ubuntouristYou could set up directories for each class, and then give permission for students in those classes to14:41
ubuntouristcreate files, or maybe you would have directories that contain documents for students to read -- like the Linux Command Line Book14:41
ubuntouristYou could invent a new  environment variable in /etc/skel/.profile that points to shaared directories. 14:43
ubuntouristFor example, -- DON'T DO THIS ON THE SERVER YET:14:43
ubuntouristsudo mkdir /usr/share/doc/MCSS/14:44
ubuntouristsudo cp Linux_Command_Line_Book.pdf /usr/share/doc/MCSS/14:44
ubuntouristand then add lines to /etc/skel/.profile:14:45
ubuntourist# 2023.09.22 (MK + TM)  - Set up shared student documentation path14:46
ubuntouristMCSS_DOC=/usr/share/doc/MCSS/14:47
ubuntourist,,,14:47
ubuntouristNow, when you create new usernames for each student, you can tell them, "If you want to look at the documents, type14:47
ubuntouristcd $MCSS_DOC14:48
ubuntouristls14:48
ubuntourist...14:48
ubuntouristUnderstand?14:48
ubuntouristYou can try this on your own computers -- NOT THE SERVER YET. 14:49
tboimahokay14:49
ubuntourist(You will need to also create a new user to test it out: The changes you make to the /etc/skel/ files WON'T be copied to your14:50
ubuntouristexisting directory. Those files are only copied when a new user is created. They  do not affect existing users.14:51
ubuntouristmulbah, how about you? Are you understanding okay?14:51
mulbahunderstanding small small but I will e-mail you what I learn and what I don't understand 14:52
ubuntouristmulbah, good. 14:53
mulbahright I just putting less time to the teaching14:53
ubuntouristI am probably not organizing the lessons very  well. I am trying to think about all the things that I do14:53
ubuntouristfrequently, but there is so much to practice. I think maybe for a while, I will give you tasks to do on your computers,14:54
ubuntouristso that you can experiment and bexome more comfortable doing the work instead of reading what I type.14:55
ubuntouristI talk too much, and need to listen and watch more.14:55
ubuntouristI think I will call it "quits" for today.14:56
ubuntouristI will send the history with some explanation in e-mail.14:56
ubuntouristSee you Friday. mulbah, I hope you are feeling better by that time.14:57
tboimahokay thanks for today14:57
mulbahOkay Mr. Cole 14:57
ubuntouristBye!14:57
mulbahThanks for today 14:57
mulbahBye!14:57
tboimahhave a nice day14:57
*** ubuntourist has quit (Quit: Leaving)14:57
*** tboimah has quit (Quit: Leaving)14:57
*** mulbah07_ has quit (None)15:14
*** mulbah has quit (Ping timeout: 480 seconds)15:19
*** Ved has quit (None)18:13
scooper!agenda18:30
LittleWebsterWarning: There are no items on the agenda!18:30
scooper!add The Rural Cooking Project18:31
LittleWebsterSuccess: "The Rural Cooking Project" has been added to the agenda.18:31
scooper!agenda18:31
LittleWebsterThis is the agenda for the next meeting:18:31
LittleWebsterThe Rural Cooking Project (added by scooper)18:31
scooper!add Updates from each group18:32
LittleWebsterSuccess: "Updates from each group" has been added to the agenda.18:32
scooper!add AOB(Any other Business)18:33
LittleWebsterSuccess: "AOB(Any other Business)" has been added to the agenda.18:33
scooper!agenda18:33
LittleWebsterThis is the agenda for the next meeting:18:33
LittleWebsterThe Rural Cooking Project (added by scooper)18:33
LittleWebsterUpdates from each group (added by scooper)18:33
LittleWebsterAOB(Any other Business) (added by scooper)18:33
*** scooper has quit (None)18:33

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