IRC log of #novawebdev for Monday, 2023-07-24

*** shmohamud has quit (Ping timeout: 480 seconds)00:26
*** shmohamud has quit (Ping timeout: 480 seconds)01:57
*** shmohamud has quit (Ping timeout: 480 seconds)03:18
*** shmohamud has quit (Ping timeout: 480 seconds)03:57
*** shmohamud has quit (Ping timeout: 480 seconds)05:03
*** shmohamud has quit (Ping timeout: 480 seconds)07:34
*** shmohamud has quit (Ping timeout: 480 seconds)10:04
*** shmohamud has quit (Ping timeout: 480 seconds)11:06
*** mulbah has quit (Ping timeout: 480 seconds)12:16
mulbahclear12:17
*** mulbah has quit (Ping timeout: 480 seconds)12:35
*** mulbah has quit (Remote host closed the connection)12:55
*** mulbah has quit (Read error: Connection reset by peer)12:59
mulbahHello Mr. Cole13:00
mulbahHow are you doing 13:00
ubuntouristHi. As always, half-asleep, but functional 😉13:01
ubuntouristSorry about missing last Friday.13:01
ubuntouristHow are you and who's here?13:02
mulbahI'm good 13:02
ubuntouristmulbah, looks like just you here for now. Are we expecting scooper and tboimah?13:03
mulbahI really don't think that they will show up13:04
ubuntouristI think I'm just going to start and they can catch up via the logs and talking with you.13:04
ubuntouristSo, can you summarize for me what you learned last Monday and any experiments and learning you've done this week?13:05
ubuntouristI will be continuing from what we talked about on Monday, but want to be sure you remember and understand.13:05
mulbahokay13:07
mulbahlet me start by saying we first started on the ZIP file13:08
mulbahunderstanding that ZIP is a common file format that's used to compress one or more files together into a single location13:09
mulbahand also that apt's companion program is "dpkg" for "Debian Package"13:12
mulbahthat dpkg -l list all the file that have been installed on a computer13:13
mulbahand we used that to check if tmate is install on the server13:14
ubuntouristAll the "packages", not all the files. The reason I wanted to talk about ZIP was because a Debian package is like a fancy ZIP file.13:15
mulbahthanks for the correction13:16
ubuntourist"dpkg -l" shows the names of the packages. It does not show the files that are in the package.13:16
ubuntouristBut we can make a short detour right now to talk about that before we get to the next part of last week.13:17
ubuntouristCrank up your tmate...13:17
mulbahMr. Cole I really don't understand this egrep -cr "^[[:space:]]*#" * 2> command too good13:17
mulbahssh B9vs6nfGgGxCPtUqbhzjHPMbx@lon1.tmate.io13:18
ubuntouristnow:13:19
ubuntouristdpkg -L tmate | most13:19
ubuntourist(use an upper-case L this time.)13:19
ubuntouristACTION waits...13:20
mulbahMr. Cole give me tow minutes I want to do something13:21
ubuntouristOK.13:21
mulbahACTION is back13:23
mulbahdone13:24
ubuntouristThat command lists the files that are contained in a package. In this case, you are seeing what the tmate13:24
ubuntouristpackage had zipped up inside of it.13:24
ubuntouristWhen you "apt install" it downloads the package and expands the compressed files and puts them in the locations you see13:25
ubuntouristin that list.13:25
ubuntouristThree important picees we can see in that list are:13:26
ubuntourist1. The executable program "tmate" is in /usr/bin/tmate13:26
ubuntourist2. The manual page for tmate is /usr/share/man/man1/tmate.1.gz13:26
ubuntourist3. Additional documentation is in /usr/share/doc/tmate, but it doesn't look too interesting: a copyright file and a changelog13:27
ubuntouristWhen you use "dpkg -L" followed by a package name, it is useful to know if any of the files are in .../bin/... or .../man/... or .../doc/...13:29
ubuntouristdirectories. If there's something in /usr/bin, it means you can type it on the command line (whatever shows after /bin/)13:29
ubuntouristIf there's something in a .../man/... directory, it means you can type "man ..." and whatever comes before the number and gz.13:30
ubuntouristSo, the "tmate" part of the line "/usr/share/man/man1/tmate.1.gz" tells me there is a "man tmate"13:31
ubuntouristand sometimes, there are lots of files in the documentation directories.13:31
ubuntouristType "q" and try listing the contents of another package. You choosse the package you are interested in.13:32
ubuntouristRemember, you know how to get a list of all packages. So you can choose from that list.13:32
mulbahsure13:34
mulbahby typing dpkg -l13:34
ubuntouristYep. And you can either scroll through the whole list with most or use grep to choose something from the list.13:35
ubuntouristI suggest choosing something you recognize. There are so many to choose from...13:36
ubuntouristEither the name of a program you type on the command line or an application you use a lot....13:36
*** shmohamud has quit (Ping timeout: 480 seconds)13:37
ubuntouristdpkg -l | grep ...13:37
ubuntouristand replace ... with the name of a package that you think might be in the list...13:38
ubuntouristThen, if you get an answer you like, use that package name with "dpkg -L" to see what's inside it.13:38
ubuntouristOK. So, now, what's in that package?13:40
mulbahthe package have Kalapi Gujarati Unicode font13:40
mulbahthe package have "Kalapi Gujarati Unicode font"13:41
ubuntouristThat is a short description of the package, but I want more details... Is there documentation? Where are the fonts? What directory?13:42
ubuntouristRe-read today's chat above. I think you willl see the answer.13:45
mulbahI'm not really understanding the question13:48
ubuntouristClose! Very close!13:49
ubuntouristStop a moment. What does "grep" do?13:50
ubuntourist(Explain what you know about grep.)13:51
mulbahit's using to search for matching patters in a file13:53
ubuntouristRight. That means it needs a pattern to search for..13:54
ubuntouristDon't try anything yet.13:54
ubuntouristNow, explain the the diffference between "-l" and "-L" in the "dpkg" command.13:54
mulbahI think -l is to list little part of a file while -L is use to list all about the file13:56
ubuntourist"-l" provides a list of packages. If you type "-l package-name" it will tell you if "package-name" is installed. If you do only "-l" it lists all installed packages.13:58
ubuntouristit provides a one-line summary of each package, including a very short description.13:58
ubuntourist"-L package-name" lists the CONTENTS of a package: Like a zip file, it lists the files that are inside the package.13:59
ubuntouristTry the last two commands without the "| grep"14:00
*** mulbah has quit (Remote host closed the connection)14:01
ubuntouristThat was not one of the last two commands you typed... Type "q" and look at the last two commands you typed before this one.14:02
mulbahmy connection trip just now14:02
ubuntouristThat was not one of the last two commands you typed... Type "q" and look at the last two commands you typed before this one.14:02
*** mulbah has quit (Remote host closed the connection)14:02
ubuntouristACTION sighs and hates this connection... 14:03
ubuntouristThat was not one of the last two commands you typed... Type "q" and look at the last two commands you typed before this one.14:03
ubuntouristType "history" to see your recent commands.14:04
ubuntouristThat's not it.14:05
ubuntouristNO.14:05
mulbahis that it14:07
ubuntouristLines 392 and 393.... Those were the last two commands you typed. But try without "| grep"14:07
mulbahshould I enter14:09
ubuntourist Either that or add "| most". Both are fine.14:09
ubuntouristNow. Make some guesses: What do you think you are seeing?14:10
ubuntouristACTION is stepping away for a few seconds...14:10
mulbahokay14:11
ubuntouristACTION is back and waiting for your thoughts about what you see...14:13
mulbahI'm seeing the contest of file in fonts-kalapi14:14
ubuntouristcontents (like in a book: table of contents) not contest. contents: what is inside. But, yes.14:15
mulbahsorry that was a mistake14:16
ubuntouristThe package "fonts-kalapi" contains the files that are listed.14:16
ubuntouristThe "dpkg -L" also shows the directories that MAY need to be created, but often are already there and do not need to be created.14:17
ubuntouristInterpret the output on the screen now, like this:14:17
ubuntouristIf there is no "/usr" directory, "mkdir /usr"14:18
ubuntouristIf there is no "/usr/share" directory, "mkdir /usr/share"14:18
ubuntourist...14:18
ubuntouristIf there is no "/usr/share/docs/fonts-kalapi" make that directory too.14:19
ubuntouristFinally put the file "changelog.Debian.gz" in that directory. Also put "copyright" in that directory.14:19
ubuntouristNow, do the same thing with "/usr/share/fonts": If there is no directory, create one... and finally, put a file named "Kalapi.ttf" in the right place14:20
ubuntouristafter creating all the directories to have a place to put it.14:21
ubuntouristSo, now you  know how to list the contents of a package to learn which files are part of the package.14:22
ubuntouristSometimes, you want to do the reverse:  Sometimes, you will see a file in an "ls" command and say "Where the heck did that come from?"14:23
ubuntourist"Why is that file on my system?" "Who put it there?"14:23
ubuntourist"What is it for?"14:23
ubuntouristSo, let's find out. Type "q" to quit.14:24
ubuntouristgo ahead14:25
mulbahokay14:25
ubuntouristSo that's the summary of the package again. It tells you a little bit about what the package does or is used for, and it tells you14:26
ubuntouristthe version of the package, and what kinds of computers the package is good for (the "architecture") This package is good for14:27
ubuntouristall "architectures".14:27
ubuntouristYour computer is using an Intel 64-bit arcitecture. Older computers run a 32-bit arcitecture. Some Apple computers are not14:28
ubuntouristIntel. And the tiny Raspberry Pi computer is not Intel. It is an ARM arcitecture. Some packages only run on one architecture.14:29
ubuntouristtype "q" and "dpkg -l | most" and skim the architecture column. For you, because you are running Intel 64-bit, you will either see14:30
ubuntourist"all" -- meaning this package runs on all architectures, or amd64 which means it runs on any computer that is using14:31
ubuntouristhardware compatible with an AMD 64-bit system including the Intel 64-bit chips.14:31
ubuntourist(27 minutes left)14:33
ubuntouristssh freezing? I'm not seeing anything happening in the terminal...14:34
ubuntouristscroll right14:34
ubuntouristRead the error message. It tells you why that didn't do anything.14:35
ubuntouristWell, it tries. It doesn't do a good job really. But it gives you a hint.14:36
ubuntouristWhat did you think "dpkg -L" would do?14:37
mulbahI think it will not work it will need one package name14:38
ubuntouristRight.14:39
ubuntouristIt lists the contents of a package. Without a package name, it has no idea what contentss you want to list.14:39
ubuntouristBut since we're running out of time, I want to move on a little.14:39
ubuntouristtype "ls /isr/share/doc" 14:40
ubuntouristOOps.14:40
ubuntouristls /usr/share/doc14:40
ubuntouristNow, choose anything from the list, and type "dpkg-query -S /usr/share/doc/..." but replace "..." with something in the list.14:41
ubuntourist(Don't think too hard about what to choose. Anything on the screen now is fine for our example.)14:43
ubuntouristThat was not in the list of what is on the screen.14:44
ubuntouristThere is no "kolleh" on the screen.14:45
ubuntouristOK!14:45
ubuntouristIt just told you that the file (or directory) "/usr/share/doc/zip" belongs to a package named "zip"14:45
ubuntouristYou probably could have guessed that for yourself, but sometimes the file names are not so obvious.14:46
ubuntouristSometimes you will have really odd filenames and not know who they belong to.14:47
ubuntouristDamn. I thought I was going to pick somethng that had a package name that was different... Oh well.14:49
ubuntouristThere's a better example: There is a command in /usr/bin named "unzipsfx"14:51
ubuntouristI asked "which package does it belong to" and I learned that it is part of the "unzip" package.14:51
ubuntouristBut "unzstd" is NOT part of the "unzip" package. It is part of the "zstd" package. So, I am curious:14:52
ubuntouristI don't know anything about the zstd package... Let's learn more.14:53
mulbahokay I will14:53
ubuntouristNow show me what all the files in the package are14:54
ubuntouristlist all the files in the package14:55
ubuntouristSee how this one has more in /usr/share/doc/?14:56
ubuntouristIt alsso has more in /usr/bin --- that means there are several commands in the package, and more in /usr/share/man -- that means14:57
ubuntouristmore manual pages for how to use this package.14:57
ubuntouristScroll down.14:57
ubuntouristOK. So, not too many  files. But eight commands, eight manual pages, and a little more documentation.14:58
ubuntouristOne last thing before quitting for today:14:58
ubuntouristSometimes we want detailed information about where a package was downloaded from, and the name of the individual14:59
ubuntouristor team of developers that are maintaining the package. What if something is broken? What if there is a bug? Who should I report15:00
ubuntouristthe bug to?15:00
ubuntouristSo "q" to quit....15:00
ubuntouristnow "apt-cache show zstd | most"15:00
ubuntouristThis tells us some of the same information from "dpkg -l zstd" but also tells us the "Maintainer" 15:02
ubuntouristIt tells us that the package is not required (it is "optional"15:02
ubuntouristIt tells us where to report bugs.15:02
ubuntouristAnd at the very bottom, it gives a longer explanation: "zstd" is an abbreviation for "Zstandard" and it talks about "real-time compression"15:04
ubuntourist"real-time" usually means the program does something VERY fast.15:04
ubuntouristAnd I mentioned last week that there are different ways to compress a file. Some compress better than others.15:04
ubuntouristThe "compression ratio" is a comparison between the original size of all the files in the "zip" and the size of the final zip file.15:05
ubuntouristIf the zip file is much smaller than the sum of all the other sizes, then it has a very high, good compression ratio.15:06
ubuntourist(But we don't really care: This was just an example. We found a file that we didn't know about, found wich package it belonged to, listed all the other files in the package, and then got detailed information about the pacckage.15:07
ubuntouristls /usr/bin/unz*15:07
ubuntouristdpkg-query -S /usr/bin/unzstd15:08
ubuntouristdpkg -l zstd15:08
ubuntouristdpkg -L zstd15:08
ubuntouristapt-cache show zstd | most15:08
ubuntouristThose 5 commands told us a lot of information about a file named unzstd in the /usr/bin directory.15:09
ubuntouristEach command helped us figure out the next command. ls gave us the filenames, dpkg-query -S told us the package name,  and the other three told us lots about the package.15:11
ubuntouristYou can try that with other files. Find a file in /usr/bin or /usr/share/doc, or anywhere that is not "/home/" -- because those aren't package files. Those are files that a user has created or owns.15:13
ubuntouristTry to figure out which pacckage a file belongs to using "dpkg-query -S" then try to find out information about the package15:13
ubuntouristwith "dpkg -l" , "dpkg -L" and "apt-cache show".15:14
ubuntouristPlay around with those commands until you feel like you understand. You don't have to understand all of the information. 15:15
ubuntouristBut if I ask something like "Where would you  report a bug if the file /usrt/bin.... is broken?" you should be able to use the commands above to figure out that answer.15:16
ubuntourist(... would be replaced with an actual file name, in my question.)15:17
ubuntouristAnd, now we are 20 minutes overtime. So, I'm going to quit now. Good luck experimenting!15:18
mulbah07_okay 15:18
mulbah07_Thanks so much Mr. Cole 15:19
ubuntouristShare the chat with scooper and tboimah, and see if you can work together with the info.15:19
mulbah07_I will15:19
mulbah07_Thanks a lot again 15:19
ubuntouristWe will come back to that ugly "egrep" thing that I was doing last monday at a later time.15:19
ubuntouristBye for now!15:20
*** ubuntourist has quit (Quit: Leaving)15:20
*** mulbah has quit (Ping timeout: 480 seconds)15:23
*** shmohamud has quit (Ping timeout: 480 seconds)16:07
*** mulbah07_ has quit (Ping timeout: 480 seconds)17:21
*** shmohamud has quit (Ping timeout: 480 seconds)18:37
*** shmohamud has quit (Ping timeout: 480 seconds)21:07
*** shmohamud has quit (Remote host closed the connection)22:15
*** shmohamud has quit (Remote host closed the connection)23:43

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