IRC log of #novawebdev for Saturday, 2022-09-10

tboimahGood morning11:35
*** tboimah has quit (None)11:36
ubuntouristHi11:52
ubuntouristI need to take care of something for a minute or two. I'll be back soon.11:52
ubuntourist...and, I am back.11:57
tboimahGood morning Mr. cool.11:58
ubuntouristSo. How many people are we expecting to join IRC this morning?11:58
tboimah7 people11:58
scooperOK are we set now to commence classes 11:59
scooperIf I may ask is that you Cole??11:59
LittleWebsterfree2 : mulbah : ubuntourist : scooper : tboimah12:00
LittleWebsterTick Tock!12:00
LittleWebsterIt's 12:00 UTC o'clock and NOVA Web Development's meeting is starting.12:00
LittleWebsterThis is the agenda for today:12:00
LittleWebsterBRIEF State of the Tech report from scooper (5 minutes max) (added by ubuntourist)12:00
LittleWebsterProgress reports from everybody (Again, keep it brief.) (added by ubuntourist)12:00
LittleWebsterLots of command-line-interface (CLI) interactive show and tell (I hope) and Q&A (added by ubuntourist)12:00
LittleWebsterHave a nice day, Websters!12:00
ubuntourist"Mr. Cool" 😉 Maybe I should change my name to that... 😉 (It's "Cole" not "Cool" but I like "Cool" too. 😉)12:00
scooperI m sorry that was a typing error12:00
ubuntouristscooper, Yep me.12:01
scooperSO what are we using for video teaching today?? Mr. COle12:01
ubuntouristOK, scooper, if everyone's there, let's start.12:02
scooper+1 everybody is here12:02
ubuntouristscooper, I looked through the last two IRC logs and it looked like video was just too much work. Much time was spent failing to get a good connection.12:03
ubuntouristscooper, I'm sorry I did not look at the logs sooner. I think there will need to be some mid-week experimentation to see if there is a way to improve the siituation.12:04
scooperSO what are the ways forward for today presentation??12:04
ubuntouristscooper, I'm working on setting up an audio solution first beecause there will be lower bandwidth / data requirements.12:05
scooperOk Sir12:05
ubuntouristscooper, I don't have a presentation ready. Sorry.  But, because this is all "command line" stuff today, I'm hoping I can type fast enough and you all can copy from the IRC chat into a terminal window when needed.12:06
free2hi12:06
ubuntouristSo. First:12:06
scooperHi free2 can you please introduce yourself??12:07
ubuntouristscooper, Any tech updates  for the entire lab / classroom? If not, we'll move on to student progress reports.12:07
free2I searched for web development channels and joined to see what happens here12:07
scooperLet move on to students progress cole12:07
ubuntouristWho's first? Just a brief summary of what you've learned or where you  got stuck.12:08
ubuntouristACTION waits for someone to report...12:09
ubuntouristOK. I'll go down the list alphabetically. dcammue you're the lucky first person. 😉12:10
tboimahokay I work on the robots program that was given to us by jeff and i done with challenge 1,2,3,4,5,and 6, but challenge 7 i have a problem, and not to forget i read on vimtutor and also on some unix command, Thanks.12:13
ubuntouristtboimah, Thanks. I'll be focusing on Unix command line stuff in  a minute. (I don't use vim. There is a long-running "joke" about editor wars and which editor is best. But I won't get into that.)12:14
ubuntouristAnyone else?12:15
svaye_me/ I read the program that Jeff send us and I understood what made the player to move by touching a key,but I got stuck at challenge 7, and I am still figuring out how to make the robot move.12:15
ubuntouristsvaye_, Good. So, for two people, step 7 is the issue. Anyone else?12:15
ubuntourist(I have not looked at the robot challenges, but Jeff will be looking at this log and can help with that.)12:17
tboimahokay12:17
ubuntouristdcammue, fkoikoi, janet, mulbah, are you awake? 😉12:18
tboimahthey are stay tapping.12:18
fkoikoiHi, I worked on the robot program from challenge 1 to 6 and i am having problem with challenge 7. I am still trying to make the robot move.  12:18
janetHi mr cole, last week was great i learn and study on vimtutor, i also continue with challenge 7 but am having a problem with moving the robot.12:19
dcammueGood morning Sir, I did the program, and I manage to place the player on the graphics window and also make it to move around the screen. I place the robot there too, but the function that make the robot follow the player is where I having problem with the program.Thanks 12:19
ubuntouristAh. Sorry. I have been working with computers a long time, and so, I've forgotten how it was when I was a slow typist. My apologies to all.12:20
tboimahno problem it will get better.12:21
mulbahI think i'm makeing process on my note because in done with challenge 5 and 6 but challenge 7 is giveing me had time to make the robot move and i'm also reading my vimtutor and unix comman12:21
ubuntouristOK. So, everyone's stuck on Challenge 7. If you are not already doing this, you may want to sit around and experiment together, suggesting ideas to each other.12:22
ubuntouristMoving on to Unix.12:23
mulbah+112:23
dcammue+112:23
tboimahokay 12:23
fkoikoi+112:23
tboimahwe are waiting.12:24
ubuntouristJeff may have already said something like "It's all just bits" when talking about computers. A similar statement can be made when talking about Unix and Linux and all the operating systems like that:12:24
ubuntourist"Everything is a file".  Unix is designed so that even things that don't seem like files can be treated as files. 12:25
ubuntouristYour keyboard is a "file". Your screen is a "file". Your printer is a "file".  The internet is a "file".12:26
ubuntouristDon't get to confused by that yet, but what it means is that Unix is really good at taking the result (output) of one program or application, and feeding it as input to the next application.12:27
ubuntouristSo. A quick example. Get your terminal windows ready, and we'll do a little bit of typing.12:27
fkoikoi+112:28
tboimah+1 it's ready12:28
dcammueokay12:28
ubuntouristFirst, let me ask: Have you used the "find" command yet? (Just a +1 for "yes" and a -1 for "no")12:28
mulbahACTION +112:28
janetsure12:28
fkoikoi-112:29
tboimah+112:29
mulbahACTION +112:29
janet-112:29
tboimahdid you means the ls command12:29
dcammue-112:30
ubuntouristtboimah, Nope. "ls" lists the files in a directory. Sometimes, you don't know which directory a file is in, but you want to locate it. "find" does that.12:30
ubuntouristSo, type:12:31
ubuntouristfind / -name "hosts" 12:31
tboimahdone12:32
ubuntouristYou will probably see a lot of errors about "permission denied".  This means that Linux is trying to search everywhere for files. But if you are not a systems administrator, you do not have permission to look at other people's files.12:33
tboimahand i see a bunch of listed files12:33
ubuntouristWe don't care about those errors. We only want to look at what we are permitted to see, but don't want to see the warnings for stuff we're not allowed to look at.12:34
dcammue+112:34
svaye_+112:35
fkoikoi+112:35
tboimah+112:35
dcammueI saw similar things like that12:35
janet+112:35
mulbah+112:35
ubuntouristSo.  Let's surpress the error. Really, what we are doing is telling Unix that error messages should go to a seperate file called the "Null device"  which is like a place to send garbage / trash / rubbish.12:36
ubuntouristTry again with:12:36
ubuntouristfind / -name "hosts" 2> /dev/null12:36
tboimahdone12:37
svaye_done12:38
dcammuedone12:38
mulbahdone12:39
ubuntouristThe list should be MUCH shorter. There are three common types of information travelling between you and your computer "Standard Input", "Standard Output" and "Standard Error" -- stdin, stdout, stderr.12:39
fkoikoidone but mine is saying /etc/hosts12:40
ubuntouristThey are often represented with numbers. stderr is for output that is an error message, and is repeesented by the number "2".12:40
ubuntouristThe ">" redirects information. So "2>" means "Send the error messages somewhere else" and "/dev/null" is "to the rubbish pile". Don't show the error messages to me. Do not send them to my screen.12:42
ubuntouristThe first part:    find / -name "hosts"      "find": well, that's kind of obvious: It means you want to find something.  "/" is where to start looking.  And -name "hosts" is "what we are looking for".12:44
ubuntouristI'm guessing you've alrready used "mkdir" and "cd", right? (I think those are early in Jeff's lessons.)12:45
fkoikoi+112:45
janet+112:45
dcammue+112:45
svaye_+112:45
tboimah+112:46
mulbah+112:47
ubuntouristOK, good. So, you have some idea about how directories work. "/" is called the "root" directory. All other directories are under or inside of the root directory. So, when you say "find /" followed by anything, 12:47
ubuntouristit means "look in ALL directories EVERYWHERE" not just my user directories.12:48
ubuntourist"find", "grep", "wc" and a few other commands will come in very handy as you progress. And knowing how to combine them into one big command can be very useful.12:50
ubuntouristSo next: "wc"  the Word Count program. It reports the number of characters, words, and lines in  a file.12:51
ubuntouristHelp me out here: I don't have Jeff's lessons handy. What is the name of the first file that Jeff told you to create with vim?12:52
svaye_right now we are using thonny12:53
tboimahwhen have not been using vim now it is thonny12:53
dcammuewe are using thonny.12:54
ubuntouristAh. Ok. Thonny's nice. I like it better than vim. 😉12:54
svaye_the lesson is "the robots are coming"12:54
ubuntouristOk. Pick a file name for some file you have already created and type:12:55
ubuntourist"wc" followed by the name of the file (without the quotes) Something like:12:55
ubuntouristwc robot.txt12:55
ubuntouristwc hello.html12:56
ubuntouristwc my.file.that.I.made12:56
ubuntourist(I don't know the names of your files.)12:56
ubuntouristWhat do you see?12:56
svaye_numbers12:57
ubuntouristType the numbers you see into the chat.12:57
fkoikoi12 52 32912:58
svaye_5515   30754  1499211 and the file name12:59
ubuntouristfkoikoi, svaye_  great! 12:59
ubuntouristsvaye_, I'll be interested in which file you chose!12:59
mulbah 59  206 138613:00
svaye_ThingsAboutShallon.sb313:00
ubuntouristThe first number is the number of lines in your file. The second number is the number of "words" in your file, and the third is the number of characters in your file.13:01
dcammue43 117 88013:01
ubuntouristsvaye_, My guess is that you  chose a file that is not human-readable, and that it is not really giving you the number of lines: 5515 lines is a lot of lines and 1499211 characters is a lot of characters!13:02
tboimah37 109 79813:02
svaye_it was a program I created in scratch13:02
ubuntouristsvaye_, Ah, Yes. Scratch files are only readble in Scratch. Opening that file with Thonny will probably  ruin it.13:03
janet21 28 33113:04
svaye_how about this one 22  88  60313:04
ubuntouristIt is often really handy to know how many lines are in a file. Or, how many files are in a directory. Most of you are getting files with somewhere between 10 to 50 lines.13:05
ubuntouristNow, we're going to combine a few commands together:13:05
ubuntouristWe'll start with "ls"  but with a few additions to it:13:06
ubuntouristType:       ls -lR ~/13:06
dcammueok13:06
tboimahdone13:07
dcammuedone13:07
janetdone13:07
svaye_done13:07
mulbahdone13:08
ubuntouristThis is a "long listing" that gives lots of information about your files, and shows all of your normal files in all of your normal directories. How many files and directories? Here's a quick estimate:13:08
ubuntouristls -lR ~/ | wc -l13:08
ubuntourist(type that)13:08
fkoikoidone13:09
tboimahdone13:10
janetdone13:10
ubuntouristInstead of sending the output of the ls command to your screen, we sent the output to the "wc" command and told "wc" to use it as input and count the number of lines (wc -l only shows the line count not word and character counts.)13:10
mulbahdone13:10
ubuntouristAny questions so far? Is this making sense? I've been doing a lot of talking / typing, but I want to make sure people are understanding.13:11
svaye_done13:11
dcammuedone13:11
fkoikoiIt is well understood 13:11
tboimah+1  i'm understanding you.13:12
dcammue=113:12
dcammuesorry13:12
dcammue+113:12
svaye_I understand13:12
mulbah+113:13
dcammueI understand13:13
janetsure,am understanding13:13
fkoikoiI have a question13:14
ubuntouristfkoikoi, go ahead.13:14
fkoikoiwhat if you don't know where you place a file or directories and you want to locate it and also count the numbers of line and words?13:15
ubuntouristI like questions even more than I like trying to make lessons! Jeff will confirm that, I think. 😉13:16
ubuntouristfkoikoi, Excellent question: THIS is where I'm hoping to get to by the end of today! You are predicting the end of today's lesson!13:16
ubuntouristI'll jump ahead and give you an answer right now, and then we will disect it.13:17
fkoikoialright13:17
ubuntouristLet's say we're looking for the number of user accounts on a computer.  And we remember part of the file name that has the list, but we don't know the full name or where it is.13:20
ubuntouristFirst, we know that the filename starts with "pass" but we can't remember the rest of it.13:20
ubuntouristfind / -name "pass*" 2> /dev/null13:21
ubuntourist(Type that to search, from the root directory, all file names beginning with "pass" but don't show me the errors for files that I am not allowed to see.)13:22
svaye_find / -name "pass*" 2> /dev/null13:23
fkoikoiI just tried it and it gives lots of file names beginning with the name or letters you type13:25
ubuntouristFiles that contain configuration information and important system information are usually in "/etc"13:25
ubuntouristfkoikoi, Right. It's searching for ANY file ANYWHERE that starts with the letters "pass"13:26
ubuntouristSo, lets improve on that:13:26
ubuntouristfind /etc -name "pass*" 2> /dev/null13:26
fkoikoi+113:26
ubuntourist(Search only the "/etc/" directory and subdirectories under it.)13:27
dcammueYes it give me all of my files name starting with rob, because I type in rob which is half of my files name.13:27
fkoikoidone13:28
tboimahsoe13:28
tboimahdone13:28
ubuntouristOK. So now it should be a much shorter list.13:28
tboimah+113:29
ubuntouristMaybe 4 files listed. Something like that.13:29
tboimahmy is 313:29
fkoikoimine is 313:29
ubuntouristClose enough. (My systems are more complicated and have a few more files.)13:29
ubuntouristNow:13:30
ubuntourista complicated command:13:30
ubuntouristNever mind. Too complicated for today. I changed my mind. I'm going to keep it simpler.13:31
dcammueI have 313:31
svaye_mine is 313:31
tboimahokay of you say.13:32
tboimahokay if you say.13:32
ubuntouristNow we know where the file might be, and what the name might be -- or we have a good guess: We found files that begin with "pass*" -- the part of the name that we remembered, and guessed that it was in the system configuration directory /etc.13:33
ubuntouristNow we can use wc -l on each of them to get the number of lines in each.13:34
ubuntouristwc -l /etc/passwd13:34
svaye_done13:34
ubuntourist(That's the only  one we'll need.)13:34
dcammue3913:34
dcammue39 lines13:35
svaye_48 lines13:35
tboimah4713:35
ubuntouristI want to keep things moving. So, don't waste your time now looking at the other files.13:35
janet4713:35
fkoikoialright 13:36
ubuntouristOK. REALLY quick, because we're running out of time:13:36
dcammueokay13:36
ubuntouristI think of a the "grep" command as a partner to the "find" command: "grep" searches for information INSIDE files.  For example, let's say that there is a word that you ALWAYS type incorrectly.13:37
ubuntouristMaybe you have 30 files, and you want to search them all to see if you have the incorrectly spelled word in any of them. "grep" is your friend here.13:38
ubuntouristOr maybe you want to find all the files with your name in them.13:39
ubuntouristThe simplest pattern is:13:39
ubuntouristgrep -r "my name" *13:40
ubuntouristor13:40
ubuntouristgrep -r "rong speling" *13:40
tboimahdone13:43
svaye_done13:43
ubuntouristgrep is MUCH more powerful than that. I think it is supposed to stand for "General Regular Expression Processor". Regular Expressions (sometimes called "regex") are very powerful search patterns.13:43
ubuntouristCombining a few ideas into one big one:13:44
ubuntouristfind / -name "pass" 2> /dev/null | grep "etc" | grep "passwd" | wc -l13:45
ubuntouristSearch the entire computer (all directories) for filenames that begin with pass. Take the output of that list and search for any lines that contain "etc". Take the output of THAT list and search for any lines that contain "passwd".13:46
ubuntouristTake the output of THAT list and tell me how many lines match.13:47
tboimah013:47
ubuntouristThere are shorter ways to do the above, because we already know we want to look at /etc/passwd. But sometimes, we don't have all the information and have to build it up slowly.13:48
dcammue013:48
ubuntouristtboimah, Oops... Then I've made a mistake. I need my morning caffeine... Let me check my work...13:48
janet013:49
ubuntouristAh, I forgot the asterisk... My bad. it should be -name "pass*"13:50
ubuntouristfind / -name "pass*" 2> /dev/null | grep "etc" | grep "passwd" | wc -l13:50
fkoikoi313:51
tboimah713:51
dcammue313:52
janet713:52
tboimahnow you asterisk your bed13:52
ubuntouristUsing the ">" is called a "redirect"  and using the "|" is called "piping" (The "|" is a "pipe" that takes the output of one command and sends it through  pipe to the next command. You are connecting the commands with pipes.13:52
svaye_713:53
ubuntouristThere are MANY unix commands that you can pipe together. 13:54
dcammuehmm okay13:54
ubuntouristSo, scooper Pick someone to summarize what we've learned today.  (Or one person, volunteer.)13:55
mulbah17213:55
ubuntourist(This is a 2-hour class, right?)13:55
mulbah+113:56
fkoikoi+113:56
svaye_+113:56
ubuntouristmulbah, Wow! That's an unexpected result! There must be some interesting stuff installed on that computer...13:57
fkoikoitboimah will do the summarizing 13:59
dcammueThomas is in progress with the summarize.14:00
ubuntourist(Keep IRC lines short and frequent. Many short sentences, instead of one big, long paragraph. That way, people aren't waiting.)14:04
tboimahokay to day wee learn about the find, grep, wc and we also learn how to locate a file a the amount of lines  and we learn that their are three common types of information travelling between you and your computer and they are "standard input", "standard output" and "standard error. once again thanks for the time, we appreciate that.14:04
ubuntouristSounds good. If you have time and a good connection, search the internet for beginners guides and tutorials for both "unix pipe" and "grep". "grep" will probably be harder,14:05
tboimahokay14:06
ubuntouristbecause there is more to understand about the ways to make regular expression patterns.14:06
ubuntouristscooper, I'm working on setting up "mumble" which is a low-bandwidth, low-latency audio chat system.14:06
ubuntouristscooper, My  hope is that it will be stable for audio.14:07
ubuntouristscooper, We should try to find a time where we can talk and set up a "mumble" client program on one of the computers there. 14:08
scooperOk Sir we hope for the best14:08
ubuntouristscooper, probably the most powerful computer....14:08
scooperI was thinking  to share with Jeff that we use Libtelco internet service here in Liberia it preferable and reliable 14:08
ubuntouristscooper, I think video is going to continue to be a problem, but audio may be solveable.14:08
scooperIf we use Libtelco as our ISP the will be no trouble in our video interaction  COle14:09
ubuntouristscooper, Well, in that situation, I will wait until I hear from Jeff. (I will continue to experiment with "mumble" but if there's a better 'net connection, we might not need it.)14:10
ubuntouristOK. Bye everybody!14:10
scooperGOodbye COle and thanks for the time sir14:10
tboimahokay thanks for the time.14:10
fkoikoithanks so much14:11
janetalright,thanks alot14:11
fkoikoii learned a lot of things from you today 14:11
svaye_thanks for your time14:11
*** tboimah has quit (Quit: Leaving)14:12
*** scooper has quit (Remote host closed the connection)14:12
*** janet has quit (Quit: Leaving)14:13
free2hi, would it be ok to share some examples of commands?14:13
*** fkoikoi has quit (Quit: Leaving)14:14
ubuntouristfree2, You mean sharing your commands with the rest of the class? Or what?14:14
free2yes14:14
free2I want to share some options of find and such14:15
free2this is a nice alternative to grep, it has an option to specify start and end lines of search https://github.com/Genivia/ugrep/wiki faster grep with an interactive query UI Universal grep: ultra fast searcher of file systems, text and binary files, source code, archives, compressed files, documents, and more.14:15
ubuntouristWell, class is over ofor today, and I was trying to keep it simple. But sure. 14:15
free2right I figured maybe not to post advanced commands and such14:15
free2for example in find manual they recommend using -execdir over -exec for security14:16
free2find . -type f -not -name "*.html" -exec ls -l {} \;14:16
free2and there is also -iname for case-insensitive search14:16
free2maybe it would be useful to have files for each command, where one would save examples14:16
ubuntouristAs I was typing I thouhgt about introducing both -exec and the "for x in $(...) do... done" pattern which I use a lot, but it seemed like too much for today.14:17
free2in that command we see how we can find all files that don't match a specific regex, and execute a command for each of those files14:17
free2right I see, not to rush things14:17
ubuntouristI started typing in those and then thought "too many prerequisites" I'm already trying to cram too much into two hours.14:17
free2I see14:18
free2also -maxdepth14:18
free2of course they are all there in the manual, but it is useful to have a list of the most useful options14:18
ubuntourist(And xargs too. And find has a -regex search too, used with -regextype. But sooo much.)14:20
free2I see14:20
ubuntouristMaybe next week: Learning to read man pages. I remember the first time I saw those and thought "This is absolutely horrible!" but now, I am so used to them.14:21
free2right14:21
free2sometimes it is hard to find what you need14:21
ubuntouristI will share now my favorite alias which I put together over time:14:21
free2poorly made manuals14:22
*** mulbah has quit (Ping timeout: 480 seconds)14:22
*** dcammue has quit (Ping timeout: 480 seconds)14:22
ubuntouristalias decomment='egrep -v "^[[:space:]]*((#|;|//).*)?$" '14:22
*** svaye_ has quit (Ping timeout: 480 seconds)14:22
free2I see14:23
free2optional space at the start, # or ; or // then arbitrary text and one character at the end, as I understand it14:23
free2regex is very hard for me14:23
ubuntouristThis is REALLY useful on /etc/ configuration files. For example, some of the old Apache config files would be 500 lines long. Run one through decomment and find that there are actually 30 lines of code. The rest (470) are comments.14:24
free2everyone pinged out14:24
free2I see!14:24
free2right it deletes the whole line, -v invert search14:24
ubuntouristWhere are you coming in from?14:25
free2everyone was connected through webchat?14:25
free2eastern europe14:25
free2also everyone using real names14:26
free2this chat is private?14:26
ubuntouristI believe they were all using the HexChat application. I'm in Washington, DC. They're all in Liberia.14:26
free2I see14:26
free2they pinged out at the same time14:27
ubuntouristYes, it's intended as a private classroom / co-operative channel. 14:27
free2should I leave?14:27
ubuntourist(Worker's coop. NoVA Web Development.)14:28
free2I see14:28
ubuntouristprobably. 14:28
free2alright14:28
ubuntouristBut nice chatting anyway.14:28
free2goodbye14:28
free2yes, thank you14:28
*** free2 has left #novawebdev (None)14:28
*** ubuntourist has quit (Remote host closed the connection)22:11

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