IRC log of #novawebdev for Monday, 2023-11-20

*** shmohamud has quit (Ping timeout: 480 seconds)00:55
*** shmohamud has quit (Ping timeout: 480 seconds)01:46
*** shmohamud has quit (Ping timeout: 480 seconds)02:09
*** shmohamud has quit (Ping timeout: 480 seconds)02:55
*** shmohamud has quit (Ping timeout: 480 seconds)04:03
*** shmohamud has quit (Ping timeout: 480 seconds)05:31
*** shmohamud has quit (Remote host closed the connection)05:40
*** tboimah has quit (None)11:19
*** jelkner has quit (Quit: Leaving)12:10
*** svaye has quit (Quit: Leaving)12:12
*** scooper has quit (None)12:53
ubuntouristtboimah, Hi. I don't know if you saw my previous mail, but due to the time shift in the U.S. 13:05
ubuntouristI am hoping we can move this to one hour from now.13:06
tboimahyeah i saw that13:06
tboimahokay then it will be 2:00pm my time13:06
ubuntouristYeah. Thanks. I am here today at the old time. So, we might as well continue today, but on Friday13:07
ubuntouristI will change to the new time.13:07
tboimahokay13:07
ubuntouristSo... Linux+. A challenging certification, but it looks like a good one.13:08
ubuntouristI tried part of the assessment exam at the beginning of the book, and it's not an easy test.13:09
tboimahsure13:09
ubuntouristIn another message, I mentioned you'll both need to be able to build on pevious work. You will need a13:10
ubuntouristdependable computer or need to be able to QUICKLY move all of your material to a new computer if the old one13:10
ubuntouristbreaks.13:11
ubuntouristI don't know how much you've looked at the book, but the first step will be to create a 13:11
tboimahlearning enviroment13:12
ubuntouristvirtual computer. The software that I am most familiar with for doing that is VirtualBox.13:12
ubuntouristRight. Learning environment. Of the ones suggested, both the authors and I favor a virtual computer as13:13
ubuntouristthe learning environment.13:13
tboimahsame for me13:14
ubuntouristThe strategy here is: What would you  do if you had a computer that had NOTHING on it? 13:14
tboimahi already download a virtual box 13:14
ubuntouristAh, good!13:14
ubuntouristSo, are you working through the book independently then?13:15
tboimahall i need to do is to download an ios to install another os13:15
tboimahi start on it today because we was on breake13:16
tboimahand i do not have computer at home13:16
mulbahGood morning Mr. Cole13:16
ubuntouristI need to skim the book more, but it may suggest eventually trying out different distributions.13:16
ubuntouristmulbah, hi. I am on "early" for me today. Starting Friday, for the winter months, we move to 2:00 your time.13:17
ubuntouristmulbah, we're talking a little about the Linux+ certification, and needing a stable, working computer13:18
mulbahokay13:18
ubuntouristto have a VirtualBox virtual computer. tboimah, just mentioned he's installed VirtualBox and needs to install an operating system.13:18
ubuntouristI have not explored the book as much as I had planned.  It may suggest that you eventually try different distributions of Linux.13:19
ubuntouristMost of the commads for different distributions will be the same. The one big change is the package manager..13:20
ubuntouristOn Debian, Ubuntu, Mint, Pop OS!, and other Linux distributions, it is the familiar dpkg and apt.13:21
ubuntouristOn RedHat, CentOS, Fedora, SuSE, and others, it is rpm and ... I forget... "d" something... Three letters. 13:23
ubuntouristAnd there are other distributions. Gentoo uses something called portage, and Arch uses  pacman.13:24
ubuntouristAll of these (dpkg, apt, rpm, dtn(?), portage, pacman) are different ways to install packages, remove them, update them13:25
ubuntouristand keep track of them.13:25
ubuntouristThere will be other small variations: For example, the choice of fonts, icons, screen layout, etc.13:26
ubuntouristSome may put a menu bar at the top of the screen, while others put it at the bottom of the screen.13:27
ubuntouristAlso, when you install operating system for the first time, different distributions will choose to include different packages13:28
ubuntouristautomatically. 13:28
ubuntouristFor example, maybe Debian will automatically include tmate, but for RedHat you may need to install it manually.13:29
ubuntouristBut the differences between the distributions is small. The only major change will be learning the different package managers.13:30
ubuntouristFor now we'll stick with the Debian / Ubuntu family. 13:30
ubuntourist...13:31
ubuntouristgoing backwards: Did either of you finish the "cut" homework?13:32
tboimahyeah 13:32
mulbah  yeah13:32
ubuntouristSo, you both know how to use the "-f" to choose fields lots of different ways. Like fields 1, 2, 3, 7 and skip 4, 5, 6.13:34
tboimahsure13:35
ubuntouristThe tools we've been working with are all used to search, isolate and automate editing of information.13:35
ubuntouristCate to demonstrate (briefly) in tmate?13:36
tboimahssh 7bQEvV7Nj2SuftHw4M4RRthbE@lon1.tmate.io13:36
ubuntouristSorry. "Would you care to demonstrate..."13:36
ubuntouristSo. Show me fields 2, 3 and 5 in /etc/passwd.13:37
ubuntourist(Skip 1, 4 and others.)13:38
ubuntouristmulbah, are you on and watching?13:38
mulbahyeah13:38
ubuntouristtboimah, great.13:39
tboimahsure thanks13:39
ubuntouristYou can also use a hypen also known as a dash when fields are consecutive.13:39
ubuntouristIf I said 2,3,4, and 7 the best way would be "-f 2-4,7"13:40
ubuntourist2-4 is 2 through 4, instead of typing 2,3,4.13:41
ubuntouristOK. What if I said "Get the LAST field" for a file that sometimes has 4 fields on one line and seven on another?13:41
ubuntourist(This is the "tricky" question I said I'd explain after you'd mastered the basics of cut.)13:42
tboimahyeah13:43
ubuntouristmulbah, any ideas?13:43
mulbahlet me try you will use the regural expression ????13:44
ubuntouristThat's not a bad thought... 13:45
ubuntouristThis is why it's always good for me to ask. I would not have chosen that, but it could be done that way.13:46
ubuntouristmulbah, good answer..13:46
mulbahThank Mr. Cole13:46
ubuntouristBut, its time for a new command.13:47
ubuntouristtype:13:47
ubuntouristrev /etc/passwd13:47
ubuntouristStudy what is on the screen and tell me what it did with /etc/passwd.13:48
ubuntouristmulbah, I would prefer you to answer13:48
mulbahokay13:49
ubuntourist(If you are struggling with it, I can give you a little more to type that may help.)13:50
mulbahI think it arrange the output alphabetically 13:51
ubuntouristmulbah, not quite.13:51
ubuntouristHow about typing these two lines:13:51
tboimahcan i try13:51
ubuntouristtboimah, not yet.13:51
ubuntouristtail -n 5 /etc/passwd13:52
ubuntouristtail -n 5 /etc/passwd | rev13:52
mulbahwait I think it give the output backward13:52
ubuntouristmulbah, Yes!13:52
ubuntourist"rev" = "reverse"13:53
mulbahso the command means reverse right13:53
ubuntouristyes.13:53
ubuntouristso now:13:53
ubuntouristThink about this. Don't type it yet. Try to answer without typing it in:13:54
mulbahMr. Cole can you give us 10mins break13:54
ubuntouristOK. 10 minute break.13:54
mulbahwe are having electrical problem we will be back13:55
mulbahBut we will be back in 10mins13:55
ubuntouristACTION is sipping his caffeinated Coke, jokingly called the "breakfast of champions"  ðŸ˜‰14:04
ubuntouristACTION is wondering if the electrical problem is fixed. 14:10
*** mulbah has quit (Ping timeout: 480 seconds)14:12
*** tboimah has quit (Ping timeout: 480 seconds)14:12
*** fkoikoi has quit (Ping timeout: 480 seconds)14:12
ubuntouristPoo.14:12
*** dcammue has quit (Ping timeout: 480 seconds)14:12
ubuntouristIt is now 20 minutes... waiting...14:14
ubuntourist30 minutes... still waiting...14:24
sysadmin_sorry we are back14:25
ubuntouristOK....14:25
mcssguest_We are back14:26
ubuntouristThink about the following. Don't type it yet. Try to answer without typing it in:14:26
mcssguest_alright14:26
ubuntouristYou know about cut. You now know about rev. And you know about pipes. Try to think and explain the following:14:26
ubuntouristrev /etc/passwd | cur -d ":" -f 1 | rev14:27
ubuntourist(go back to tmate I am still on tboimah@mcssstudents.)14:27
mcssguest_the command is cut or cur?14:27
ubuntouristmcssguest_, Sorry, my  bad. You are correct. it should be "cut"14:28
ubuntouristrev /etc/passwd | cut -d ":" -f 1 | rev14:28
tboimahssh tuarE6trzDBEPjjzksUXasZMJ@lon1.tmate.io14:29
mulbahokay14:29
tboimahplease join that link please14:29
mulbahthe command will give the output backward and use ":" as it delimiter and print out the first fields14:31
mulbahand I correct Mr. Cole14:33
ubuntouristmulbah, I think so... Tell me what would print for the last line if the original line is:14:33
ubuntouristtboimah:x:1012:1014:Thomas Boimah,,,:/home/tboimah:/bin/bash14:34
mulbahit will print "bash"14:34
mulbahsorry14:35
mulbah"/bin/bash"14:35
ubuntouristmulbah, correct!14:35
mulbahbecause the delimiter is ":"14:35
mulbahThanks Mr. Cole14:36
ubuntouristIt flips the line backwards, uses the colon as the delimiter which means it gets "hsab/nib/" as the first field and then flips that backwards to get "/bin/bash"14:37
ubuntouristSometimes, command names make sense, like "rev" means "reverse". 14:37
*** fkoikoi has quit (Quit: Leaving)14:37
ubuntouristBut sometimes the developers of Unix and Linux have a silly sense of humor that makes it hard for everyone else.14:38
ubuntourist"cat" is for "conCATenate" which means add one file to the end of another file and on Unix and Linux14:39
ubuntourist"everything is a file" including your screen. So "cat" ... adds(?) a file to the end of your screen. which means it prints it to the screen.14:40
ubuntouristIt's a strange name for a command. But an even stranger name that is just silly and kind of stupid:14:41
ubuntouristtac14:41
ubuntourist"tac" is "cat" spelled backwards... 14:41
ubuntouristAnd it does something backwards...14:41
ubuntouristIf you are both looking at the tmate, 14:42
ubuntouristtry "cat ledmer" then try "tac ledmer"14:42
ubuntouristSo. Can you see what it has done?14:43
tboimahyeah14:43
ubuntourist(I mean do you see what "tac" does?)14:44
tboimahsure14:44
ubuntouristI use that "rev ... | cut ... | rev" a LOT. It is very useful. But I have not found a good use for "tac".14:45
ubuntouristtwo other commands in the family of cat, tac, rev, cut, most and grep:14:45
ubuntourist"head" and "tail"14:46
ubuntouristSometimes, you only need to see the first few lines of a file or output from a command.14:46
ubuntouristSometimes you only need to see the last few lines.14:46
ubuntouristYou can do that with "most" using the "T" for "top" and "B" for "bottom", but sometimes it's easier to use14:47
ubuntouristhead or tail14:47
ubuntouristworking with tboimah ledmer file:14:48
ubuntouristhead ledmer14:48
ubuntouristHold a second. I want to check something.14:49
ubuntouristOK...14:49
ubuntouristthere is a command "nl" which means "number lines". It adds a line number to the start of14:50
ubuntouristevery line. But you can also do "cat -n" and the file name. They are a little different but try14:50
ubuntourist"cat -n ledmer | most"   and "nl ledmer | most"14:51
ubuntouristI think "cat -n" always numbers all of the lines. "nl" normally will  not put a line number on a blank line.14:52
ubuntourist"cat -n ledmer | head" and "cat -n ledmer | tail"14:53
ubuntouristStill there?14:55
ubuntouristACTION waiting for you to try the last two commands..14:56
ubuntouristSo head prints the first 10 lines.14:58
ubuntouristtail prints the last 10 lines.14:58
tboimah sure14:58
ubuntouristIf you want more or less you can tell them how many lines to print14:58
ubuntourist"head -n 5" and "tail -n 5" will print only five lines.14:58
tboimahsur14:59
tboimahsure14:59
ubuntouristAnd then there is the weird "head -n -5" and "tail -n -5"14:59
ubuntouristIf you use a negative number, it means "everything except..."14:59
ubuntouristhead -n -5 ledmer means "print everything except the last five lines"15:00
ubuntourist"tail -n -5 ledmer" means "print everything except the first five lines"15:01
ubuntouristSo, "head" and "tail" are a little bit like "cut".  And you can use them together:15:02
tboimahsure15:02
ubuntouristIf you have a file that is 20 lines long, and you want to print lines 10 to 15:15:02
ubuntouristcat -n ledmer | head -n 15 | tail -n 515:03
ubuntouristOops. 11 to 15. That's actually what I wanted. 15:04
ubuntourist(If I wanted 10 t0 15, it would be six lines. So "tail -n 6")15:04
ubuntouristI only used the "cat -n" so we could see the line numbers.15:05
ubuntouristWithout line numbers we could have typed "head -n 15 ledmer | tail -n 5"15:05
ubuntouristAll of the commands we've been focused on will help you when you are looking for information in15:06
ubuntouristconfiguration files (/etc/*) and system log files (/var/log/*)15:06
ubuntouristAs a systems administrator, trust me: You will be spending a LOT of time looking at log files and editing configuration files.15:07
ubuntouristSo knowing about grep, cut, rev, head, tail, cat -n, and most will help you find what you're looking for quickly.15:08
ubuntouristAnd knowing how to use all of them with pipes, and for loops too.15:09
ubuntouristOK. That's it for today.15:09
tboimahokay thanks very much15:09
mulbahThanks for today Mr. Cole15:09
ubuntouristSee if you can both have working virtual boxes with an OS installed by friday.15:09
tboimahOkay15:10
mulbahAlright15:10
ubuntouristI'll try to make time to look at the Linux+ book to see where it wants to go from there.15:10
ubuntouristOh, and keep trying to increase your speed with editing, command line shortcuts, and reading man pages.15:11
ubuntouristThose will also be invaluable to you -- especially when you do not have access to the internet.15:12
ubuntouristBye for now,15:12
*** ubuntourist has quit (Quit: Leaving)15:12
*** tboimah has quit (Remote host closed the connection)15:18
*** mulbah has quit (Remote host closed the connection)15:36
*** scooper has quit (Remote host closed the connection)20:15

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