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

*** sysadmin has quit (Ping timeout: 480 seconds)11:37
*** jelkner has quit (None)11:55
*** jelkner has quit (Remote host closed the connection)11:55
*** jelkner has quit (Quit: Leaving)12:02
*** svaye has quit (None)12:02
*** tboimah has quit (Ping timeout: 480 seconds)12:56
mulbahGood morning Mr. Cole14:13
mulbahwe are so sorry we are late14:13
tboimahGood morning ubuntourist14:13
ubuntouristHi, tboimah mulbah 14:15
ubuntouristI wasn't watching my screen.14:15
ubuntouristAnd I'm sorry: I did not find my simple examples for network programming.14:16
ubuntouristSo I was just looking and I found a web page that doesn't look too hard:14:16
ubuntouristhttps://www.geeksforgeeks.org/python-network-programming/14:16
ubuntouristIt offers a VERY basic introduction that shows two Python3 programs communicating, 14:17
ubuntouristbut the programs do not do very much. It is just designed to show you  that Python can14:18
ubuntouristdo networking and it gives you a basic taste of IP numbers and ports.14:18
ubuntouristSo, what have you two been up to since we last met on Friday?14:19
mulbahreading the book14:21
mulbahbut we don't have more time to practice be cause of computer issue14:21
mulbahwe both computer are giving us problem14:22
mulbahso we can on practice if we come to the lab14:22
tboimahsure14:22
ubuntouristuh-oh. Can you document the problems? Hardware? Software? Error messages?14:23
mulbahHardware14:23
mulbahproblem14:23
ubuntouristAs system administrators, you'll want to be able to document such problems and14:24
ubuntouristtry to get someone with control of your budget to fix the problem without buying a completely new14:24
mulbahmy computer keyboard, battery, and chager is giving problem14:24
ubuntouristcomputer.14:24
ubuntouristHow reliable is wall power? I know you've spoken about needing to restart14:25
mulbah*Charger*14:25
ubuntouristgenerators before. But, if you can usually get reliable power from a wall, you can survive for14:26
mulbahwhat is wall power?14:26
ubuntourista long time without a battery.14:26
ubuntouristI mean electrical power that is not coming from a battery. Usually coming from14:26
ubuntouristplugging your computer into a wall.14:27
ubuntouristThe keyboard is another issue altogether.. But you might be able to solve that14:27
ubuntouristby plugging a USB keyboard into a USB socket and using that instead of the built-in14:28
ubuntouristkeyboard. Temporary solutionts, but you need to be creative when solving hardware troubles.14:28
ubuntouristOtherwise, this project will just limp along until it dies.14:29
ubuntouristjelkner, Hi. I learned a new trick:14:29
jelknerGood morning ubuntourist 14:30
ubuntouristjelkner, never mind. I just tried it again, but the trick didn't work. ;-)14:30
mulbahGood morning Jeff14:31
ubuntouristjelkner, C'est la vie.14:31
ubuntouristjelkner, So we're talking a bit about hardware failure on the laptops, and I'm14:31
jelknerubuntourist, i have to report back to you on how your pupil, tboimah was a hero on Saturday14:31
ubuntouristproosing stop-gap measures.14:31
jelknerhmmm.14:31
ubuntourist"proposing"14:32
ubuntouristjelkner, I'll let you run along. Later...14:32
jelknerok, i just finished attendance14:33
*** JulianMolina has quit (None)14:33
jelknerubuntourist, i wanted to share what happened on saturday14:33
ubuntouristjelkner, oops. I misread: Not enough caffeine and thought you had to run off to your students. Please share.14:34
jelkneri am trying to teach a python class from 7 to 9 am on saturdays14:34
jelkneri wanted to use the screen sharing and recording that you taught your students14:34
jelknerscooper thought he had it down, but he didn't14:34
jelknerwe fumbled around for an hour14:34
jelkneruntil..14:34
jelknertboimah showed up and made it all work!14:35
jelknerwe ended up having just the class we were hoping to have14:35
ubuntouristjelkner, So... tmate?  Or script and scriptreplay?  (Or both?)14:35
jelknerall thanks to the sys admin skills of tboimah 14:35
jelknerboth14:35
ubuntouristtboimah, Nice! 14:35
tboimahGood morning yeah14:36
jelknertboimah also wisely suggested i run it from the mcss student server14:36
tboimahyeag14:36
tboimahyeah14:36
jelknerwhen svaye had trouble with terminal size on her own computer14:36
jelknertboimah was skilled, responsive and quick on his feet14:36
jelknera resounding testament to both him and his tutor!14:37
ubuntouristThe server provides a common denominator, and remains up among other things.14:37
jelkner+114:37
jelkneranyway, it worked so well14:37
ubuntourist(No "custom" software that other users don't have if everyone's using the same beastie.)14:37
jelknerit builds my confidence that we are making the kind of progress we need to make14:37
jelknerok, i'll let you work with tboimah and mulbah 14:38
jelknerbut let's plan on getting together sometime early in january14:38
ubuntouristjelkner, my concern is hardware and network failure at this point. The humans are good. ;-)14:38
jelknereither in Clarendon or back at the saloon14:38
jelknerso i need a summary of the hardware14:38
jelknerubuntourist, i need to get 3 of them to pass PCEP14:39
*** Jmolina has quit (Quit: Page closed)14:39
jelknerso that i can go to Monrovia in august14:39
jelkneri'll be bringing more laptops14:39
jelknerand i will be able to work with mulbah and tboimah while i'm there on documenting and maintaining the lab14:39
jelknerthat will be a big help14:39
ubuntouristmulbah, tboimah, hear that, gentlemen? New hardware -- IF folks can pass.14:39
jelknerthey know that14:40
jelkneri need to stop saying it14:40
jelknerit is in their hands now14:40
jelknerbut i want to do all i can to provide support14:40
ubuntouristtboimah, mulbah, you should probably keep a hardware log book and document 14:40
jelknera spreadsheet works best14:41
jelkneri'll show them how to do that when i arrive14:41
ubuntouristhardware failures. Include the date of failure. Or the date when you noticed it. And a unique14:41
jelknerok, gotta go14:41
ubuntouristidentifier for the computer that failed. 14:41
jelknerthanks for all your great work, ubuntourist!14:41
jelknerit is really showing results14:41
jelknerACTION signs off for now...14:42
ubuntouristjelkner, farewell.14:42
*** jelkner has quit (Quit: Leaving)14:42
ubuntouristSo. mulbah, tboimah, Sorry I'm not better prepared with a lesson plan.14:42
ubuntouristthat's entirely my fault for being lazy and distracted.14:43
ubuntouristDo take a look at the web page for simple network in Python code that I pasted above.14:44
mulbahalright14:44
ubuntouristA little more complicated but also a good start:14:45
ubuntouristhttps://realpython.com/python-sockets/14:45
ubuntouristBut you do not need to become expert Python programmers or expert network programmers.14:46
ubuntouristThat is just to give you a "feel" for some of the stuff we've been chatting about. 14:46
ubuntouristOnce you have seen the simple Python programs work, it should give you14:47
ubuntouristinsight: "Oh! So ssh and Firefox and Chrome and web servers are just doing 14:47
ubuntouristmore complicated versions of these simple Python programs! I get it!"14:48
ubuntouristAnyway, since I am unprepared (again) do either of you, tboimah or mulbah14:48
ubuntouristhave questions or tricks you'd like to show off?14:49
*** Jmolina has quit (Quit: Page closed)14:49
ubuntouristtboimah, mulbah, do etiher of you have a virtual computer running with an OS installed?14:50
mulbahYeah14:51
ubuntouristACTION wonders if it is possible to tmate into a virtual machine... Probably "yes" but there may be a special trick to it...14:52
ubuntouristmulbah, what are you running? (Which distribution, which release?)14:53
ubuntouristmulbah, "lsb_release -a" provides the answer to that question.14:54
tboimah  ubuntun14:54
mulbahunbuntu14:54
ubuntouristtboimah, which release of Ubuntu?14:54
mulbah2414:55
ubuntouristmulbah, that's not a release number. I'm guessing you mean 22.04?14:55
mulbahyeah14:55
tboimah20.0414:55
ubuntouristUbuntu release numbers refer to the year and month of release.14:56
ubuntouristSo that is from April 2022. It is the most recent Long-Term-Support (LTS) release14:56
ubuntouristand is the most stable. There are releases between LTS releasses that happen every  six months.14:57
ubuntouristSo there is a 22.10, a 23.04, and a 23.10 release. But because we14:58
ubuntouristare already into December, we should not upgrade. The next LTS release is April 2024.14:58
ubuntouristUpgrading from one release to another is a more complex and tricky process than "apt update".14:59
ubuntouristWhen upgrading to a new release ALWAYS go from an LTS to an LTS. Or...15:00
ubuntouristif you choose to experiment on your own, DO NOT SKIP any release. 15:01
ubuntouristSo, for example, it is okay to go from 22.04 to 24.04. But it is NOT OKAY15:01
ubuntouristto go from 22.04 to 23.10. If you want to get to 23.10, you would need to upgrade15:02
ubuntourist22.04 to 22.10. Then 22.10 to 23.04. Then 23.04 to 23.10.15:02
ubuntouristWhen you upgrade to a new release, it often REMOVES application packages that you have15:03
ubuntouristexplicitly installed, because the new opearating system release has new "shared libraries" that 15:03
ubuntouristmay not be compatible with some applicatioon you have installed.15:04
ubuntouristThink about Python and the "import" statement: Let's say that you created15:05
ubuntouristsome Python program that is really helpful to you. And your Python program uses a lot of import15:05
ubuntouriststatements.15:05
ubuntouristNow, you do a major upgrade, and all of the Python libraries change. In the new version,15:06
ubuntouristsome function that you  have imported gets new features, and is called with different arguments.15:06
ubuntouristSuppose, suddenly, print is no longer15:07
ubuntouristprint("Hello world") 15:07
ubuntouristbut now it is 15:07
ubuntouristprint(language="english", text="Hello world")15:07
ubuntouristAll of your old code is now broken, because your old print() syntax in incorrect.15:08
ubuntouristSo, when you are upgrading releases, if the release does not include an application that you have15:09
ubuntouristexpliciitly installed, the upgrade process might remove it.15:09
ubuntourist(might remove it because it doesn't know if your application uses a library that was updated.)15:10
ubuntouristtboimah, mulbah have either of you used a program named "pip"?15:11
mulbahno we haven't be we have hear about it15:11
ubuntouristOK. This is another IMPORTANT thing for a systems administrator to know:15:12
ubuntouristUnfortunately, in the current state of Linux,  there are competing packaging15:13
ubuntouristsystems that often do not play nicely together, but live on the same computer..15:13
ubuntourist"apt" (and its sister "dpkg") are the king and queen: They  work well together,15:14
ubuntouristand maintain the health of most of your operating system. Whenever you need15:14
ubuntouristto install or upgrade an application, look hard for a Debian (or Ubuntu) package:15:15
ubuntouristThat will mean that the package is able to be maintained by apt and dpkg.15:15
ubuntouristBut here's the problem:15:16
*** tboimah has quit (Ping timeout: 480 seconds)15:16
ubuntouristtboimah, mulbah, actually before I continue, let me open a tmate session on the server...15:16
mulbahalright15:17
ubuntouristssh xu2W8hYmfY2jrQjSxwYRBqfrn@lon1.tmate.io15:17
mulbahconnection close15:18
ubuntouristHmmm...15:18
ubuntouristTry again... I'm gussing that's a network glitch.15:18
ubuntouristAh, there we go.15:19
ubuntouristtboimah, mulbah, actually before I continue, let me open a tmate session on the server...15:20
ubuntouristssh xu2W8hYmfY2jrQjSxwYRBqfrn@lon1.tmate.io15:20
ubuntouristmulbah, let's wait a second for tboimah to catch up / tmate in.15:20
ubuntouristdpkg --get-selections | grep "^python3" | most15:23
mulbahMr. Cole tboimah computer when off15:25
ubuntouristPoo.15:25
ubuntouristOK I'll go back to putting the comments here. GIve me a second...15:26
ubuntouristSo the dpkg list is what Ubuntu knows about. apt and dpkg will 15:26
ubuntouristkeep track of these, upgrade them and maintain them.15:26
ubuntouristAnd they will keep track of "dependencies". Let's look at dependencies15:27
ubuntouristfor a minute. I'm going to pick a package from that list of python3 packages...15:27
ubuntouristapt-cache show python3-jinja215:28
ubuntouristThe description says "Jinja2 is a template engine written in pure Python."15:29
ubuntourist(It gives more information too.)15:29
ubuntouristapt-cache depends python3-jinja215:30
ubuntouristBecause jinja2 is a python package, obviously, it cannot work if there is no Python interpreter.15:31
*** tboimah has quit (Ping timeout: 480 seconds)15:31
ubuntouristTherefore, python3 is a "dependency" Jinja2 depends on Python 3.15:31
ubuntouristThe dependency list also tells us that installing pytjon3-jinja2 will BREAK 15:32
ubuntouristan older package named python-jinja2. It even tells us that python3-jinja2 15:33
ubuntouristreplaces python-jinja2.15:33
ubuntouristSo. package depend on other packages.15:33
ubuntouristIf you remove a package, apt and dpkg will tell you "Hey, you are removing a package that15:34
ubuntouristsome other package depends upon. Do you want me to remove all of them? Or do you want to stop,15:34
ubuntouristand I will remove NONE of them?"15:34
ubuntouristIf I were to say "sudo apt remove python3" I would get a huge list15:35
ubuntouristof dependencies.15:35
ubuntouristIt would try to remove 41  other packages15:36
ubuntourist(Well probably more. That is a conservative estimate based on15:36
ubuntouristdpkg --get-selections | grep "^python3" | wc -l15:36
ubuntouristHeres the problem:15:37
ubuntouristPython has its own, independent package manager named pip.15:37
ubuntouristThe command "pip list" will show us what Python knows about15:38
ubuntouristOh look! 15:38
ubuntouristdpkg --get-selections | grep "^python3" 15:38
mulbahyeah15:39
mulbahpip or pip315:39
ubuntouristshowed us a package named "python3-jinja2"  BUT 15:39
ubuntouristpip list 15:39
mulbahyou can use them to install python module15:39
ubuntouristalso shows us a package named "Jinja2"...15:39
mulbahlike "pip install gasp"15:39
ubuntouristBIG PROBLEM: If you use "pip" to upgrade, it MIGHT upgrade Jinja2 to a new version...15:40
ubuntouristBut apt and dpkg will NOT know about the change!!! You've just "hosed" (American slang for15:41
ubuntouristhopelessly broken) something.15:41
ubuntouristIf there is a Debian package named "python3-gasp" you should almost always15:42
ubuntouristsudo apt install python3-gasp15:43
ubuntouristinstead of 15:43
ubuntouristsudo pip install gasp15:43
ubuntouristThere are better ways to handling this. jelkner has probably talked about at least one:15:44
mulbahyou are not force to use sudo15:44
mulbahyou can just use "pip install gasp"15:44
mulbahand it will work15:45
ubuntouristYou can create Python virtual environments or use pip to install packages locally.15:45
ubuntouristBut it is still very important to understand that packaging systems can compete with each other.15:45
ubuntouristAlso, if you are using "pip install" on a server without "sudo" you  are installing for ONE user15:46
mulbahso Mr. Cole which you think will be preface to use to install "pip or pip3"15:46
mulbahoh okay15:46
ubuntouristmulbah, pip3. I was just typing pip because I am lazy and on my system I have an alias so that pip means pip3.15:47
ubuntouristBut the problem doesn't change. If you use pip3 with sudo, so that it installs for ALL users,15:48
ubuntouristthen you have broken the Debian package that installs the same stuff.15:48
mulbahalright15:49
ubuntouristBecause jelkner has taught you to not use sudo for pip, then you are okay... with Python. You will still need15:50
ubuntouristto remember to do it for every user instead of just once, but that's okay. 15:50
mulbahNo it was not jeff that taught me that15:51
ubuntouristBut what about the programming language Rust? It uses "rustup" to maintain Rust packages. 15:51
mulbahI learn that on my own15:51
ubuntouristOr the Perl programming laingage? It uses "cpan" to maintain Perl packages.15:51
ubuntouristThe point I'm trying to make is that you really want to be careful if you need to upgrade something.15:52
ubuntouristSuppose there is a Debian package for GASP -- python3-gasp. But, someone has improved GASP without 15:53
ubuntouristcreating a new Debian package with the improvements. You need to ask yourself "Do I REALLY need that new15:54
ubuntouristfeature for ALL users? Or can I wait?"15:54
ubuntouristIf you can wait, you will be safer waiting until "apt full-upgrade" offers a new version of python3-gasp.15:55
ubuntouristIf you really  cannot wait, you can upgrade for everyone with "sudo pip install -U gasp"15:56
ubuntouristSo, getting back to releases...15:57
ubuntouristIn April 2024, we will be upgrading our systems from 22.04 LTS to 24.04 LTS.15:57
ubuntouristAnd dependencies will break. And packages will be removed. And MAY need to be reintalled, if they15:58
ubuntouristare important enough.15:58
ubuntouristFor example, maybe the upgrade will remove tmate.15:58
ubuntouristWe will need to find and install tmate again or find a substitute program that provides the same function.15:59
ubuntouristOne thing that I do regularly:15:59
ubuntouristdpkg --get-selections > installed_debs.txt16:00
ubuntouristpip2 freeze           > installed_pip2.txt16:00
ubuntouristpip3 freeze           > installed_pip3.txt16:00
*** mulbah has quit (Ping timeout: 480 seconds)16:01
ubuntouristThis gives me three lists file: All of the Debian / Ubuntu packages, all of the old, obsolete pip2 packages and all of the pip3 packges16:01
ubuntouristThen, before I do a major release upgrade, I save those files somewhere safe.16:02
ubuntouristAfter the upgrade, I go through my "Captain's Log" journal, where I keep a diary of16:02
ubuntouristall of my activities, plus I look at those three files to determine if there is anything that I use a lot16:03
ubuntouristthat I really need to re-install.16:03
ubuntouristAnd, I see that we are over time for today and you've dropped out.16:03
ubuntouristSo I will call it quits.16:03
*** ubuntourist has quit (Quit: Leaving)16:04
*** mcssguest_ has quit (Ping timeout: 480 seconds)16:09
*** shmohamud has quit (Remote host closed the connection)22:33

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