IRC log of #novawebdev for Monday, 2023-09-18

*** shmohamud has quit (Remote host closed the connection)00:36
*** shmohamud has quit (Ping timeout: 480 seconds)01:00
*** shmohamud has quit (Ping timeout: 480 seconds)01:29
*** shmohamud has quit (Remote host closed the connection)01:43
*** shmohamud has quit (Remote host closed the connection)02:05
*** shmohamud has quit (Ping timeout: 480 seconds)02:14
*** tmickelson has quit (Ping timeout: 480 seconds)02:31
*** shmohamud has quit (Ping timeout: 480 seconds)02:35
*** tmickelson has quit (None)02:49
*** shmohamud has quit (Ping timeout: 480 seconds)02:51
*** shmohamud has quit (Remote host closed the connection)04:18
*** shmohamud has quit (Ping timeout: 480 seconds)04:32
*** shmohamud has quit (Ping timeout: 480 seconds)05:45
*** shmohamud has quit (Ping timeout: 480 seconds)08:21
*** shmohamud has quit (Ping timeout: 480 seconds)09:10
*** shmohamud has quit (Ping timeout: 480 seconds)09:32
*** shmohamud has quit (Ping timeout: 480 seconds)09:43
*** scooper has quit (Ping timeout: 480 seconds)11:06
*** fkoikoi has quit (Ping timeout: 480 seconds)11:07
*** jelkner has quit (Quit: Leaving)11:09
*** fkoikoi has quit (Remote host closed the connection)11:12
*** fkoikoi has quit (Remote host closed the connection)11:14
*** shmohamud has quit (Ping timeout: 480 seconds)11:16
shmohamudGood day everyone11:20
fkoikoiGood Morning shmohamud 11:21
shmohamudany questions for me?11:21
fkoikoiwelcome back shmohamud11:23
*** svaye has quit (Quit: Leaving)11:23
shmohamudit's good to be back11:24
fkoikoisure11:24
fkoikoiwill you be here tomorrow11:25
shmohamudI can be, what's going on tomorrow?11:25
*** fkoikoi has quit (Remote host closed the connection)11:25
fkoikoiwill you be here tomorrow?11:27
shmohamudwhat time11:29
fkoikoisame time11:30
sysadmin__Good morning Shmohamud11:32
scooperHello and welcome back Shmohamud11:32
shmohamudscooper! good to see you!11:34
scooperme too??11:34
shmohamudhow are you amd do you have amu questioms for me?11:34
scooperWhat time is right to me with you???11:34
scooperTo many questions I have for you Shmohamud11:35
shmohamudI can meet Monday, Wedensday and Frday at 7:15AM11:35
scooperbut cannot be given right now, I rather do it through github11:35
shmohamudif you email me I can also make time outside of MWF11:36
scooper7:15 your right??11:36
scooperThe major challenge here is setting fix time  to meet you, due to you tight schedule.....11:37
shmohamudyes 7:15 AM Eastern Time US11:38
shmohamudI have been tied up with work and personal stuff but from now on I will meet you at 7:15AM Monday, Wednesday and Fridsy11:39
shmohamudI start work at 8AM so our sessions will be about 45m where you can ask me anything11:39
scooperSahnun11:40
scooperprogramming eat up time11:40
*** fkoikoi has quit (Ping timeout: 480 seconds)11:40
scooperso can we do this after your working time???? so that you done get late for work11:40
shmohamudIf we met after work, I get off at 4:30PM EST11:41
shmohamudwill you have access to computer?11:41
scooperyes11:41
scooperI wake up everyday 3:00 or 4:00am11:41
scooper4:30pm EST will be 8:30pm my time 11:43
scooperI can couple with that11:43
*** shmohamud has quit (Remote host closed the connection)11:44
shmohamudok, so do you want to meet 4:30PM or earlier in the day 7:15AM?11:45
*** shmohamud has quit (Remote host closed the connection)11:47
*** shmohamud has quit (Remote host closed the connection)11:51
*** shmohamud has quit (Remote host closed the connection)11:56
*** shmohamud has quit (Remote host closed the connection)12:04
*** shmohamud has quit (Remote host closed the connection)12:08
*** shmohamud has quit (Remote host closed the connection)12:15
*** scooper has quit (Remote host closed the connection)12:19
*** shmohamud has quit (Remote host closed the connection)12:23
*** shmohamud has quit (Ping timeout: 480 seconds)12:33
tboimahGood morning Mr. Cole13:00
ubuntouristBe with you in just a few seconds. Finishing something else up first...13:01
tboimah_Good morning shmohamud13:03
tboimah_Good day scooper13:03
*** shmohamud has quit (Ping timeout: 480 seconds)13:06
ubuntouristHi. I'm back.13:08
*** tboimah has quit (Ping timeout: 480 seconds)13:08
ubuntouristtboimah, tboimah_, tboimah__ I had a bit of another task to finish up13:09
tboimahOK, I got you13:09
ubuntouristSo. continuing from last time... it took a long time, but we finally got to the "decomment" alias and what it is good for.13:10
ubuntouristI should keep better notes of what we've covered. I think we talked about the ~/.bash_aliases file before.13:11
ubuntouristEvery user has several files that they can customize to make their personal environment more friendly.13:11
ubuntouristThese configuration files are usually specific to each application. For example, you can configure vim to use shortcuts or colors that you define.13:12
*** tboimah_ has quit (Ping timeout: 480 seconds)13:14
ubuntouristSyntax-highlighting in vim (or other editors) lets you quickly see where quotes begin and end, and can highlight special "reserved" words for various programming languages.13:14
ubuntouristWhen you start up a terminal window, your user configuration is set up to start a "shell" application that prompts you to enter commands.13:16
ubuntouristFor most users, this is Bash, which is what your book on the Linux Command Line uses. There are other shells, but Bash is a pretty good one, and very common.13:16
ubuntouristBash is an application program, and it has its own configuration files. The three importaant ones are ~/.profile, ~/.bashrc and ~/.bash_aliases.13:17
ubuntouristThe first two are standard. The last is optional, but very useful to have.13:18
*** tboimah has quit (Read error: Connection reset by peer)13:18
ubuntouristYour network seems really bad today...13:19
ubuntouristI'll give you a second or two to catch up.13:20
tboimah_I am following13:20
ubuntouristEach time a systems administrator adds a new user to the computer, the operating system copies a very basic, standard version of .bashrc and .profile13:22
ubuntouristto the new user's directory.13:23
ubuntouristHold a sec. I want to check something.13:23
ubuntouristBack again. There are a few other configuration files I'll mention in a bit.13:26
*** tboimah has quit (Ping timeout: 480 seconds)13:26
ubuntouristBut, the basic "starter" .bashrc and .profile files are kept in /etc/skel13:27
ubuntouristIn fact, anything that a systems administrator puts in /etc/skel will be copied to new user's home directories13:28
ubuntouristwhen the new user is added to the system.13:29
ubuntouristSo, if you and mulbah decide that all users should have certain features enabled, or text file that says "Welcome, New Students,13:30
ubuntouristPlease read this before continuing." you could alter files or add files to /etc/skel.13:31
ubuntouristBut, BE CAREFUL!  Make backup copies of all the files. If you break them, then you've broken things for ALL new users.13:32
*** tboimah_ has quit (Ping timeout: 480 seconds)13:32
tboimahokay13:32
ubuntouristSo, for now, we're not going to play with those files. We're just going to edit your personal copies to change your environment.13:33
ubuntouristBefore I forget, there's one other file used that sets up new directories for every user.13:34
mulbahGood morning Mr. Cole I'm sorry I am late my computer was giving me hard time to come on that why13:34
ubuntouristUnfortunately, this file can have different names, depending upon which "distribution" of Linux you are using.13:34
ubuntouristI like to say that a  "distribution"  is like a "flavor" of ice cream,13:36
*** scooper has quit (Ping timeout: 480 seconds)13:36
ubuntouristAll ice cream starts out the same way, but ingredients are added to the basic formula to change the taste.13:37
ubuntouristFor Linux, different groups have decided to add or change basic features and applications.13:38
ubuntouristI am not sure which distribution you are you are usiing. Probably Ubuntu. Let's find out. Type:13:39
ubuntouristlsb_release -a13:39
ubuntouristin a terminal window.13:39
ubuntouristAnd tell me what it says. 13:39
tboimahNo LSB modules are available.13:40
tboimahDistributor ID:Ubuntu13:40
tboimahDescription:Ubuntu 22.04.1 LTS13:40
tboimahRelease:22.0413:40
tboimahCodename:jammy13:40
*** mulbah has quit (Read error: Connection reset by peer)13:41
ubuntouristOK. I guessed right: Ubuntu. The April 2022 release, with Long Term Support (22.04 LTS)13:41
ubuntouristLTS - Long Term Support - means that there will be no MAJOR changes to the packages installed with apt.13:42
ubuntouristuntil April 2024.13:42
ubuntouristThe non-LTS releases make major changes every six months instead of every two years.13:43
ubuntouristEach distribution is created by a team of people who decide which packages to include automatically, and which to13:45
ubuntouristignore. Also, what fonts should be included, what colors to use, what the background picture on your desktop is,13:45
ubuntouristand what program to use to install new packages.13:46
ubuntouristUbuntu is a descendant of Debian. It uses the Debian Package Manager (dpkg) and the Advanced Package Tool (apt).13:47
ubuntouristIt uses the Gnome desktop -- the "desktop" determines how your GUI (graphic user interface) appears: Which fonts, which icons, which colors, which images, etc.13:48
ubuntouristHold a sec...13:49
ubuntouristAh. Found what I was looking for: The file that sets up users' default directories:13:52
ubuntouristFor Ubuntu it's /etc/xdg/user-dirs.defaults13:52
ubuntouristWhen a new user is created, they get a directory /home/username -- /home/mulbah, /home/tboimah, or whatever.13:53
ubuntouristBut, when you login for the first time, you  will see that you already have /home/mulbah/Documents, and /home/tboima/Downloads13:54
ubuntouristetc. Desktop, Downloads, Documents, Music, Pictures, Videos, Templates, Publich, etc are standard13:55
ubuntouristdirectories on Ubuntu systems.13:55
ubuntouristtype:13:55
ubuntouristmost /etc/xdg/user-dirs.defaults13:55
mulbah07_done13:56
ubuntourist(Notice there are some comments in there that we could hide using what we learned on Friday.13:57
ubuntouristBut it's a small file, not 2300+ lines. So it is pretty easy to read without hiding the comments.)13:57
ubuntouristMaybe, your school will not want students to have a Videos directory. As a systems administrator, you can13:59
ubuntouristadd a comment "#" character to the start of the VIDEOS line. Then when you create new users, they will not have14:00
ubuntourista ~/Videos directory automatically. (They can still type "mkdir ~/Videos" and create their own, but it will not be14:00
ubuntouristcreated for them automatically.)14:01
ubuntouristBut back to the other two files: ~/.bashrc, and ~/.profile.14:01
ubuntourist~/.profile is mostly where environment variables are kept.  We've talked about how14:02
ubuntourist"man bash" or "man vim" looks better with a bit of color: Normally, the "man" command uses its own "pager"14:03
ubuntouristto display one screen at a time. But, by changing the environment variable PAGER to "most", programs like "man"14:04
ubuntouristsee that and say "Oh! You want me to override my default behaviour and use the pager that you have specified, instead14:04
ubuntouristof my own."14:04
ubuntouristI guess we will try tmate, because the connection seems to be stabilizing...14:05
ubuntouristI think I'll start it again, and you both join mine.14:06
ubuntouristssh LL4BceC4E4H6yZWzFJdeqjHN6@lon1.tmate.io14:06
ubuntouristAre you both on? I see mulbah14:07
ubuntouristOK.14:08
ubuntouristThis is the system-wide, default .profile that all users get when they get a new account.14:09
ubuntouristWe can see there's lots of comments with good information, including a reference to more information.14:10
ubuntourist"See /usr/share/doc/bash/examples/startup-files for examples"14:10
ubuntouristBut, it says that the examples are part of the bash-doc package, which MIGHT not be installed... We'll see...14:11
ubuntouristNo such file or directory...14:12
*** tboimah has quit (Ping timeout: 480 seconds)14:12
ubuntouristNo results found from searching dpkg for "bash-doc"14:12
ubuntouristOkay... there is a package with that name, but it is not installed...14:13
ubuntouristOops. the details scrolled off the top of the screen...14:14
ubuntourist(If you are dropping in and out, you're missing a lot of what's happening in the terminal. I was writing comments here14:15
ubuntouristbased on what was happening in the tmate session...)14:15
ubuntouristSo, apt-cache show bash-doc | most is now displaying information about the package. I usuallly find the description14:17
ubuntouristsection to be the most useful.14:17
ubuntouristAlso, the Installed-size. If the package is HUGE, you might want to think twice about installing it.14:18
ubuntouristYou do not want to eat up all your disk space.14:18
*** tboimah_ has quit (Ping timeout: 480 seconds)14:19
ubuntouristYou can install bash-doc on your own computers first. Later, maybe put it on the server.14:20
ubuntouristFor now let's look at the /etc/skel/profile without comments.14:20
ubuntouristI already have my "decomment" alias set up. So I do not need to type the complicated grep.14:20
ubuntouristWow! Again, without the comments, much smaller!14:22
*** tboimah has quit (Read error: No route to host)14:23
ubuntouristWhat it tells us: If there is an environment variable named BASH_VERSION, then check if there is a file named ~/.bashrc.14:24
ubuntouristif there is both (an environment variable named BASH_VERSION and a file named ~/.bashrc) interpret the contents of the14:25
ubuntourist~/.bashrc file as a script full of Bash commands.14:25
ubuntouristThen... if there is a directory named ~/bin" change the envornment variable PATH so that ~/bin is included in it.14:26
ubuntourist(If we wanted to do somethng a little bit like this in Python it would be something like:14:27
ubuntouristdirectories = [..., ..., ...]     # We don't know what is in the list.14:28
ubuntouristif "~/bin" in directories:14:28
ubuntourist      path = "~/bin" + path14:29
mulbahlet say mulbah tboimah and kjcole is in the list14:29
ubuntouristmulbah, nope, because we're looking at the list of directories that mulbah or tboimah or kjcole owns.14:30
mulbahalright14:30
ubuntourist(I'm using "~" wihch is a synonym / abbreviation for "$HOME" which is an environment variable for "/home/Your_Usermame".)14:31
ubuntouristSo when I login, it runs MY ~/.profile. That means everywhere that $HOME appears, it means "/home/kjcole"14:32
ubuntouristBut for you, it will mean "/home/mulbah" (or /home/mkolleh ... one of those should probably go away.)14:33
ubuntouristFinally, it says14:34
ubuntouristif there is a directory named ~/.local/bin` change the PATH environment variable to include ~/.local/bin at the start.14:35
ubuntouristAlmost the same thing as before.14:35
ubuntouristSo it's really  doing only three things: Run the .bashrc file if it exists, and add ~/bin and ~/.local/bin to the PATH environment14:36
ubuntouristvariable if those directories exist.14:36
ubuntouristSo... PATH is an environment variable. We can see what it contains.14:37
ubuntouristtype "set PATH"14:37
ubuntouristOops. wait.14:37
mulbahon my terminal14:37
ubuntouristDon't.14:37
mulbahor yours14:37
ubuntouristMy mistake.14:37
ubuntouristtype (in the tmate terminal):14:38
ubuntouristprintenv PATH14:38
ubuntouristOK. the PATH variable does NOT contain either "/home/kjcole/bin" or "/home/kjcole/.local/bin".14:40
ubuntouristThat means both "if" statements failed to find the directories.14:40
ubuntouristUnderstand? When I logged in, it searched for the two directories with the if statements in the .profile file, and because14:42
ubuntouristboth "if" statements resulted in "False", it did not do either of the PATH= commands.14:43
ubuntouristOh, one more thing. The people who wrote the Bash application have a strange sense of humor which makes things confusing.14:44
ubuntouristIn Python, you indicate a block by indenting. When the indenting stops, it means the block is finished.14:44
ubuntouristIn C, blocks are enclosed in { and }.14:45
ubuntouristIn Bash, SOME blocks start with "do" and end with "done". But the stupid, silly, confusing humor is that some blocks14:45
ubuntouriststart with a word and end with the same word spelled backwards.14:46
ubuntouristSo an "if" block ends with "fi"14:46
ubuntouristThere is something called a "case" block. And it ends with "esac".  Hard for new users. I wish they would use14:47
ubuntouristendif and endcase (or end_if and end_case) instead.14:48
ubuntouristFollowing okay?14:48
tboimahyeah14:49
mulbahyeah14:49
mulbahfollowing14:49
ubuntouristThe PATH environment varialbe tells the operating system where to look for programs. Right now, my PATH says14:50
ubuntourist"if something is type at the command prompt that is not built into Bash, look for an application with that name.14:51
ubuntouristFirst, search /usr/local/bin. If you do not find it in /usr/local/bin, search /usr/bin. If it's not there, try /bin. Then try /usr/local/games, and finally, /usr/games.14:52
ubuntouristIf you did not find it in any of them,  print "command not found".14:52
ubuntouristThe .profile changes that behavior if it can: It says  "If the user has created a directory named "~/.local/bin" search THERE first.14:54
ubuntouristIf the user has created a directory named ~/bin, search there next. THEN if it can't find the program in either of those two14:55
ubuntouristnow start searcing /usr/local/bin, /usr/bin/, /bin ...14:55
ubuntouristYou can see from my "ls -A" commands: ~/.local exists, but ~/bin and ~/.local/bin do not. That is why the two "if" did not change the PATH.14:57
ubuntouristLet's fix that... In a few steps.14:58
ubuntouristWe've made the directory, but .profile only runs when you login. So the PATH is still not changed.14:58
ubuntouristI have made a very simple, executable program. But...15:01
ubuntouristIt is not found.15:01
ubuntouristNORMALLY .profile is only run when you login. But I don't want to logout break the tmate connection and then login and wait for15:02
ubuntouristyou to join.15:02
ubuntouristSo I can FORCE .profile to be run early.15:02
ubuntouristNotice the change?15:03
mulbahyeah15:04
ubuntouristSo, explain what you've learned today, either quickly or send me e-mail (not Zulip, unless you really cannot use e-mail.)15:05
mulbahI will e-mail you15:06
tboimah_okay i will email you 15:06
ubuntouristOK. What I am slowly working towards is... we will be modifying .profile, adding an environment varaible to make it prefer "most" and use it when it can, 15:08
*** tboimah has quit (Ping timeout: 480 seconds)15:09
ubuntouristThen we will look at .bashrc which -- if you look on the screen, that is the first thing .profile looks for. 15:09
ubuntourist(If it finds a file named .bashrc it uses the caommands in that file.)15:10
ubuntouristAnd, in .bashrc -- which we will probably look at next time, there is a section that says "If there is a file named .bash_aliases"15:11
ubuntouristread the aliases from there and set those up as handy shortcuts. So, we will create a .bash_aliases file and put15:11
ubuntouristthe alias for the long, hard to remember "egrep" command in there, so that we have an easy way to look at 15:12
ubuntouristfiles while hiding the comments.15:12
ubuntouristFinally, we'll set the system up so that new users will not need to modify .profile, or .bashrc or create .bash_aliases file. We will make15:13
ubuntouristthe operating system do the work for them.15:14
*** mulbah has quit (Ping timeout: 480 seconds)15:15
ubuntourist(We'll do that on YOUR computers, not the server: You're not systems administrators yet. ;-) But, maybe you can 15:15
ubuntouristtalk to your systems administrator and see if he or she thinks any of these changes are a good idea...15:15
ubuntouristWait until we've finished doing all of that on your personal computers first.)15:16
ubuntouristBye for now...15:16
tboimahokay bye thanks for today15:16
mulbahOkay15:17
mulbahThanks for the day Mr. Cole15:17
mulbahI will e-mail you and explain good what I learn today15:18
ubuntouristOh. One more thing.15:18
mulbahyes15:18
ubuntouristWe will also be looking at the "diff" command15:18
mulbahalright15:18
ubuntouristWhen two files are almost the same, but have a few differences, "diff" can show us the changes.15:18
ubuntouristWe will be comparing our new .profile and .bashrc to the originals in /etc/skel/15:19
ubuntouristYou can look on your computers at your personal ~/.bashrc and ~/.profile and /etc/skel/.bashrc and /etc/skel/.profile15:20
ubuntouristBye again!15:20
mulbahbye15:20
*** ubuntourist has quit (Quit: Leaving)15:20
*** tboimah has quit (Quit: Leaving)15:21
*** mulbah has quit (Quit: Leaving)16:06
*** sysadmin_ has quit (Remote host closed the connection)16:23
*** klarios has quit (Remote host closed the connection)17:11
*** sysadmin_ has quit (Quit: Leaving)17:14
klarioshttps://share.mayfirst.org/s/qzitgs9Dt5cd8bg21:27
jelknerhttps://share.mayfirst.org/s/Z5LL6TaMg7EGEtK21:28
*** jelkner has quit (None)21:29
*** klarios has quit (Quit: Page closed)21:57

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