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

*** mulbah has quit (Read error: No route to host)04:44
*** mulbah has quit (Ping timeout: 480 seconds)06:31
scooperGood morning Jeff10:50
sysadmin_good morning Jeff10:53
*** fkoikoi_ has quit (Remote host closed the connection)10:54
*** fkoikoi has quit (Read error: Connection reset by peer)10:55
jelknerscooper, can i ask you a favor?10:56
scooper+110:57
scooperJeff, can I ask you a favor too??10:57
*** scooper has quit (Quit: Leaving)10:59
scooperAre you still there Jeff11:00
*** fkoikoi_ has quit (Remote host closed the connection)11:00
*** fkoikoi_ has quit (Remote host closed the connection)11:04
jelknerscooper, i'm in the other channel with dcammue 11:07
scooperok let me get there11:07
jelknerno11:07
jelknerhere is good11:07
scooperok11:07
scoopercan click this link11:07
scooperto see what I was talking about yesterday11:07
scooperhttp://students.mcssliberia.org:8000/11:07
jelknermy favor is to ask you to figure out how to give tmickelson all the access he needs to the git.mcssliberia.org server11:08
scooperok considerate it done11:08
jelknernice, scooper, you have a Django application running11:08
scooperThanks11:08
jelknerwe are making steady progress on all fronts11:08
jelknervery exciting11:08
jelknermakes me start thinking about my visit next Summer11:09
scooperI m thinking of updating every week11:09
scooperThanks Jeff11:09
jelknerok, i gotta go11:09
scooperok Jeff11:09
jelkneri need to message Sahnun that i can't have breakfast with him tomorrow11:09
jelknermy wife is using her car11:09
scooperok my regards to him11:10
jelkneri'll be at our meeting from home11:10
scooperok Jeff11:10
scooperthe supe promise to be with us too11:10
jelknernice!11:10
scooperI talked with him yesterday11:10
jelkneruntil tomorrow then...11:10
jelknerACTION signs off11:10
scooperok Jeff11:10
*** jelkner has quit (Quit: Leaving)11:10
*** dcammue has quit (Quit: Leaving)11:10
*** fkoikoi_ has quit (None)11:11
*** scooper has quit (Quit: Leaving)11:15
mulbahhello shmohamud12:59
mulbahhow are you doing12:59
shmohamudHi Mulbah13:00
shmohamudI'm doing well, how are you?13:00
mulbahI'm good 13:00
mulbahlong time13:00
shmohamudwhat are you studying now?13:00
shmohamudI know, I've been tied up between work and my father passing13:01
ubuntouristtboimah, mulbah, hi13:01
mulbahlinux sysadmin13:01
mulbahHello Mr. Cole13:01
shmohamudsounds good13:01
mulbahThanks shmohamud13:01
tboimahGood morning ubuntourist13:01
shmohamudI won't interrupt. You can always email your questions to sahnunhm@gmail.com13:01
ubuntouristAny  thoughts about the files I've sent? Any experiments to share?13:02
mulbahOkay shmohamud thanks 13:02
shmohamudof course @mulbah13:02
mulbahsure Mr. cole13:03
mulbahI can explain the command 13:03
ubuntouristmulbah, go ahead, please.13:03
mulbahI read of regural expression which you use in the command13:04
mulbahlet me start13:04
ubuntouristmulbah, wait. Before that: 13:04
mulbahokay13:04
mulbahACTION waiting13:05
ubuntouristmulbah, were you able to open both of the files I sent in e-mail? ( tboimah wrote and said he didn't know what to do with the two files, but I never heard from you)13:05
ubuntouristmulbah, were you able to watch the movie and read the README files that were included?13:05
mulbahyeah13:06
mulbahthe both of us did13:06
mulbahI and tboimah13:06
mulbaha13:06
ubuntouristmulbah, Great! Excellent! I was pretty confident you would both figure it out.13:06
ubuntouristOkay, continue13:07
mulbahokay13:07
mulbahshould I post the questions and the command and them explain it13:08
mulbahor just explain the command13:08
ubuntouristI guess just explain -- mostly to optimize our time and network connectivity. Save time.13:09
mulbahokay13:10
*** tboimah has quit (Ping timeout: 480 seconds)13:10
mulbahlocate ly | grep "\.ly$" | wc -l13:10
mulbahThis command locate all files that have ly inside of it and pass the result to wc -l which count the number of lines or files that have ly inside of it and the most is use to viwe it.13:11
ubuntourist"ly" in the file name. Not the file contents. (If you're explaining to future sys admins, you will want to be precise.)13:12
mulbahokay 13:13
mulbahthe \ in the command is an regular expression that represents a group of characters13:13
ubuntouristThe locate by itself would find filenames like "plymoth" which has an "ly" in the name. Using the pipe and passing the list of found files to grep allows us to filter a bit more.13:13
ubuntouristWe will spend a lot of time on filtering using regular expressions. It is a complex topic.13:14
mulbahI'm explaining base on the solution which say Find all LilyPond files on the system using locate and grep13:15
ubuntouristThe regular expression "\.ly$" says "Search for an actual period (period without the slash has a different meaning) followed by "ly" followed by the end of a line. "$" means "end of line" in a regular expression.13:15
ubuntouristRight. I'm just trying to add a bit more detail as you explain. (If you want, I can wait until you finish.)13:16
mulbahit's okay 13:16
mulbahI love that13:16
mulbahthat what i understood from the first command13:18
mulbahthe second command13:18
mulbahwhich is 13:18
mulbahlocate ly | grep "\.ly$" | grep kjcole | wc -l13:18
mulbahgrep "\.ly$" tell it to search for all the files that end with the extention .ly and "grep kjcole" tell it to search in kjcole13:19
mulbahwhich is your home directoris13:20
ubuntouristThe second grep has no weird punctuation in the regular expression. It's just simple alphabet. So, in this situation nothing special. If the line contains "kjcole" anywhere, it is included. If it does not, it is excluded.13:20
ubuntouristRight. Looking for files I own I don't want to screw up systems files or files owned by other users.13:21
mulbahthe command Narrow the list to files owned by you using grep13:22
mulbahlocate ly | grep "\.ly$" | grep kjcole | grep -v "/\." | wc -l13:23
mulbahthis command eliminate files that were auto-generated 13:23
mulbahthe grep -v means don't print matching linse do the opposite and print all of the lines that don't match expression "/\." .13:24
mulbahBecause Directories and files that start with a period are hiding so grep -v "/\." eliminate them.13:24
ubuntouristWell... sort of... 13:24
ubuntouristRight.13:24
ubuntouristThere are other files that are auto-generated too. But I know I don't want files in hidden directories. Those are usually auto-generated or in some other way "special"13:25
mulbahwhat I think is that files that are hadding are files which was auto-generated by some application13:25
ubuntourist"grep kjcole" would find lines containing "kjcole". Adding the "-v" reverses the meaning: "grep -v kjcole" would find all lines that do NOT contain kjcole.13:26
ubuntouristSo here, grep "/\." would find all lines that contain a slash followed by a period -- like "/.config/" 13:27
ubuntouristAdding the "-v" says DON'T show me any files in directories like "/.config" or "/.local" or several other "/.something..." directories.13:28
mulbahHello tmickelson13:29
tmickelsonhello mulbah 13:29
ubuntouristmulbah, The "~/.config/" directory contains configurations (settings, preferences, etc) for many applications. Often, the first time you start an application, it will13:30
ubuntouristadd basic settings for that application to a file in ~/.config -- so, auto-generated. And, some programs need to create temporary data while they work. That stuff is often placed in "~/.local/" directories and files.13:31
ubuntouristThere are others too, but yes, you have the right idea.13:32
ubuntouristcontinue13:32
mulbahokay13:32
mulbahMr. Cole i really don't understand what the FrayedKnotArts means in this command    locate ly | grep "\.ly$" | grep kjcole | grep -v "/\." | grep -v FrayedKnotArts | wc -l   but I know what the grep -v means13:32
ubuntouristcrank up tmate13:32
mulbahokay13:33
ubuntouristOn a machine with both taballs expanded.13:34
mulbahwhat you means by taballs expanded13:35
mulbahI'm not understanding13:35
ubuntouristI sent two tarballs. One with the README and the movie -- which is what you're explaining,13:35
ubuntouristand one with sample data so that you could run the code and experiment.13:36
ubuntouristIf you don't have both, we can work from my machine.13:36
mulbahssh GE6nEdygrr9Cspm3rTTQucYRT@lon1.tmate.io13:37
mulbahtake a look all the command you type doing the recoding is on my screen13:37
ubuntourist(the tbz and tgz are "tarball" files and when you use tar you "expand" or "explode" or "unpack" them.13:38
ubuntouristI'm going to type for a second in your terminal.13:39
tmickelsonjust a reminder that this is a public irc channel so be carful with sending things that give access to your computer13:39
mulbahokay13:39
ubuntouristtmickelson, Yeah... I'm pretty cautious there. But good advice.13:40
ubuntouristmulbah, So "locate ly | most" is showing us all the files with "ly" in the name somewhere.13:40
mulbahsure13:41
ubuntouristHmmm. I just searched the list for "FrayedKnot" and came up empty....13:41
ubuntouristI want you to update your locate database to see if it is out of date.13:42
ubuntouristsudo updatedb13:42
mulbahsudo apt update13:42
ubuntouristNope.13:42
ubuntouristsudo updatedb13:42
mulbahokay13:42
mulbahPermission denied13:43
ubuntourist(apt update will go out to the Internet and update the list of Debian packages available for you to install or upgrade.13:44
ubuntouristupdatedb updates a database on your computer that contains the file names of most files on your computer.13:44
ubuntouristA few are specially protected because they aren't really files exactly. Those give you "permission denied".)13:45
ubuntouristHmmm... Hold a sec. I want to examine my copy of the file I sent you...13:46
ubuntouristWell... It's in my file...13:47
ubuntouristAh. Yoy did not expand the second tarball13:47
ubuntouristdo that now.13:47
ubuntourist(Look at what is on your screen now. It shows a tarball that you  can expand.)13:49
ubuntouristI started by using the locate with most to get a list of files that contain "ly" in the name. While still running most,13:49
ubuntouristI searched the list for "FrayedKnot" and it said it could not find anything in the list.13:50
ubuntouristI thought maybe the list -- the database -- has not been updated recently. So I had you update it. And I tried again.13:51
ubuntouristStill no luck on the second try. So, I looked to make sure my TestData file had FrayedKnotArts in it. It did.13:52
ubuntouristSo I used locate on your machine to see if you had any files with "TestData" in the name. There was only one. A tarball.13:53
ubuntouristzip won't unzip or unpack a tarball...13:53
mulbahokay13:54
ubuntourist(I keep calling it a "tarball" for a reason...)13:54
ubuntourist(You do the same thing you did for the file with the movie...)13:56
ubuntouristYou can check your history... "history  | grep tbz"13:57
ubuntouristand see if that gives you a clue...13:57
ubuntouristHmmm.... Nothing in the history file with tbz except today's experiments???13:58
ubuntouristMaybe you expanded my original file using the GUI instead of the command line?13:59
ubuntourist(I was hoping you would use the command line to expand the original tarball. That's why we worked with them last time.)14:00
ubuntouristBut if you used some GUI application to expand the file then then there would be nothing in the history.14:00
ubuntourist"tarballs" are manipulated with "tar" not "zip".14:01
mulbahMr. Cole can I use this command scriptreplay -t timecodes scripting > reading.txt to save all what you type in the movie doing the scripterplay14:01
*** tmickelson has quit (Ping timeout: 480 seconds)14:01
ubuntouristThe movie doesn't contain the part where I created the test data. I created that after I sent the movie.14:02
ubuntourist(And the movie is too slow to watch right now.)14:02
ubuntouristtar xjvf TestData.tbz14:03
ubuntourist(and then "sudo updatedb" because there will be new files to catalog in the database. It will need an update.)14:03
ubuntouristThere are a LOT of files in the test data, but I made most of them zero bytes in length. So they will not occupy much space on your computer.)14:05
ubuntouristThe list is the list of files that were actually on my computer.. It's all the filenames that contain "ly" somewhere in the filename.14:06
ubuntouristsudo updatedb14:06
ubuntourist(It will give you the two "Permission denied" again.)14:06
*** tmickels1n has quit (Ping timeout: 480 seconds)14:06
ubuntouristAnd eventually, will finish, with all the new file names added to the database.14:07
ubuntouristIn 23 minutes, I need to take a 5-second break. I promised I would remind my  wife when it was 10:30 our time. It will only take a few seconds.14:08
mulbahokay14:08
ubuntouristGreat. Now 14:09
ubuntouristlocate FrayedKnotArts14:09
ubuntouristlocate FrayedKnotArts | most14:09
ubuntouristSo. To answer your question:14:10
mulbahwow thanks14:11
ubuntouristI said at the beginning of the README that I only wanted files that I created. The files you are looking at now weren't14:11
ubuntouristauto-generated, but I downloaded them from a company  called Frayed Knot Arts. I didn't create them myself.14:11
ubuntouristSo I don't want them in the list.14:12
ubuntourist("q" to quit.)14:12
ubuntouristYou now have a huge list of empty files, plus a few that have a little bit of text in them.14:13
ubuntouristYou should be able to experiment with all of the commands in the movie and README and they should work:14:13
mulbahokay14:14
ubuntouristYou can see on the screen now that you have a directory named "kjcole" in a directory named "home".14:14
ubuntouristYou have lots of files with "ly" somewhere in the name.14:14
ubuntouristYou have the FrayedKnotArts directory, etc.14:15
*** shmohamud has quit (Remote host closed the connection)14:15
ubuntouristIf I've done everything right, all of the commands in the README and movie should do what they are supposed to do.14:16
ubuntourist(I might have made a mistake. I did not do extensive testing. But I think it's all working.)14:16
ubuntouristSo you can continue with your explanation now that your question about FrayedKnotArts is answered.14:17
*** tmickelson has quit (Ping timeout: 480 seconds)14:19
mulbahlocate ly | grep "\.ly$" | grep kjcole |grep -v "/_lilypond" | egrep -vi "(cache|/\.)" | most14:21
mulbahthis command eliminate any lines with "/." directories or cached files14:23
ubuntouristWhen you want to ignore case so that ABC, abc, AbC, ABc, all match a regular expression like "abc", using "-i" works.14:23
ubuntouristSo the part "cache" will match "Cache", "CACHE", "cache" etc.14:24
ubuntouristWhen you want to include or exclude more than one pattern at the same time, you can use "egrep" and parenthesis and the pipe:14:24
ubuntourist"(cache|/\.)" splits apart like this    (   cache     |    /\.    ) and means either "cache" or "/."14:26
ubuntouristthe -vi means "exclude and ignore case.14:27
mulbahthe egrep -vi say don't print matching lines and ignores matching lines14:27
ubuntouristI could have shortened the whole thing this way:14:27
mulbahsure the -i means Ignores, case for matching14:28
ubuntouristlocate ly | grep "\.ly$" | grep kjcole | egrep -vi "(/_lilypond|cache|/\.)" | most14:28
ubuntouristBecause I want to exclude "/_lilypond" and "cache" and "/."  I could combine one of the "grep" with the "egrep"14:30
ubuntouristTime for me to remind my wife about the time... Back in a few seconds...14:30
mulbahthe () is a regural expression which group thing14:30
mulbahright14:30
ubuntouristBack again. Right: Parenthesis create a regular expression group.14:31
ubuntouristcontinue.14:32
mulbahthe  egrep -vi "(/_lilypond|cache|/\.) in this locate ly | grep "\.ly$" | grep kjcole | egrep -vi "(/_lilypond|cache|/\.)" | most command say:14:34
mulbahexclude and ignore all files that is hadding or cached files or in _lilypond14:38
ubuntouristRight.14:39
ubuntourist(You don't have to type the whole command each time. You can just type the new parts in your explanations.)14:39
ubuntouristI think this is a good place to stop for today.14:39
ubuntouristWe are approaching the part of the script that gets more complicated.14:39
mulbahI will read more on it and practice it14:39
ubuntouristNow you have data to practice with.14:40
ubuntouristRemember: If you add lots of new files or delete lots of files -- including "apt install" which will add new files to your system --14:41
ubuntouristyou should "sudo updatedb"14:41
ubuntouristYou don't have to do it EVERY time you add or delete or move files, but it is a way to keep your list of files on your system14:42
ubuntouristup-to-date. 14:42
mulbahokay14:42
mulbahMr. Cole I was practicing on the regural expression should I should you it is the terminal14:42
ubuntouristYou can always use "find" and it will find all your files -- though sometimes you will need to use "sudo find"14:43
ubuntouristfor files that you do not have permission to see. But "find" can be very, very, slow if you tell it to search for everything14:43
ubuntouristI mean if you use "find / ..." you are searching from the root directory and it will take a long time to find files.14:44
ubuntouristCompare:14:44
ubuntouristCompare the time taken for:14:45
ubuntouristlocakte ly14:45
*** tmickelson has quit (Remote host closed the connection)14:45
ubuntouristsudo find / -name "*ly*"14:45
ubuntouristlocate ly        and          sudo find / -name "*ly*"14:46
ubuntouristwill do basically the same thing, but one will be a LOT faster than the other.. The disadvantage is that 14:47
ubuntourist"locate" only finds files since your last "updatedb" while "find" does not have that limitation.14:47
ubuntouristQuestions?14:47
ubuntouristSorry. I see you had a question about regex. But I don't understand the question.14:49
mulbahwhat is the different b/w find and locate command because they function almost the same and which one is more preside to use14:49
ubuntouristfind is more powerful but slower: fiind knows about file names, permissions, owners, creation time, size, etc.14:50
ubuntouristfind checks every  file for all of that information.14:51
mulbahno I wanted to show you what I learn of the regular expression doing my research14:51
ubuntouristupdatedb makes a special file that contains only the names of all the files on your computer. It does not store14:51
*** tmickelson has quit (Quit: leaving)14:52
ubuntouristfile size, ownership information, permissions, etc. It stores only the file names. locate uses that special file14:52
ubuntouristand because it does not have all that extra data in it, it is very fast to search.14:52
ubuntouristTry this14:52
ubuntouristsudo find / -size +500M14:53
ubuntouristThat's a dash not a tilde14:54
mulbahpermission denied14:54
ubuntouristInstead of using "-name" which is what locate uses too, "-size +500M" says "Find all files on the system that are 500 megabytes or larger"14:55
ubuntouristThere aren't many. And, find also tries to examine "weird" stufff which is why there are more error messages.14:56
ubuntouristBut I can see that the Linux System Adminstration Course video is larger than 500 MB...14:56
mulbahyeah14:57
ubuntouristAnd the ubuntu-22.04 ISO file... So when you're running out of disk space, searching for large files that maybe you don't need14:58
ubuntouristany more, can be helpful.14:58
ubuntouristGo ahead and show off your regex skills.14:58
mulbahAlright!14:58
ubuntouristFor now, don't worry too much about typing mistakes in the comments. 15:00
ubuntouristOK, be careful -- wildcards and regexes are similar but not the same:15:02
ubuntouristfor example, in a wildcard expression "*" means "any character, any number of times". 15:03
ubuntouristin a regex, you would need to say ".*" with a period.15:03
ubuntouristso "ls *.py" would be written "ls | grep ".*\.py$"15:04
ubuntouristls | grep ".*\.py$"15:04
ubuntouristThink of wildcards as a much simpler system of regex. You can do a lot more with regex, but it15:05
ubuntouristis very hard to remember all of that. Wildcards are easier to remember, and you will use them a little more frequently.15:06
ubuntouristThe expression you just wrote means:15:06
ubuntourist"any number of the s character, including none, and a t character"15:07
mulbahsearch for file that have s and t15:07
ubuntouristThis instead:15:07
ubuntouristls | grep "s.*t"15:08
ubuntouristThat means "find an s followed by any number of ANY character followed by a t"15:08
ubuntouristAddiing the "." makes the difference here.15:09
mulbah. is an regular expression which replaces any characters15:09
mulbahright?15:10
ubuntouristRight. And "*" means zero or more of the character that comes  before it.15:10
ubuntouristSo "s*" means zero or more "s" characters, but ".*" means zero or more of ANY character.15:11
mulbah? means matches exactly one character15:11
ubuntouristRight again.15:11
ubuntouristOOPS. Wrong.15:11
ubuntourist? means exactly ZERO or ONE character.15:12
ubuntourist+ means at least one. One or more.15:12
mulbahso if you use ???? it means match 0 or 4 character 15:12
ubuntourist* mean zero or more15:12
ubuntouristNope. The "*", "+" or "?" are only couters. they do not tell you WHAT. They only tell you HOW MANY.15:14
ubuntouristIt is what comes before them that answers WHAT15:14
ubuntouristSo ".?.?.?.?" would be "zero to four" of any  character.15:15
mulbah^ means matches start of string and and represents characters not in the string15:15
ubuntouristI really need to go 15:15
mulbahOkay Mr. Cole15:15
ubuntouristYes. "^" is for start of a string and "$" is for end of a string.15:15
mulbahThanks for today15:16
ubuntouristBut like I've said regular expressions (regex) are very complicated to learn. We'll work with them a lot, but they can be very confusing.15:16
ubuntouristAlso very important to know about.15:16
ubuntouristBye!15:16
mulbahI will email you questions on regular expression this coming week15:16
mulbahBye!15:16
*** ubuntourist has quit (Quit: Leaving)15:16
mulbahWow today was great15:17
mulbahhello tboimah15:20
*** tboimah has quit (None)15:21
*** shmohamud has quit (Remote host closed the connection)15:23
*** shmohamud has quit (Remote host closed the connection)15:48
*** mulbah has quit (Quit: Leaving)15:52
*** shmohamud has quit (Remote host closed the connection)17:26
*** shmohamud has quit (Remote host closed the connection)17:41
*** shmohamud has quit (Ping timeout: 480 seconds)17:53
*** shmohamud has quit (Ping timeout: 480 seconds)19:36
*** shmohamud has quit (Remote host closed the connection)20:38
*** shmohamud has quit (Remote host closed the connection)21:00
*** shmohamud has quit (Ping timeout: 480 seconds)21:12
*** shmohamud has quit (Remote host closed the connection)21:30
*** shmohamud has quit (Ping timeout: 480 seconds)21:49
*** shmohamud has quit (Remote host closed the connection)22:24
*** shmohamud has quit (Remote host closed the connection)22:44
*** shmohamud has quit (Remote host closed the connection)22:46

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