*** 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 | |
shmohamud | Good day everyone | 11:20 |
---|---|---|
fkoikoi | Good Morning shmohamud | 11:21 |
shmohamud | any questions for me? | 11:21 |
fkoikoi | welcome back shmohamud | 11:23 |
*** svaye has quit (Quit: Leaving) | 11:23 | |
shmohamud | it's good to be back | 11:24 |
fkoikoi | sure | 11:24 |
fkoikoi | will you be here tomorrow | 11:25 |
shmohamud | I can be, what's going on tomorrow? | 11:25 |
*** fkoikoi has quit (Remote host closed the connection) | 11:25 | |
fkoikoi | will you be here tomorrow? | 11:27 |
shmohamud | what time | 11:29 |
fkoikoi | same time | 11:30 |
sysadmin__ | Good morning Shmohamud | 11:32 |
scooper | Hello and welcome back Shmohamud | 11:32 |
shmohamud | scooper! good to see you! | 11:34 |
scooper | me too?? | 11:34 |
shmohamud | how are you amd do you have amu questioms for me? | 11:34 |
scooper | What time is right to me with you??? | 11:34 |
scooper | To many questions I have for you Shmohamud | 11:35 |
shmohamud | I can meet Monday, Wedensday and Frday at 7:15AM | 11:35 |
scooper | but cannot be given right now, I rather do it through github | 11:35 |
shmohamud | if you email me I can also make time outside of MWF | 11:36 |
scooper | 7:15 your right?? | 11:36 |
scooper | The major challenge here is setting fix time to meet you, due to you tight schedule..... | 11:37 |
shmohamud | yes 7:15 AM Eastern Time US | 11:38 |
shmohamud | I have been tied up with work and personal stuff but from now on I will meet you at 7:15AM Monday, Wednesday and Fridsy | 11:39 |
shmohamud | I start work at 8AM so our sessions will be about 45m where you can ask me anything | 11:39 |
scooper | Sahnun | 11:40 |
scooper | programming eat up time | 11:40 |
*** fkoikoi has quit (Ping timeout: 480 seconds) | 11:40 | |
scooper | so can we do this after your working time???? so that you done get late for work | 11:40 |
shmohamud | If we met after work, I get off at 4:30PM EST | 11:41 |
shmohamud | will you have access to computer? | 11:41 |
scooper | yes | 11:41 |
scooper | I wake up everyday 3:00 or 4:00am | 11:41 |
scooper | 4:30pm EST will be 8:30pm my time | 11:43 |
scooper | I can couple with that | 11:43 |
*** shmohamud has quit (Remote host closed the connection) | 11:44 | |
shmohamud | ok, 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 | |
tboimah | Good morning Mr. Cole | 13:00 |
ubuntourist | Be with you in just a few seconds. Finishing something else up first... | 13:01 |
tboimah_ | Good morning shmohamud | 13:03 |
tboimah_ | Good day scooper | 13:03 |
*** shmohamud has quit (Ping timeout: 480 seconds) | 13:06 | |
ubuntourist | Hi. I'm back. | 13:08 |
*** tboimah has quit (Ping timeout: 480 seconds) | 13:08 | |
ubuntourist | tboimah, tboimah_, tboimah__ I had a bit of another task to finish up | 13:09 |
tboimah | OK, I got you | 13:09 |
ubuntourist | So. 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 |
ubuntourist | I should keep better notes of what we've covered. I think we talked about the ~/.bash_aliases file before. | 13:11 |
ubuntourist | Every user has several files that they can customize to make their personal environment more friendly. | 13:11 |
ubuntourist | These 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 | |
ubuntourist | Syntax-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 |
ubuntourist | When 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 |
ubuntourist | For 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 |
ubuntourist | Bash is an application program, and it has its own configuration files. The three importaant ones are ~/.profile, ~/.bashrc and ~/.bash_aliases. | 13:17 |
ubuntourist | The 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 | |
ubuntourist | Your network seems really bad today... | 13:19 |
ubuntourist | I'll give you a second or two to catch up. | 13:20 |
tboimah_ | I am following | 13:20 |
ubuntourist | Each time a systems administrator adds a new user to the computer, the operating system copies a very basic, standard version of .bashrc and .profile | 13:22 |
ubuntourist | to the new user's directory. | 13:23 |
ubuntourist | Hold a sec. I want to check something. | 13:23 |
ubuntourist | Back 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 | |
ubuntourist | But, the basic "starter" .bashrc and .profile files are kept in /etc/skel | 13:27 |
ubuntourist | In fact, anything that a systems administrator puts in /etc/skel will be copied to new user's home directories | 13:28 |
ubuntourist | when the new user is added to the system. | 13:29 |
ubuntourist | So, if you and mulbah decide that all users should have certain features enabled, or text file that says "Welcome, New Students, | 13:30 |
ubuntourist | Please read this before continuing." you could alter files or add files to /etc/skel. | 13:31 |
ubuntourist | But, 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 | |
tboimah | okay | 13:32 |
ubuntourist | So, 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 |
ubuntourist | Before I forget, there's one other file used that sets up new directories for every user. | 13:34 |
mulbah | Good morning Mr. Cole I'm sorry I am late my computer was giving me hard time to come on that why | 13:34 |
ubuntourist | Unfortunately, this file can have different names, depending upon which "distribution" of Linux you are using. | 13:34 |
ubuntourist | I like to say that a "distribution" is like a "flavor" of ice cream, | 13:36 |
*** scooper has quit (Ping timeout: 480 seconds) | 13:36 | |
ubuntourist | All ice cream starts out the same way, but ingredients are added to the basic formula to change the taste. | 13:37 |
ubuntourist | For Linux, different groups have decided to add or change basic features and applications. | 13:38 |
ubuntourist | I am not sure which distribution you are you are usiing. Probably Ubuntu. Let's find out. Type: | 13:39 |
ubuntourist | lsb_release -a | 13:39 |
ubuntourist | in a terminal window. | 13:39 |
ubuntourist | And tell me what it says. | 13:39 |
tboimah | No LSB modules are available. | 13:40 |
tboimah | Distributor ID:Ubuntu | 13:40 |
tboimah | Description:Ubuntu 22.04.1 LTS | 13:40 |
tboimah | Release:22.04 | 13:40 |
tboimah | Codename:jammy | 13:40 |
*** mulbah has quit (Read error: Connection reset by peer) | 13:41 | |
ubuntourist | OK. I guessed right: Ubuntu. The April 2022 release, with Long Term Support (22.04 LTS) | 13:41 |
ubuntourist | LTS - Long Term Support - means that there will be no MAJOR changes to the packages installed with apt. | 13:42 |
ubuntourist | until April 2024. | 13:42 |
ubuntourist | The non-LTS releases make major changes every six months instead of every two years. | 13:43 |
ubuntourist | Each distribution is created by a team of people who decide which packages to include automatically, and which to | 13:45 |
ubuntourist | ignore. Also, what fonts should be included, what colors to use, what the background picture on your desktop is, | 13:45 |
ubuntourist | and what program to use to install new packages. | 13:46 |
ubuntourist | Ubuntu is a descendant of Debian. It uses the Debian Package Manager (dpkg) and the Advanced Package Tool (apt). | 13:47 |
ubuntourist | It 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 |
ubuntourist | Hold a sec... | 13:49 |
ubuntourist | Ah. Found what I was looking for: The file that sets up users' default directories: | 13:52 |
ubuntourist | For Ubuntu it's /etc/xdg/user-dirs.defaults | 13:52 |
ubuntourist | When a new user is created, they get a directory /home/username -- /home/mulbah, /home/tboimah, or whatever. | 13:53 |
ubuntourist | But, when you login for the first time, you will see that you already have /home/mulbah/Documents, and /home/tboima/Downloads | 13:54 |
ubuntourist | etc. Desktop, Downloads, Documents, Music, Pictures, Videos, Templates, Publich, etc are standard | 13:55 |
ubuntourist | directories on Ubuntu systems. | 13:55 |
ubuntourist | type: | 13:55 |
ubuntourist | most /etc/xdg/user-dirs.defaults | 13:55 |
mulbah07_ | done | 13:56 |
ubuntourist | (Notice there are some comments in there that we could hide using what we learned on Friday. | 13:57 |
ubuntourist | But it's a small file, not 2300+ lines. So it is pretty easy to read without hiding the comments.) | 13:57 |
ubuntourist | Maybe, your school will not want students to have a Videos directory. As a systems administrator, you can | 13:59 |
ubuntourist | add a comment "#" character to the start of the VIDEOS line. Then when you create new users, they will not have | 14:00 |
ubuntourist | a ~/Videos directory automatically. (They can still type "mkdir ~/Videos" and create their own, but it will not be | 14:00 |
ubuntourist | created for them automatically.) | 14:01 |
ubuntourist | But back to the other two files: ~/.bashrc, and ~/.profile. | 14:01 |
ubuntourist | ~/.profile is mostly where environment variables are kept. We've talked about how | 14:02 |
ubuntourist | "man bash" or "man vim" looks better with a bit of color: Normally, the "man" command uses its own "pager" | 14:03 |
ubuntourist | to display one screen at a time. But, by changing the environment variable PAGER to "most", programs like "man" | 14:04 |
ubuntourist | see that and say "Oh! You want me to override my default behaviour and use the pager that you have specified, instead | 14:04 |
ubuntourist | of my own." | 14:04 |
ubuntourist | I guess we will try tmate, because the connection seems to be stabilizing... | 14:05 |
ubuntourist | I think I'll start it again, and you both join mine. | 14:06 |
ubuntourist | ssh LL4BceC4E4H6yZWzFJdeqjHN6@lon1.tmate.io | 14:06 |
ubuntourist | Are you both on? I see mulbah | 14:07 |
ubuntourist | OK. | 14:08 |
ubuntourist | This is the system-wide, default .profile that all users get when they get a new account. | 14:09 |
ubuntourist | We 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 |
ubuntourist | But, it says that the examples are part of the bash-doc package, which MIGHT not be installed... We'll see... | 14:11 |
ubuntourist | No such file or directory... | 14:12 |
*** tboimah has quit (Ping timeout: 480 seconds) | 14:12 | |
ubuntourist | No results found from searching dpkg for "bash-doc" | 14:12 |
ubuntourist | Okay... there is a package with that name, but it is not installed... | 14:13 |
ubuntourist | Oops. 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 here | 14:15 |
ubuntourist | based on what was happening in the tmate session...) | 14:15 |
ubuntourist | So, apt-cache show bash-doc | most is now displaying information about the package. I usuallly find the description | 14:17 |
ubuntourist | section to be the most useful. | 14:17 |
ubuntourist | Also, the Installed-size. If the package is HUGE, you might want to think twice about installing it. | 14:18 |
ubuntourist | You do not want to eat up all your disk space. | 14:18 |
*** tboimah_ has quit (Ping timeout: 480 seconds) | 14:19 | |
ubuntourist | You can install bash-doc on your own computers first. Later, maybe put it on the server. | 14:20 |
ubuntourist | For now let's look at the /etc/skel/profile without comments. | 14:20 |
ubuntourist | I already have my "decomment" alias set up. So I do not need to type the complicated grep. | 14:20 |
ubuntourist | Wow! Again, without the comments, much smaller! | 14:22 |
*** tboimah has quit (Read error: No route to host) | 14:23 | |
ubuntourist | What it tells us: If there is an environment variable named BASH_VERSION, then check if there is a file named ~/.bashrc. | 14:24 |
ubuntourist | if there is both (an environment variable named BASH_VERSION and a file named ~/.bashrc) interpret the contents of the | 14:25 |
ubuntourist | ~/.bashrc file as a script full of Bash commands. | 14:25 |
ubuntourist | Then... 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 |
ubuntourist | directories = [..., ..., ...] # We don't know what is in the list. | 14:28 |
ubuntourist | if "~/bin" in directories: | 14:28 |
ubuntourist | path = "~/bin" + path | 14:29 |
mulbah | let say mulbah tboimah and kjcole is in the list | 14:29 |
ubuntourist | mulbah, nope, because we're looking at the list of directories that mulbah or tboimah or kjcole owns. | 14:30 |
mulbah | alright | 14:30 |
ubuntourist | (I'm using "~" wihch is a synonym / abbreviation for "$HOME" which is an environment variable for "/home/Your_Usermame".) | 14:31 |
ubuntourist | So when I login, it runs MY ~/.profile. That means everywhere that $HOME appears, it means "/home/kjcole" | 14:32 |
ubuntourist | But for you, it will mean "/home/mulbah" (or /home/mkolleh ... one of those should probably go away.) | 14:33 |
ubuntourist | Finally, it says | 14:34 |
ubuntourist | if there is a directory named ~/.local/bin` change the PATH environment variable to include ~/.local/bin at the start. | 14:35 |
ubuntourist | Almost the same thing as before. | 14:35 |
ubuntourist | So it's really doing only three things: Run the .bashrc file if it exists, and add ~/bin and ~/.local/bin to the PATH environment | 14:36 |
ubuntourist | variable if those directories exist. | 14:36 |
ubuntourist | So... PATH is an environment variable. We can see what it contains. | 14:37 |
ubuntourist | type "set PATH" | 14:37 |
ubuntourist | Oops. wait. | 14:37 |
mulbah | on my terminal | 14:37 |
ubuntourist | Don't. | 14:37 |
mulbah | or yours | 14:37 |
ubuntourist | My mistake. | 14:37 |
ubuntourist | type (in the tmate terminal): | 14:38 |
ubuntourist | printenv PATH | 14:38 |
ubuntourist | OK. the PATH variable does NOT contain either "/home/kjcole/bin" or "/home/kjcole/.local/bin". | 14:40 |
ubuntourist | That means both "if" statements failed to find the directories. | 14:40 |
ubuntourist | Understand? When I logged in, it searched for the two directories with the if statements in the .profile file, and because | 14:42 |
ubuntourist | both "if" statements resulted in "False", it did not do either of the PATH= commands. | 14:43 |
ubuntourist | Oh, one more thing. The people who wrote the Bash application have a strange sense of humor which makes things confusing. | 14:44 |
ubuntourist | In Python, you indicate a block by indenting. When the indenting stops, it means the block is finished. | 14:44 |
ubuntourist | In C, blocks are enclosed in { and }. | 14:45 |
ubuntourist | In Bash, SOME blocks start with "do" and end with "done". But the stupid, silly, confusing humor is that some blocks | 14:45 |
ubuntourist | start with a word and end with the same word spelled backwards. | 14:46 |
ubuntourist | So an "if" block ends with "fi" | 14:46 |
ubuntourist | There is something called a "case" block. And it ends with "esac". Hard for new users. I wish they would use | 14:47 |
ubuntourist | endif and endcase (or end_if and end_case) instead. | 14:48 |
ubuntourist | Following okay? | 14:48 |
tboimah | yeah | 14:49 |
mulbah | yeah | 14:49 |
mulbah | following | 14:49 |
ubuntourist | The PATH environment varialbe tells the operating system where to look for programs. Right now, my PATH says | 14: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 |
ubuntourist | First, 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 |
ubuntourist | If you did not find it in any of them, print "command not found". | 14:52 |
ubuntourist | The .profile changes that behavior if it can: It says "If the user has created a directory named "~/.local/bin" search THERE first. | 14:54 |
ubuntourist | If the user has created a directory named ~/bin, search there next. THEN if it can't find the program in either of those two | 14:55 |
ubuntourist | now start searcing /usr/local/bin, /usr/bin/, /bin ... | 14:55 |
ubuntourist | You 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 |
ubuntourist | Let's fix that... In a few steps. | 14:58 |
ubuntourist | We've made the directory, but .profile only runs when you login. So the PATH is still not changed. | 14:58 |
ubuntourist | I have made a very simple, executable program. But... | 15:01 |
ubuntourist | It is not found. | 15:01 |
ubuntourist | NORMALLY .profile is only run when you login. But I don't want to logout break the tmate connection and then login and wait for | 15:02 |
ubuntourist | you to join. | 15:02 |
ubuntourist | So I can FORCE .profile to be run early. | 15:02 |
ubuntourist | Notice the change? | 15:03 |
mulbah | yeah | 15:04 |
ubuntourist | So, explain what you've learned today, either quickly or send me e-mail (not Zulip, unless you really cannot use e-mail.) | 15:05 |
mulbah | I will e-mail you | 15:06 |
tboimah_ | okay i will email you | 15:06 |
ubuntourist | OK. 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 | |
ubuntourist | Then 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 |
ubuntourist | And, 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 |
ubuntourist | read the aliases from there and set those up as handy shortcuts. So, we will create a .bash_aliases file and put | 15:11 |
ubuntourist | the alias for the long, hard to remember "egrep" command in there, so that we have an easy way to look at | 15:12 |
ubuntourist | files while hiding the comments. | 15:12 |
ubuntourist | Finally, 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 make | 15:13 |
ubuntourist | the 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 |
ubuntourist | talk to your systems administrator and see if he or she thinks any of these changes are a good idea... | 15:15 |
ubuntourist | Wait until we've finished doing all of that on your personal computers first.) | 15:16 |
ubuntourist | Bye for now... | 15:16 |
tboimah | okay bye thanks for today | 15:16 |
mulbah | Okay | 15:17 |
mulbah | Thanks for the day Mr. Cole | 15:17 |
mulbah | I will e-mail you and explain good what I learn today | 15:18 |
ubuntourist | Oh. One more thing. | 15:18 |
mulbah | yes | 15:18 |
ubuntourist | We will also be looking at the "diff" command | 15:18 |
mulbah | alright | 15:18 |
ubuntourist | When two files are almost the same, but have a few differences, "diff" can show us the changes. | 15:18 |
ubuntourist | We will be comparing our new .profile and .bashrc to the originals in /etc/skel/ | 15:19 |
ubuntourist | You can look on your computers at your personal ~/.bashrc and ~/.profile and /etc/skel/.bashrc and /etc/skel/.profile | 15:20 |
ubuntourist | Bye again! | 15:20 |
mulbah | bye | 15: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 | |
klarios | https://share.mayfirst.org/s/qzitgs9Dt5cd8bg | 21:27 |
jelkner | https://share.mayfirst.org/s/Z5LL6TaMg7EGEtK | 21: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/!