Introducing the Rust 101 series and how to install Rust.

Rust 101 is a series of videos explaining how to write programs in Rust.

How to install Rust: https://rustup.rs/
Slides: http://artificialworlds.net/presentations/rust-101/0-intro
Exercises: https://101-rs.tweede.golf/0-install/mod.html

Follow the “Exercises” link to find the other tools you might want to install to follow along.

The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

Duration: 9min 44sec


This project is on-going, is hosted on PeerTube, and we aren’t too far behind, so I thought it might be of interest.
Playlist so far: https://diode.zone/w/p/xesbWmNanEHNBfJCZFQRUm

  • maegul@lemmy.mlM
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 months ago

    So this actually looks great, and all fediverse too (on Peertube, fediverse answer to YouTube)!

    FYI, you can subscribe to Peertube channels on lemmy.

    In this case, search “ [email protected]” in the lemmy search (you can specify a community search if you like). You may have to repeat this a few times as you server goes fetches the meta data. Once it shows up you can subscribe and start pulling in content into your instance.

    Unfortunately older posts don’t come through, such as these videos.

    But, you can just run a lemmy search for a video’s URL, and repeat it a couple of times if necessary, and Lemmy will go and fetch it.

    This way, the videos look like posts in lemmy, which we can cross post and comment on. Commenting on particular should be cool because the video author themselves will get them and probably reply.

    I might go ahead and do all of that myself for my instance and provide a link to their channel from the side bar.

    • freamonOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 months ago

      Subscribing to his channel from Lemmy never even occurred to me (?!)

      Now is as good a time as any though to investigate Lemmy/PeerTube interactions:

      The search that lemmy will do:
      curl --header 'accept: application/activity+json' https://diode.zone/.well-known/webfinger?resource=acct:[email protected] | jq .
      The ‘activity+json’ links section reveals that the url is https://diode.zone/video-channels/andybalaam_lectures

      ‘Click’ on that:
      curl --header 'accept: application/activity+json' https://diode.zone/video-channels/andybalaam_lectures | jq .
      Interesting parts:
      ‘type’ is Group, which is what lemmy uses for communities
      there’s no ‘moderators’ link, so that’ll be empty on the community page
      ‘outbox’ is at https://diode.zone/video-channels/andybalaam_lectures/outbox which lemmy should be able to use to fetch the recent videos. It doesn’t work because community outboxes on Lemmy just list the last 20 posts directly, whereas PeerTube (and Mastodon) redirect you to a ‘outbox?page=1’ url.
      ‘playlists’ is at https://diode.zone/video-channels/andybalaam_lectures/playlists, which is what we want really (the Rust 101 playlist)
      These are of type Playlist though, which Lemmy doesn’t know what to do with.

      Following the ‘playlist’ link:
      –> https://diode.zone/video-channels/andybalaam_lectures/playlists?page=1 (posts 1 to 10)
      –> https://diode.zone/video-channels/andybalaam_lectures/playlists?page=2 (post 11)

      Bash script to get the URLs

      #!/bin/bash
      
      curl --silent --header 'accept: application/activity+json' "https://diode.zone/video-playlists/fcec1b54-0908-452e-9d35-84c9627c3b50?page=1" > /tmp/page1.json
      curl --silent --header 'accept: application/activity+json' "https://diode.zone/video-playlists/fcec1b54-0908-452e-9d35-84c9627c3b50?page=2" > /tmp/page2.json
      
      for i in {0..9}
      do
          item=$(jq -r ".orderedItems[$i]" /tmp/page1.json)
          url=$(curl --silent --header 'accept: application/activity+json' "$item" | jq -r .url)
          sleep 1.1s
          echo $url
      done
      
      item=$(jq -r ".orderedItems[0]" /tmp/page2.json)
      url=$(curl --silent --header 'accept: application/activity+json' "$item" | jq -r .url)
      echo $url
      

      gives us:

      https://diode.zone/videos/watch/f8e9baa2-9f19-4061-91f4-2d35fada767e                  
      https://diode.zone/videos/watch/6b08bb1f-b3ef-40d4-addf-cf45e1da1a7a                  
      https://diode.zone/videos/watch/020c07e6-f124-4b3e-8270-cc2d21bf9c67               
      https://diode.zone/videos/watch/9766d1f1-6018-48ec-ad67-e971758f8a3a                 
      https://diode.zone/videos/watch/567552a8-34df-4a00-b598-c92d903329fb               
      https://diode.zone/videos/watch/8be50e04-2cd1-4e2d-8f27-61dc1dc51170             
      https://diode.zone/videos/watch/90e5627c-caa8-47a7-b7b6-74bb79a26977             
      https://diode.zone/videos/watch/a1604d25-d0b0-4e2c-baf4-3a2b193708e0             
      https://diode.zone/videos/watch/a752daf8-60c2-46d7-a36f-7d7fcda9a0a5           
      https://diode.zone/videos/watch/659f9b07-11c7-4f52-9e8e-becce02e40fe           
      https://diode.zone/videos/watch/03735b5f-8ace-411c-998e-7c4a58a11914           
      

      I used endlesstalk.org’s Search to bring most of these through, before getting bored and using the API. e.g.:

      curl --request GET \
           --url 'https://endlesstalk.org/api/v3/resolve_object?q=https://diode.zone/videos/watch/03735b5f-8ace-411c-998e-7c4a58a11914' \
           --header 'accept: application/json' \
           --header 'authorization: Bearer $MY_JWT_TOKIN'
      

      So the bash script could easily be modified to resolve everything as well.