[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.02,0:00:03.41,Default,,0000,0000,0000,,Hi, can everyone hear me okay? Dialogue: 0,0:00:03.41,0:00:06.58,Default,,0000,0000,0000,,Okay, so welcome back to Dialogue: 0,0:00:06.58,0:00:09.35,Default,,0000,0000,0000,,the missing semester of your CS education, Dialogue: 0,0:00:09.35,0:00:12.41,Default,,0000,0000,0000,,today we're having as a \Nlecture topic "potpourri" Dialogue: 0,0:00:12.41,0:00:15.17,Default,,0000,0000,0000,,It's gonna be some miscellaneous\Ncombination of topics Dialogue: 0,0:00:15.17,0:00:18.82,Default,,0000,0000,0000,,that we the instructors find\Nthat are interesting Dialogue: 0,0:00:19.00,0:00:21.20,Default,,0000,0000,0000,,But none of them were on their own lecture Dialogue: 0,0:00:21.20,0:00:24.90,Default,,0000,0000,0000,,because they're certain topics that \Nwe just want you to know about Dialogue: 0,0:00:24.90,0:00:27.51,Default,,0000,0000,0000,,because they can be really helpful Dialogue: 0,0:00:28.64,0:00:33.06,Default,,0000,0000,0000,,And since we're not gonna delve into\Na lot of detail in the topics Dialogue: 0,0:00:33.06,0:00:36.97,Default,,0000,0000,0000,,If you're more interested about them just\Nfeel free to come and ask us questions Dialogue: 0,0:00:36.97,0:00:40.87,Default,,0000,0000,0000,,at the end or as we go over \Nthem in the lecture Dialogue: 0,0:00:40.87,0:00:45.66,Default,,0000,0000,0000,,So the first thing I want to talk about \Nis keyboard re-mappings Dialogue: 0,0:00:46.18,0:00:48.46,Default,,0000,0000,0000,,So by now you probably realized that Dialogue: 0,0:00:48.46,0:00:52.47,Default,,0000,0000,0000,,we have encouraged you to use the\Nkeyboard as your main input method Dialogue: 0,0:00:52.47,0:00:55.15,Default,,0000,0000,0000,,so for example, when we went\Ninto the editors lecture, Dialogue: 0,0:00:55.15,0:00:59.64,Default,,0000,0000,0000,,one of the main ideas of Vim was using\Nyour keyboard as much as possible Dialogue: 0,0:00:59.64,0:01:05.11,Default,,0000,0000,0000,,so you don't have to rely on going to the\Nmouse because going to the mouse is slow Dialogue: 0,0:01:05.21,0:01:08.46,Default,,0000,0000,0000,,And the thing is your keyboard, as with\Nmany things in your computer Dialogue: 0,0:01:08.46,0:01:11.60,Default,,0000,0000,0000,,is nothing kind of magical,\Nit can be configured Dialogue: 0,0:01:11.60,0:01:16.74,Default,,0000,0000,0000,,And it's worth configuring because a lot\Nof the defaults might not be optimal Dialogue: 0,0:01:16.99,0:01:22.14,Default,,0000,0000,0000,,The most simple modification that you\Ncan do is just to remap keys Dialogue: 0,0:01:22.45,0:01:25.59,Default,,0000,0000,0000,,So one of the things we alerted\Nin the editor lecture Dialogue: 0,0:01:25.59,0:01:28.43,Default,,0000,0000,0000,,is the Caps Lock key is a really good key Dialogue: 0,0:01:28.43,0:01:31.05,Default,,0000,0000,0000,,because it's kind of right\Nin the home row Dialogue: 0,0:01:31.05,0:01:35.25,Default,,0000,0000,0000,,and it's kind of large and there,\Nbut it's not useful Dialogue: 0,0:01:35.25,0:01:38.50,Default,,0000,0000,0000,,You'll probably realize that you don't\Nuse your Caps Lock as often Dialogue: 0,0:01:38.50,0:01:40.20,Default,,0000,0000,0000,,as when you'd want to use that Dialogue: 0,0:01:40.20,0:01:42.55,Default,,0000,0000,0000,,So you can just remap your \NCaps Lock key Dialogue: 0,0:01:42.55,0:01:44.45,Default,,0000,0000,0000,,to something more useful as we mentioned Dialogue: 0,0:01:44.45,0:01:46.32,Default,,0000,0000,0000,,like Escape if you're a Vim user Dialogue: 0,0:01:46.32,0:01:49.05,Default,,0000,0000,0000,,or like Control if you're an Emacs user Dialogue: 0,0:01:49.05,0:01:52.18,Default,,0000,0000,0000,,or useful re-mappings, like a lot of the Dialogue: 0,0:01:52.18,0:01:56.01,Default,,0000,0000,0000,,upper row 'F' function keys,\Nor like Print Screen Dialogue: 0,0:01:56.01,0:01:58.65,Default,,0000,0000,0000,,You can remap them for example\Nto your media key Dialogue: 0,0:01:58.65,0:02:01.08,Default,,0000,0000,0000,,so like when you type Print Screen, Dialogue: 0,0:02:01.08,0:02:03.61,Default,,0000,0000,0000,,you probably don't have to \Ndo Print Screen that often Dialogue: 0,0:02:03.61,0:02:06.96,Default,,0000,0000,0000,,but you probably want to play\Nor pause your music Dialogue: 0,0:02:07.94,0:02:11.27,Default,,0000,0000,0000,,And pretty much every operating system has Dialogue: 0,0:02:11.27,0:02:14.27,Default,,0000,0000,0000,,some tools that you can use\Nto configure this Dialogue: 0,0:02:14.27,0:02:16.34,Default,,0000,0000,0000,,I'm not gonna go into the details Dialogue: 0,0:02:16.34,0:02:19.46,Default,,0000,0000,0000,,but there's some of them\Nlisted in the notes Dialogue: 0,0:02:20.08,0:02:23.14,Default,,0000,0000,0000,,Erm... Let me check Dialogue: 0,0:02:23.14,0:02:26.60,Default,,0000,0000,0000,,Oh yeah, another thing that you can \Ndo with keyboard re-mappings is Dialogue: 0,0:02:26.60,0:02:29.16,Default,,0000,0000,0000,,that you can do more complex combinations Dialogue: 0,0:02:29.16,0:02:33.36,Default,,0000,0000,0000,,You can have a combination of keys \Nmapped to some action Dialogue: 0,0:02:33.36,0:02:36.30,Default,,0000,0000,0000,,So for example, I have keyboard \Nre-mappings that Dialogue: 0,0:02:36.30,0:02:40.24,Default,,0000,0000,0000,,whenever I do Ctrl+Enter, I open\Na new terminal window Dialogue: 0,0:02:40.24,0:02:42.69,Default,,0000,0000,0000,,because that's a thing I do\Nfairly often and Dialogue: 0,0:02:42.69,0:02:45.60,Default,,0000,0000,0000,,by default on Mac there is no \Nkey binding to do that Dialogue: 0,0:02:45.82,0:02:49.09,Default,,0000,0000,0000,,or Ctrl+Shift+Enter will open a \Nnew browser window, Dialogue: 0,0:02:49.09,0:02:51.48,Default,,0000,0000,0000,,another operation that I do\Non a daily basis Dialogue: 0,0:02:51.48,0:02:56.16,Default,,0000,0000,0000,,So I don't have to grab my mouse\Nand go to Chrome to do that Dialogue: 0,0:02:56.50,0:02:59.70,Default,,0000,0000,0000,,You can also do remapping to \Nperform actions Dialogue: 0,0:02:59.70,0:03:02.55,Default,,0000,0000,0000,,If you don't want to be typing your\Npassword all the... Dialogue: 0,0:03:02.55,0:03:03.81,Default,,0000,0000,0000,,Sorry, not your password Dialogue: 0,0:03:03.81,0:03:06.78,Default,,0000,0000,0000,,Your Email or your password,\Nor for example, your MIT ID Dialogue: 0,0:03:06.78,0:03:08.92,Default,,0000,0000,0000,,like, you may not remember it by heart Dialogue: 0,0:03:08.92,0:03:12.33,Default,,0000,0000,0000,,then you can just have a\Nkeyboard combination that Dialogue: 0,0:03:12.33,0:03:16.80,Default,,0000,0000,0000,,will just perform the action of\Npasting that text Dialogue: 0,0:03:19.58,0:03:21.38,Default,,0000,0000,0000,,Lastly, there are more... Dialogue: 0,0:03:21.38,0:03:24.73,Default,,0000,0000,0000,,Right now it looks like you just have\Nto do some function of Dialogue: 0,0:03:24.73,0:03:28.36,Default,,0000,0000,0000,,"this is the keys that you press and\Nthis is the action that happens" Dialogue: 0,0:03:28.36,0:03:32.23,Default,,0000,0000,0000,,But actually there are more complex\Nkeyboard combinations, and Dialogue: 0,0:03:32.23,0:03:36.97,Default,,0000,0000,0000,,as you go through you'll learn\Nso you can do keyboard sequences Dialogue: 0,0:03:36.97,0:03:39.11,Default,,0000,0000,0000,,So for example when we were\Ndealing with tmux, Dialogue: 0,0:03:39.11,0:03:41.17,Default,,0000,0000,0000,,in tmux there was this notion of Dialogue: 0,0:03:41.17,0:03:46.10,Default,,0000,0000,0000,,first you press Ctrl+A or Ctrl+B, like\Nyou press some prefix Dialogue: 0,0:03:46.10,0:03:49.66,Default,,0000,0000,0000,,and then some other key and\Nthat means something Dialogue: 0,0:03:49.66,0:03:51.41,Default,,0000,0000,0000,,A lot of these softwares allow that Dialogue: 0,0:03:51.41,0:03:55.89,Default,,0000,0000,0000,,So for example, in my keyboard, since\NI'm not using Caps Lock at all, but Dialogue: 0,0:03:55.89,0:04:00.22,Default,,0000,0000,0000,,every so often I have to use when my \Nundergrad has some software that Dialogue: 0,0:04:00.22,0:04:03.20,Default,,0000,0000,0000,,relied on Caps Lock for changing modes Dialogue: 0,0:04:03.20,0:04:08.76,Default,,0000,0000,0000,,Then I can press Shift five times\Nin a row quickly, and then Dialogue: 0,0:04:08.76,0:04:12.47,Default,,0000,0000,0000,,this software that is in the middle\Ninterpreting these commands and Dialogue: 0,0:04:12.47,0:04:17.05,Default,,0000,0000,0000,,remapping to some other, will send a\Nsingle Caps Lock command for that Dialogue: 0,0:04:17.84,0:04:20.24,Default,,0000,0000,0000,,Some more examples of that is that Dialogue: 0,0:04:20.24,0:04:27.77,Default,,0000,0000,0000,,I mentioned that you can use your\NCaps Lock key to map to Escape or Control Dialogue: 0,0:04:27.77,0:04:29.66,Default,,0000,0000,0000,,but you actually can remap it to both Dialogue: 0,0:04:29.66,0:04:31.37,Default,,0000,0000,0000,,So in my computer when Dialogue: 0,0:04:31.37,0:04:35.10,Default,,0000,0000,0000,,I just tap the Caps Lock key, that's\Ninterpreted as an Escape Dialogue: 0,0:04:35.10,0:04:40.06,Default,,0000,0000,0000,,However if I press it and hold it,\Nthis software can understand the Dialogue: 0,0:04:40.06,0:04:42.13,Default,,0000,0000,0000,,difference between quickly pressing it and Dialogue: 0,0:04:42.13,0:04:46.16,Default,,0000,0000,0000,,just holding it for using in \Ncombination with some other key Dialogue: 0,0:04:46.16,0:04:48.79,Default,,0000,0000,0000,,and then in that case\Nit's mapped to Control Dialogue: 0,0:04:48.86,0:04:51.83,Default,,0000,0000,0000,,So a lot of these more\Nadvanced configurations are Dialogue: 0,0:04:51.83,0:04:55.19,Default,,0000,0000,0000,,supported on a lot of these tools Dialogue: 0,0:04:55.58,0:04:59.86,Default,,0000,0000,0000,,As I mentioned we have a \Nshort list of good defaults Dialogue: 0,0:05:00.19,0:05:05.44,Default,,0000,0000,0000,,for these programs for\NWindows, Mac OS and Linux Dialogue: 0,0:05:05.68,0:05:08.36,Default,,0000,0000,0000,,Any questions on this topic? Dialogue: 0,0:05:13.12,0:05:16.82,Default,,0000,0000,0000,,Okay, now I'm going to cover an\Nunrelated topic to keyboard mappings Dialogue: 0,0:05:16.82,0:05:17.53,Default,,0000,0000,0000,,[chuckles] Dialogue: 0,0:05:17.53,0:05:20.91,Default,,0000,0000,0000,,We're going to see a lot of these\Nunrelated transitions in this lecture Dialogue: 0,0:05:20.91,0:05:23.60,Default,,0000,0000,0000,,And it's the concept of "daemons" Dialogue: 0,0:05:23.60,0:05:25.21,Default,,0000,0000,0000,,So probably you have... Dialogue: 0,0:05:25.21,0:05:28.50,Default,,0000,0000,0000,,Maybe if you are not familiar with \Nthe world, it might seem alien, Dialogue: 0,0:05:28.50,0:05:31.02,Default,,0000,0000,0000,,but the concept of daemon\Nyou're pretty familiar with Dialogue: 0,0:05:31.02,0:05:33.25,Default,,0000,0000,0000,,Most computers when you are running them Dialogue: 0,0:05:33.25,0:05:36.90,Default,,0000,0000,0000,,there's software that you start and run, Dialogue: 0,0:05:36.90,0:05:38.90,Default,,0000,0000,0000,,like the commands that we have been seeing Dialogue: 0,0:05:38.90,0:05:42.72,Default,,0000,0000,0000,,You'd type "ls" and then you're\Ncalling the List command Dialogue: 0,0:05:42.72,0:05:46.78,Default,,0000,0000,0000,,The "ls" command executes because you\Nasked it to execute and then it finishes Dialogue: 0,0:05:47.30,0:05:51.53,Default,,0000,0000,0000,,But a lot of other programs are just\Nrunning as background processes Dialogue: 0,0:05:51.53,0:05:54.82,Default,,0000,0000,0000,,and they're just executing\Nin the background Dialogue: 0,0:05:54.82,0:05:57.38,Default,,0000,0000,0000,,and waiting for events to happen Dialogue: 0,0:05:57.38,0:06:00.50,Default,,0000,0000,0000,,or enabling some sort of functionality\Nin your computer Dialogue: 0,0:06:01.67,0:06:05.31,Default,,0000,0000,0000,,Examples of these processes may be\Nlike your Network Man[ager], Dialogue: 0,0:06:05.31,0:06:08.43,Default,,0000,0000,0000,,like the part of your computer\Nthat is managing the network Dialogue: 0,0:06:08.43,0:06:12.29,Default,,0000,0000,0000,,or the part of your computer\Nthat is managing the display Dialogue: 0,0:06:12.29,0:06:14.12,Default,,0000,0000,0000,,Things like that Dialogue: 0,0:06:14.57,0:06:18.93,Default,,0000,0000,0000,,You will see that a lot of what \Nis enabled by daemons is Dialogue: 0,0:06:18.93,0:06:21.41,Default,,0000,0000,0000,,usually programs that end with a 'd' Dialogue: 0,0:06:21.41,0:06:25.87,Default,,0000,0000,0000,,So for instance, when you are \NSSHing into a computer, Dialogue: 0,0:06:25.87,0:06:30.40,Default,,0000,0000,0000,,the receiving computer has to\Nhave a SSH daemon Dialogue: 0,0:06:30.40,0:06:32.64,Default,,0000,0000,0000,,and the program is called "sshd" Dialogue: 0,0:06:32.64,0:06:34.86,Default,,0000,0000,0000,,and if this program is not running then Dialogue: 0,0:06:34.86,0:06:37.79,Default,,0000,0000,0000,,there's no way for me\Nto SSH into the computer Dialogue: 0,0:06:37.79,0:06:41.35,Default,,0000,0000,0000,,If the program is running, then\Nthat program will be listening Dialogue: 0,0:06:41.35,0:06:44.43,Default,,0000,0000,0000,,and when you do SSH to that server, Dialogue: 0,0:06:44.43,0:06:48.20,Default,,0000,0000,0000,,then some incoming request\Nis gonna enter the computer Dialogue: 0,0:06:48.20,0:06:52.52,Default,,0000,0000,0000,,the computer is gonna send it to this\Ndaemon that is running in the background Dialogue: 0,0:06:52.52,0:06:56.28,Default,,0000,0000,0000,,and then the daemon is gonna check\Nwhether you have authorization, Dialogue: 0,0:06:56.28,0:07:01.11,Default,,0000,0000,0000,,and if so, it's gonna start some login\Nshell that you can start executing from Dialogue: 0,0:07:01.40,0:07:06.59,Default,,0000,0000,0000,,And different OSes handle this\Nsomewhat differently Dialogue: 0,0:07:06.59,0:07:11.41,Default,,0000,0000,0000,,The main idea is they all have\Nsome sort of system daemon Dialogue: 0,0:07:11.41,0:07:14.82,Default,,0000,0000,0000,,that responds a lot of\Nthese smaller daemons Dialogue: 0,0:07:14.82,0:07:19.11,Default,,0000,0000,0000,,In Linux, which is one of the OSes that\Nwe are choosing for lot of the examples, Dialogue: 0,0:07:19.11,0:07:24.29,Default,,0000,0000,0000,,the tool that you're using\Nis the "systemd" Dialogue: 0,0:07:24.29,0:07:29.16,Default,,0000,0000,0000,,Again, first the system daemon is gonna\Nstart a lot of these processes Dialogue: 0,0:07:29.16,0:07:33.38,Default,,0000,0000,0000,,and if you use this "systemctl" command, Dialogue: 0,0:07:33.38,0:07:37.46,Default,,0000,0000,0000,,you can check for the status\Nof different daemons Dialogue: 0,0:07:37.46,0:07:40.59,Default,,0000,0000,0000,,you can check for which ones are running, Dialogue: 0,0:07:43.38,0:07:47.16,Default,,0000,0000,0000,,you can ask it to start processes,\Nto stop them Dialogue: 0,0:07:47.16,0:07:49.68,Default,,0000,0000,0000,,This is kind of an once-off operation Dialogue: 0,0:07:49.68,0:07:53.39,Default,,0000,0000,0000,,You can also enable it\Nand then disable them, Dialogue: 0,0:07:53.39,0:07:57.31,Default,,0000,0000,0000,,which will tell the system\Nto run them at boot Dialogue: 0,0:07:57.31,0:08:00.38,Default,,0000,0000,0000,,or stop running the boot\Nif they were enabled Dialogue: 0,0:08:01.34,0:08:07.46,Default,,0000,0000,0000,,And perhaps more interestingly, you can\Nconfigure your own "systemd" units Dialogue: 0,0:08:07.46,0:08:13.19,Default,,0000,0000,0000,,So, so far all the examples are a lot\Nof what the computer has to do, Dialogue: 0,0:08:13.19,0:08:17.89,Default,,0000,0000,0000,,but say you want to run a web server.\NOne solution, you could just like, Dialogue: 0,0:08:17.89,0:08:23.03,Default,,0000,0000,0000,,every time you start your computer\Nyou could open a tmux session Dialogue: 0,0:08:23.03,0:08:24.88,Default,,0000,0000,0000,,and then execute the command, Dialogue: 0,0:08:24.88,0:08:30.05,Default,,0000,0000,0000,,but that's not really the way that your \Ncomputer expects daemons to be run Dialogue: 0,0:08:30.05,0:08:32.67,Default,,0000,0000,0000,,The way your computer expects\Ndaemons to be run is Dialogue: 0,0:08:32.67,0:08:35.45,Default,,0000,0000,0000,,by using some sort of "systemd" unit Dialogue: 0,0:08:35.45,0:08:40.53,Default,,0000,0000,0000,,It's like a configuration that tells\N"systemd" how to execute this process Dialogue: 0,0:08:40.53,0:08:43.96,Default,,0000,0000,0000,,So an example of this is... Dialogue: 0,0:08:45.43,0:08:47.91,Default,,0000,0000,0000,,Here's a very simple example Dialogue: 0,0:08:47.91,0:08:51.11,Default,,0000,0000,0000,,So what is happening here is Dialogue: 0,0:08:51.11,0:08:56.69,Default,,0000,0000,0000,,we're describing to "systemd" what needs\Nto be done for this program to execute. Dialogue: 0,0:08:56.69,0:09:00.91,Default,,0000,0000,0000,,This example is just running\Na simple Python app Dialogue: 0,0:09:00.91,0:09:04.85,Default,,0000,0000,0000,,You can think of it as a web server that\Ncan be implemented using Dialogue: 0,0:09:04.85,0:09:08.35,Default,,0000,0000,0000,,some Python web server library.\NAnd here we're saying Dialogue: 0,0:09:08.35,0:09:12.55,Default,,0000,0000,0000,,this is the description, we're\Nsaying after, like this is important Dialogue: 0,0:09:12.55,0:09:16.80,Default,,0000,0000,0000,,"Systemd" has a list of\Nservices that have to start Dialogue: 0,0:09:16.80,0:09:19.02,Default,,0000,0000,0000,,Like, all these daemons have to be started Dialogue: 0,0:09:19.02,0:09:22.82,Default,,0000,0000,0000,,but maybe there are dependencies \Nbetween these daemons, so here Dialogue: 0,0:09:22.82,0:09:27.92,Default,,0000,0000,0000,,we're saying "no, you should only start\Nthis after the network has been set up" Dialogue: 0,0:09:27.92,0:09:30.67,Default,,0000,0000,0000,,because otherwise how will you even try to Dialogue: 0,0:09:30.67,0:09:35.41,Default,,0000,0000,0000,,configure our web server if I cannot\Nlisten to a network port? Dialogue: 0,0:09:35.41,0:09:38.70,Default,,0000,0000,0000,,And then we are defining what\Nusers should run this, because Dialogue: 0,0:09:38.70,0:09:42.12,Default,,0000,0000,0000,,you may want to run this as\Nyour user, or maybe other user, Dialogue: 0,0:09:42.12,0:09:45.36,Default,,0000,0000,0000,,or maybe the root user\Nshould be running this, Dialogue: 0,0:09:45.36,0:09:48.78,Default,,0000,0000,0000,,and then what command to run\Nand under what directory Dialogue: 0,0:09:49.06,0:09:50.76,Default,,0000,0000,0000,,And whenever you have this, Dialogue: 0,0:09:50.76,0:09:55.06,Default,,0000,0000,0000,,there can be small corner cases that\Nyou might have to debug, but Dialogue: 0,0:09:55.06,0:09:58.03,Default,,0000,0000,0000,,this is kind of the core idea and\Nit can be really useful to Dialogue: 0,0:09:58.03,0:10:01.34,Default,,0000,0000,0000,,automate the process of\Nrunning processes in the background Dialogue: 0,0:10:01.74,0:10:06.22,Default,,0000,0000,0000,,A small side note to this is\Nthe fact that if you just want Dialogue: 0,0:10:06.22,0:10:10.94,Default,,0000,0000,0000,,to run a command every so often, \Nlike in some periodicity, Dialogue: 0,0:10:10.94,0:10:14.64,Default,,0000,0000,0000,,say every morning I want to\Ndo something in my computer, Dialogue: 0,0:10:14.64,0:10:19.98,Default,,0000,0000,0000,,you could write a daemon that just does\Nsomething and then sleeps for a day, but Dialogue: 0,0:10:19.98,0:10:27.04,Default,,0000,0000,0000,,actually Linux and Mac OS have already a\Ndaemon that does this called "crond" Dialogue: 0,0:10:27.04,0:10:31.19,Default,,0000,0000,0000,,and "crond" will take another type of\Nconfiguration file where you can say Dialogue: 0,0:10:31.19,0:10:35.66,Default,,0000,0000,0000,,oh, I want to run a command\Nevery day at 8 AM, Dialogue: 0,0:10:35.66,0:10:38.12,Default,,0000,0000,0000,,or I want to run a command\Nevery 5 minutes, Dialogue: 0,0:10:38.12,0:10:42.17,Default,,0000,0000,0000,,and it will just check for\Nthis event and execute it Dialogue: 0,0:10:42.50,0:10:44.64,Default,,0000,0000,0000,,And with a lot of things\Nyou will find that Dialogue: 0,0:10:44.64,0:10:47.78,Default,,0000,0000,0000,,there are already daemons that\Nhave been configured for that Dialogue: 0,0:10:48.37,0:10:51.97,Default,,0000,0000,0000,,Any questions regarding daemons? Dialogue: 0,0:10:53.92,0:10:57.18,Default,,0000,0000,0000,,[student talking indistinctly] Dialogue: 0,0:10:57.76,0:10:59.93,Default,,0000,0000,0000,,So the question is whether there is Dialogue: 0,0:10:59.93,0:11:02.70,Default,,0000,0000,0000,,a folder in the computer\Nwhere all of these are Dialogue: 0,0:11:02.70,0:11:04.62,Default,,0000,0000,0000,,So yeah, like yes and no Dialogue: 0,0:11:04.62,0:11:09.33,Default,,0000,0000,0000,,Some of these configuration files are\Nin a couple of different folders Dialogue: 0,0:11:09.33,0:11:13.26,Default,,0000,0000,0000,,depending on whether they are\Nsystem daemons or they are user daemons Dialogue: 0,0:11:13.26,0:11:18.26,Default,,0000,0000,0000,,Here you can see at the very first line\Nis where you will place this Dialogue: 0,0:11:18.26,0:11:22.97,Default,,0000,0000,0000,,for the system daemon to recognize\Nthat it has been installed Dialogue: 0,0:11:22.97,0:11:25.99,Default,,0000,0000,0000,,but if you just want to list \Nall the daemons that are running, Dialogue: 0,0:11:25.99,0:11:30.02,Default,,0000,0000,0000,,in Linux for example, you can just do \N"systemctl status" Dialogue: 0,0:11:30.02,0:11:33.72,Default,,0000,0000,0000,,and that's gonna print\Na tree of all the systems Dialogue: 0,0:11:33.72,0:11:37.88,Default,,0000,0000,0000,,and which daemon was spawned\Nby which other daemon Dialogue: 0,0:11:37.88,0:11:42.13,Default,,0000,0000,0000,,and a lot of them will be\Nspawned directly by "systemd" Dialogue: 0,0:11:44.15,0:11:49.08,Default,,0000,0000,0000,,The next topic is going to be\Nfile systems in user space Dialogue: 0,0:11:49.08,0:11:55.80,Default,,0000,0000,0000,,So, kind of a quick intro to this is the\Nfact that whenever you're using a modern.. Dialogue: 0,0:11:55.80,0:11:58.26,Default,,0000,0000,0000,,Oh, yeah, sorry Dialogue: 0,0:11:58.26,0:12:02.25,Default,,0000,0000,0000,,And whenever you're using a\Nmodern operating system, Dialogue: 0,0:12:02.25,0:12:07.13,Default,,0000,0000,0000,,you are not tied to a specific file system Dialogue: 0,0:12:07.13,0:12:11.48,Default,,0000,0000,0000,,So modern systems are fairly modular\Nand you can for example, Dialogue: 0,0:12:11.48,0:12:15.88,Default,,0000,0000,0000,,in Linux there are different file systems\Nthat you can use, and Dialogue: 0,0:12:15.88,0:12:22.76,Default,,0000,0000,0000,,the way this works is because the kernel,\Nwhich is what is running most of the Dialogue: 0,0:12:22.76,0:12:29.54,Default,,0000,0000,0000,,operating system, has some modules that\Nknow how to interact with a file system Dialogue: 0,0:12:29.54,0:12:37.49,Default,,0000,0000,0000,,So usually when you do something\Nlike "touch foobar", Dialogue: 0,0:12:38.89,0:12:44.52,Default,,0000,0000,0000,,this is happening at a user level Dialogue: 0,0:12:44.52,0:12:49.66,Default,,0000,0000,0000,,and then this is going through\Nto the kernel level Dialogue: 0,0:12:49.66,0:12:54.96,Default,,0000,0000,0000,,and there is some kind of\Nlayer here that is checking Dialogue: 0,0:12:54.96,0:12:59.94,Default,,0000,0000,0000,,where this action is happening to \Nfigure out what file system it is under Dialogue: 0,0:12:59.94,0:13:02.63,Default,,0000,0000,0000,,So for example, you will\Nhave multiple disks Dialogue: 0,0:13:02.63,0:13:05.30,Default,,0000,0000,0000,,and all the different disks\Nhave different file systems, Dialogue: 0,0:13:05.30,0:13:10.10,Default,,0000,0000,0000,,so the kernel has to figure out which\Nfile system operations to use, Dialogue: 0,0:13:10.10,0:13:18.50,Default,,0000,0000,0000,,and say this file might be in an "Ext4",\Nwhich is the most common Linux one, Dialogue: 0,0:13:18.50,0:13:23.55,Default,,0000,0000,0000,,then whenever you do "touch foobar",\Nthe kernel will hear that Dialogue: 0,0:13:23.55,0:13:28.39,Default,,0000,0000,0000,,and then it will try to figure out like,\Noh, this lives in an Ext4 file system and Dialogue: 0,0:13:28.39,0:13:35.94,Default,,0000,0000,0000,,it will perform the associated instruction\Nfor creating a file in an Ext4 file system Dialogue: 0,0:13:35.94,0:13:39.11,Default,,0000,0000,0000,,However, the caveat of having\Na system like this is Dialogue: 0,0:13:39.11,0:13:44.90,Default,,0000,0000,0000,,right now I cannot have user code\Nthat defines how to create a file Dialogue: 0,0:13:44.90,0:13:47.92,Default,,0000,0000,0000,,and that might be kind of\Nuseful in some cases Dialogue: 0,0:13:47.92,0:13:52.74,Default,,0000,0000,0000,,Say I want to have a file system that\Nevery time someone creates a file, Dialogue: 0,0:13:52.74,0:13:57.56,Default,,0000,0000,0000,,it sends me an email, so I can know that\Npeople are creating these files Dialogue: 0,0:13:57.56,0:14:01.69,Default,,0000,0000,0000,,Here I cannot modify\Nthe kernel to add this Dialogue: 0,0:14:01.69,0:14:06.02,Default,,0000,0000,0000,,So the solution to this is\Nsomething called "FUSE" Dialogue: 0,0:14:06.02,0:14:13.52,Default,,0000,0000,0000,,And FUSE is a way of having\Nfile systems in user space Dialogue: 0,0:14:13.52,0:14:15.30,Default,,0000,0000,0000,,So what FUSE will do is, Dialogue: 0,0:14:15.30,0:14:24.86,Default,,0000,0000,0000,,if this file instead of being in Ext4,\Nif this file is in a FUSE file system, Dialogue: 0,0:14:24.86,0:14:31.61,Default,,0000,0000,0000,,FUSE will forward this operation to\Nsome other part of user call Dialogue: 0,0:14:31.61,0:14:35.34,Default,,0000,0000,0000,,that will say "oh, create this file" Dialogue: 0,0:14:35.34,0:14:40.62,Default,,0000,0000,0000,,And here I can have the part of the code\Nthat sends an email to me, Dialogue: 0,0:14:40.62,0:14:43.48,Default,,0000,0000,0000,,saying "oh, this file has been created" Dialogue: 0,0:14:43.48,0:14:46.84,Default,,0000,0000,0000,,And in case you want to\Nstill create the file, Dialogue: 0,0:14:46.84,0:14:53.65,Default,,0000,0000,0000,,it can forward back the request\Nto do some more kernel operations Dialogue: 0,0:14:54.20,0:14:58.28,Default,,0000,0000,0000,,It might not seem really practical,\Nbut this is just the theory Dialogue: 0,0:14:58.28,0:15:01.79,Default,,0000,0000,0000,,In practice, why this is useful is because Dialogue: 0,0:15:01.79,0:15:06.24,Default,,0000,0000,0000,,now you can have user level code\Nthat executes arbitrary actions Dialogue: 0,0:15:06.24,0:15:09.22,Default,,0000,0000,0000,,when you try to perform\Nfile system operations Dialogue: 0,0:15:09.64,0:15:15.06,Default,,0000,0000,0000,,A really Interesting example of this\Nis called "SSHFS" Dialogue: 0,0:15:19.65,0:15:22.53,Default,,0000,0000,0000,,On an SSHFS FUSE file system, Dialogue: 0,0:15:22.53,0:15:27.98,Default,,0000,0000,0000,,whenever you try to create,\Nopen, read, write to a file, Dialogue: 0,0:15:27.98,0:15:30.67,Default,,0000,0000,0000,,instead of trying to do that\Nto a local file, Dialogue: 0,0:15:30.67,0:15:35.16,Default,,0000,0000,0000,,it has an SSH connection\Nto a remote server Dialogue: 0,0:15:35.16,0:15:39.31,Default,,0000,0000,0000,,So if I try to create a file here,\NIt will use that SSH connection to Dialogue: 0,0:15:39.31,0:15:42.79,Default,,0000,0000,0000,,forward that operation to\Nthe remote system Dialogue: 0,0:15:42.79,0:15:44.80,Default,,0000,0000,0000,,and then it will perform it there Dialogue: 0,0:15:44.80,0:15:50.40,Default,,0000,0000,0000,,So to all my local computer, to the rest\Nof the programs running in my computer, Dialogue: 0,0:15:50.40,0:15:54.30,Default,,0000,0000,0000,,there is this path that looks\Nlike it is here, but Dialogue: 0,0:15:54.30,0:15:58.22,Default,,0000,0000,0000,,all the operations that are performed\Nto the path are forwarded Dialogue: 0,0:15:58.22,0:16:00.04,Default,,0000,0000,0000,,to the remote file system Dialogue: 0,0:16:00.04,0:16:04.22,Default,,0000,0000,0000,,And with this idea, you will get\Nsome examples in the notes, Dialogue: 0,0:16:04.22,0:16:07.83,Default,,0000,0000,0000,,and you will find more online,\Nof ways people have Dialogue: 0,0:16:07.83,0:16:11.06,Default,,0000,0000,0000,,leveraged this capability to do\Nfairly interesting file systems Dialogue: 0,0:16:11.06,0:16:13.98,Default,,0000,0000,0000,,So for example, if instead of having SSH, Dialogue: 0,0:16:13.98,0:16:18.65,Default,,0000,0000,0000,,you don't care about SSH because\Nyou use Dropbox or Google Drive, Dialogue: 0,0:16:18.65,0:16:24.21,Default,,0000,0000,0000,,it's fine, people have implemented\NFUSE file systems that will mount locally Dialogue: 0,0:16:24.21,0:16:27.30,Default,,0000,0000,0000,,and every time you try to do\Nan operation locally, Dialogue: 0,0:16:27.30,0:16:30.79,Default,,0000,0000,0000,,actually it goes to one of these\Ncloud storage providers Dialogue: 0,0:16:30.79,0:16:35.11,Default,,0000,0000,0000,,so you can also use something like\NAmazon S3, or Google Cloud Storage, Dialogue: 0,0:16:35.11,0:16:42.05,Default,,0000,0000,0000,,that don't have the same\Nkind of UI system Dialogue: 0,0:16:42.05,0:16:45.40,Default,,0000,0000,0000,,that we synchronize, as\NDropbox or Google Drive Dialogue: 0,0:16:45.98,0:16:50.91,Default,,0000,0000,0000,,Another application of this that is not\Nrelated to doing something remotely, Dialogue: 0,0:16:50.91,0:16:53.15,Default,,0000,0000,0000,,is something like\Nan encrypted file system Dialogue: 0,0:16:53.15,0:16:58.14,Default,,0000,0000,0000,,You may have a file system that\Nevery time you try to write to a file, Dialogue: 0,0:16:58.14,0:17:02.36,Default,,0000,0000,0000,,you will try to write it in plain text,\Nbut it will capture that operation Dialogue: 0,0:17:02.36,0:17:04.61,Default,,0000,0000,0000,,it will encrypt on the go, Dialogue: 0,0:17:04.61,0:17:07.70,Default,,0000,0000,0000,,and then it will save it as a\Nregular file in your file system, Dialogue: 0,0:17:07.70,0:17:09.56,Default,,0000,0000,0000,,but that's actually encrypted Dialogue: 0,0:17:09.56,0:17:15.06,Default,,0000,0000,0000,,And once you dismount the file system,\Nonce you remove the FUSE connection, Dialogue: 0,0:17:15.06,0:17:19.31,Default,,0000,0000,0000,,all that is left in your computer are just\Nregular files that are encrypted Dialogue: 0,0:17:19.62,0:17:27.40,Default,,0000,0000,0000,,The last topic I wanna cover is backups\Nand some good practices about them Dialogue: 0,0:17:28.63,0:17:34.13,Default,,0000,0000,0000,,The main idea is that for every\Nfile that you care about, Dialogue: 0,0:17:34.13,0:17:36.30,Default,,0000,0000,0000,,if you don't have a backup of that file, Dialogue: 0,0:17:36.30,0:17:38.50,Default,,0000,0000,0000,,if you don't have a backup\Nstored of that file, Dialogue: 0,0:17:38.50,0:17:40.47,Default,,0000,0000,0000,,you can pretty much lose it at any moment Dialogue: 0,0:17:40.47,0:17:42.80,Default,,0000,0000,0000,,There are many different failure scenarios Dialogue: 0,0:17:42.80,0:17:49.17,Default,,0000,0000,0000,,One of them is just hardware failure.\NSo your hard drive can fail at any moment Dialogue: 0,0:17:49.17,0:17:54.51,Default,,0000,0000,0000,,So if you are just making a copy of your\Nfiles in the same drive, that's not useful Dialogue: 0,0:17:54.51,0:17:57.85,Default,,0000,0000,0000,,If your hard drive fails,\Nthe files are gone Dialogue: 0,0:17:57.85,0:18:02.11,Default,,0000,0000,0000,,The same goes if you have an external\Ndrive where you are making a copy, Dialogue: 0,0:18:02.11,0:18:06.81,Default,,0000,0000,0000,,but if you are storing everything in your\Nhome, and your home burns down... Dialogue: 0,0:18:07.02,0:18:11.64,Default,,0000,0000,0000,,Which yes, it's unlikely, but\Nif it happens you just lost all your data Dialogue: 0,0:18:11.64,0:18:15.78,Default,,0000,0000,0000,,So you'd have some sort of\Noff-site backup for having this solution Dialogue: 0,0:18:17.17,0:18:19.68,Default,,0000,0000,0000,,Another thing to take into account is that Dialogue: 0,0:18:19.68,0:18:22.95,Default,,0000,0000,0000,,synchronization or mirroring options\Nare not backups Dialogue: 0,0:18:22.95,0:18:25.94,Default,,0000,0000,0000,,So Google Drive, Dropbox\Nthat I was mentioning, Dialogue: 0,0:18:25.94,0:18:30.25,Default,,0000,0000,0000,,they will just propagate whatever is\Nhappening in your computer Dialogue: 0,0:18:30.25,0:18:33.08,Default,,0000,0000,0000,,This goes also for\Nhardware mirroring, like RAID Dialogue: 0,0:18:33.08,0:18:34.76,Default,,0000,0000,0000,,They are just making a copy Dialogue: 0,0:18:34.76,0:18:36.84,Default,,0000,0000,0000,,If you accidentally delete a file, Dialogue: 0,0:18:36.84,0:18:42.06,Default,,0000,0000,0000,,or someone maliciously deletes your files,\Nor encrypts them using some ransomware, Dialogue: 0,0:18:42.06,0:18:46.60,Default,,0000,0000,0000,,then you might have a copy, but\Nyou have a copy of the same useless data Dialogue: 0,0:18:46.60,0:18:50.86,Default,,0000,0000,0000,,You actually have to have a solution of\Nhow you're running your backups Dialogue: 0,0:18:50.86,0:18:53.05,Default,,0000,0000,0000,,And you should be asking yourself Dialogue: 0,0:18:53.05,0:19:01.28,Default,,0000,0000,0000,,what actually someone needs to know/have\Nabout you in order to delete all your data Dialogue: 0,0:19:01.28,0:19:09.36,Default,,0000,0000,0000,,And we have linked different softwares\Nin the notes about how to do this Dialogue: 0,0:19:09.36,0:19:13.48,Default,,0000,0000,0000,,The last thing I want to mention about\Nbackups is that a lot of the time Dialogue: 0,0:19:13.48,0:19:16.67,Default,,0000,0000,0000,,when you think about backups, you just\Nthink about the local files Dialogue: 0,0:19:16.67,0:19:21.07,Default,,0000,0000,0000,,and like, all my photos and my tax return,\Nand how can I make a backup of that? Dialogue: 0,0:19:21.07,0:19:25.25,Default,,0000,0000,0000,,But increasingly in the modern age,\Nthere are more and more web applications Dialogue: 0,0:19:25.25,0:19:28.73,Default,,0000,0000,0000,,and a lot of data might only live\Nin some cloud provider, Dialogue: 0,0:19:28.73,0:19:30.57,Default,,0000,0000,0000,,like for example if you have Webmail, Dialogue: 0,0:19:30.57,0:19:32.87,Default,,0000,0000,0000,,and you're not synchronizing it\Nto your computer, Dialogue: 0,0:19:32.87,0:19:36.74,Default,,0000,0000,0000,,It's only living in\Nthat provider's servers Dialogue: 0,0:19:36.75,0:19:38.99,Default,,0000,0000,0000,,And if you don't have a copy for that Dialogue: 0,0:19:38.99,0:19:41.74,Default,,0000,0000,0000,,and for some reason you\Nlose access to that account Dialogue: 0,0:19:41.74,0:19:44.46,Default,,0000,0000,0000,,because you forgot your password,\Nyou got hacked, Dialogue: 0,0:19:44.46,0:19:49.12,Default,,0000,0000,0000,,they think you have violated the\Nterms of service... All that data is gone Dialogue: 0,0:19:49.12,0:19:53.21,Default,,0000,0000,0000,,So you should look into some tools\Nthat people have developed Dialogue: 0,0:19:53.21,0:19:57.64,Default,,0000,0000,0000,,for making offline copies of all that data Dialogue: 0,0:19:57.64,0:20:00.52,Default,,0000,0000,0000,,so you can make regular backups of that Dialogue: 0,0:20:00.78,0:20:04.90,Default,,0000,0000,0000,,And that kind of ends this\Nshort section on backups Dialogue: 0,0:20:04.90,0:20:07.10,Default,,0000,0000,0000,,Any questions so far? Dialogue: 0,0:20:09.62,0:20:12.56,Default,,0000,0000,0000,,(student) When you said that\Na hard drive can fail at any time Dialogue: 0,0:20:12.56,0:20:15.46,Default,,0000,0000,0000,,Is there a reason for it to fail? Dialogue: 0,0:20:15.46,0:20:16.96,Default,,0000,0000,0000,,[unintelligible] Dialogue: 0,0:20:16.96,0:20:21.22,Default,,0000,0000,0000,,Like if I have my external hard drive\Nsitting at my parents house or something Dialogue: 0,0:20:21.22,0:20:26.28,Default,,0000,0000,0000,,And my computer here, is that enough?\NOr any drive can just fail? Dialogue: 0,0:20:26.42,0:20:30.37,Default,,0000,0000,0000,,(Jose) Any drive can fail at any moment.\NLike we don't... Dialogue: 0,0:20:30.37,0:20:34.01,Default,,0000,0000,0000,,Different media have\Ndifferent rates of failure Dialogue: 0,0:20:34.01,0:20:36.68,Default,,0000,0000,0000,,and there are really good\Nstatistics online Dialogue: 0,0:20:36.68,0:20:37.76,Default,,0000,0000,0000,,So for example, Dialogue: 0,0:20:37.76,0:20:42.37,Default,,0000,0000,0000,,spinning hard drives have a higher\Nrate of failure than SSDs for example, Dialogue: 0,0:20:42.37,0:20:43.92,Default,,0000,0000,0000,,like Solid-State Drives Dialogue: 0,0:20:43.92,0:20:47.40,Default,,0000,0000,0000,,And what's another case?\NOr like CD drives for example Dialogue: 0,0:20:48.28,0:20:54.36,Default,,0000,0000,0000,,But if you drop a hard drive it's a\Nhigher rate of that failing, of course Dialogue: 0,0:20:54.36,0:20:59.78,Default,,0000,0000,0000,,But in general we don't really have\Nan end-all solution Dialogue: 0,0:20:59.78,0:21:02.14,Default,,0000,0000,0000,,for saying "this media is not gonna fail" Dialogue: 0,0:21:02.14,0:21:08.35,Default,,0000,0000,0000,,Like pretty much, like SD cards, SSDs,\Nhard drives, CDs, degrade with time Dialogue: 0,0:21:08.36,0:21:12.48,Default,,0000,0000,0000,,Pretty much every data is kind of\Nbound to this degradation Dialogue: 0,0:21:12.48,0:21:16.15,Default,,0000,0000,0000,,or like this fact that it could\Nbe lost at any moment Dialogue: 0,0:21:16.15,0:21:19.16,Default,,0000,0000,0000,,And you should also know that\Ndata can become corrupted, Dialogue: 0,0:21:19.16,0:21:23.87,Default,,0000,0000,0000,,your disk might look like it's okay,\Nbut maybe some files were corrupted Dialogue: 0,0:21:23.87,0:21:26.23,Default,,0000,0000,0000,,and something like\Nsynchronization techniques, Dialogue: 0,0:21:26.23,0:21:30.45,Default,,0000,0000,0000,,like Google Drive or Dropbox,\Nwill propagate that corruption Dialogue: 0,0:21:30.45,0:21:35.00,Default,,0000,0000,0000,,And by the time that you realize that\Nthings have gone wrong it's maybe too late Dialogue: 0,0:21:39.58,0:21:46.48,Default,,0000,0000,0000,,(Jon) Alright, we're gonna continue this trend of jumping between random topics and talk about APIs Dialogue: 0,0:21:46.66,0:21:52.58,Default,,0000,0000,0000,,So so far we've really been talking about how do you do things more efficiently locally on your computer? Dialogue: 0,0:21:52.64,0:21:58.86,Default,,0000,0000,0000,,Like I want to accomplish this task more efficiently. How do I like configure my editor? How do I use my shell? Dialogue: 0,0:21:58.90,0:22:03.52,Default,,0000,0000,0000,,But one thing you should realize is that very often you can integrate with the outside world as well Dialogue: 0,0:22:03.66,0:22:08.04,Default,,0000,0000,0000,,Most services that you interact with in your day-to-day provide some kind of API Dialogue: 0,0:22:08.16,0:22:12.32,Default,,0000,0000,0000,,For you to interact with the data that they store or the services that they provide Dialogue: 0,0:22:12.40,0:22:15.40,Default,,0000,0000,0000,,And usually those APIs are pretty well documented Dialogue: 0,0:22:15.50,0:22:22.08,Default,,0000,0000,0000,,If you looked at the APIs for things like Facebook, or Twitter, or Google Drive, or Gmail Dialogue: 0,0:22:22.14,0:22:28.92,Default,,0000,0000,0000,,Many of these have interfaces that you can interact with in order to use those services from your local machine Dialogue: 0,0:22:29.14,0:22:34.20,Default,,0000,0000,0000,,What's really neat is that you can often combine this with some of the stuff that we've talked about in lecture so far Dialogue: 0,0:22:34.28,0:22:38.16,Default,,0000,0000,0000,,Like for example in the Data Wrangling lecture, we looked at how you can create Dialogue: 0,0:22:38.22,0:22:43.08,Default,,0000,0000,0000,,These pipelines to extract data from some source that has a different format than you expected Dialogue: 0,0:22:43.60,0:22:47.72,Default,,0000,0000,0000,,So for instance, the US government has a free service Dialogue: 0,0:22:47.84,0:22:51.88,Default,,0000,0000,0000,,Where you can request the weather forecast for any given location in the US Dialogue: 0,0:22:52.20,0:22:55.62,Default,,0000,0000,0000,,And what you do is there is a URL that you request Dialogue: 0,0:22:55.82,0:23:01.24,Default,,0000,0000,0000,,And if you set the right parameters in that URL and then just fetch it, what you get back is JSON Dialogue: 0,0:23:01.24,0:23:05.72,Default,,0000,0000,0000,,Which is sort of a well-defined data format that you can then parse Dialogue: 0,0:23:05.76,0:23:10.84,Default,,0000,0000,0000,,And you can extract things like your 14-day weather forecast Dialogue: 0,0:23:10.96,0:23:14.94,Default,,0000,0000,0000,,And maybe you then pipe that into your shell and produce some kind of like Dialogue: 0,0:23:15.02,0:23:17.94,Default,,0000,0000,0000,,Handy alias in your terminal that's just gonna print... Dialogue: 0,0:23:18.02,0:23:23.46,Default,,0000,0000,0000,,Of some handy reference for the next 14 days of weather in whatever location you were in Dialogue: 0,0:23:23.60,0:23:27.50,Default,,0000,0000,0000,,These are things you can pretty easily construct and there's some notes... Dialogue: 0,0:23:27.58,0:23:31.96,Default,,0000,0000,0000,,There are some notes in the notes about how you might go about this Dialogue: 0,0:23:32.14,0:23:37.84,Default,,0000,0000,0000,,In general when you interact with these APIs, you're going to be using URLs of one form or another Dialogue: 0,0:23:37.88,0:23:41.20,Default,,0000,0000,0000,,And the exact format varies from service to service Dialogue: 0,0:23:41.26,0:23:44.54,Default,,0000,0000,0000,,But in general the URL is going to contain some set of parameters Dialogue: 0,0:23:44.60,0:23:49.90,Default,,0000,0000,0000,,But ultimately you're just gonna issue a web request to them and you're gonna get data back in some format Dialogue: 0,0:23:50.00,0:23:54.82,Default,,0000,0000,0000,,One command you should be aware of for interacting with these types of things is one called "curl" Dialogue: 0,0:23:54.92,0:23:58.56,Default,,0000,0000,0000,,So curl is a program that you invoke, you give it a URL Dialogue: 0,0:23:58.62,0:24:01.26,Default,,0000,0000,0000,,And it just fetches that URL and gives you back the response Dialogue: 0,0:24:01.26,0:24:03.98,Default,,0000,0000,0000,,What you do with that response is entirely up to you Dialogue: 0,0:24:04.08,0:24:08.66,Default,,0000,0000,0000,,Maybe you pipe it through a program like "gq". Sorry, "jq" Dialogue: 0,0:24:08.76,0:24:15.00,Default,,0000,0000,0000,,So jq is a JSON query tool that lets you take in data that's formatted as JSON Dialogue: 0,0:24:15.04,0:24:19.66,Default,,0000,0000,0000,,And then write a query over it to extract data that you're interested in Dialogue: 0,0:24:19.84,0:24:24.64,Default,,0000,0000,0000,,And this is one of the ways in which you can layer these tools to extract the data that you're interested in Dialogue: 0,0:24:25.36,0:24:30.36,Default,,0000,0000,0000,,Some of these services also require that you authenticate in one way or another Dialogue: 0,0:24:30.46,0:24:33.42,Default,,0000,0000,0000,,Like for example if you want to interact with a Facebook API Dialogue: 0,0:24:33.47,0:24:38.86,Default,,0000,0000,0000,,You need to have some authenticated token that proves who you are as far as Facebook is concerned Dialogue: 0,0:24:39.04,0:24:43.74,Default,,0000,0000,0000,,Otherwise, they can't say whether you're allowed to say, create a post as a given user Dialogue: 0,0:24:43.86,0:24:47.58,Default,,0000,0000,0000,,Very often these things are gonna use something called "OAuth", although not always Dialogue: 0,0:24:47.78,0:24:51.70,Default,,0000,0000,0000,,And you should look at the documentation for every service you care about Dialogue: 0,0:24:51.74,0:24:55.74,Default,,0000,0000,0000,,In general though you will get some kind of secret token back from the service Dialogue: 0,0:24:55.84,0:24:58.62,Default,,0000,0000,0000,,That you have to include in the requests that you make to them Dialogue: 0,0:24:58.72,0:25:04.10,Default,,0000,0000,0000,,Either in the URL or in additional sort of web headers, which you can also send with curl Dialogue: 0,0:25:04.22,0:25:10.58,Default,,0000,0000,0000,,Keep in mind though that these tokens are secret. They are another representation of your user Dialogue: 0,0:25:10.68,0:25:14.12,Default,,0000,0000,0000,,And anyone who gets their hand on them can basically pretend to be you Dialogue: 0,0:25:14.18,0:25:17.42,Default,,0000,0000,0000,,They can do whatever you can do with that token Dialogue: 0,0:25:17.42,0:25:21.84,Default,,0000,0000,0000,,So keep this in mind, don't stick them in your "dotfiles" and then push them onto GitHub Dialogue: 0,0:25:21.94,0:25:26.36,Default,,0000,0000,0000,,That will land you in trouble. You should think of them as a password Dialogue: 0,0:25:26.48,0:25:29.38,Default,,0000,0000,0000,,There are also really neat tools online for integrating services Dialogue: 0,0:25:29.38,0:25:32.54,Default,,0000,0000,0000,,So there's a service called "If This Then That" Dialogue: 0,0:25:32.66,0:25:38.58,Default,,0000,0000,0000,,Which basically provides integrations with a bunch of different services and lets you chain them together Dialogue: 0,0:25:38.66,0:25:41.96,Default,,0000,0000,0000,,And then also access them partially locally if you wish Dialogue: 0,0:25:42.00,0:25:44.02,Default,,0000,0000,0000,,This is something that's worth looking into Dialogue: 0,0:25:44.04,0:25:49.22,Default,,0000,0000,0000,,If there's a particular service you would like to interact with in a more efficient manner Dialogue: 0,0:25:49.52,0:25:52.68,Default,,0000,0000,0000,,Any questions about APIs? Dialogue: 0,0:25:55.16,0:25:56.45,Default,,0000,0000,0000,,Alright Dialogue: 0,0:25:56.45,0:25:59.94,Default,,0000,0000,0000,,Switching gears entirely, let's talk about command-line arguments Dialogue: 0,0:26:00.00,0:26:04.08,Default,,0000,0000,0000,,So command-line tools. There are a lot of them Dialogue: 0,0:26:04.08,0:26:08.10,Default,,0000,0000,0000,,And most of them take different arguments because they do different things Dialogue: 0,0:26:08.20,0:26:13.40,Default,,0000,0000,0000,,We've talked about looking at man pages for commands and that will tell you how this particular command works Dialogue: 0,0:26:13.40,0:26:16.80,Default,,0000,0000,0000,,What kind of flags and options you might give to it Dialogue: 0,0:26:16.88,0:26:19.42,Default,,0000,0000,0000,,And what it actually does when you invoke it Dialogue: 0,0:26:19.58,0:26:23.40,Default,,0000,0000,0000,,But there are some common themes that are useful to know about Dialogue: 0,0:26:23.40,0:26:29.40,Default,,0000,0000,0000,,Either in arguments that many programs take, or just concepts the many of them apply Dialogue: 0,0:26:29.62,0:26:35.10,Default,,0000,0000,0000,,The first of these we already mentioned a little bit in the lecture on command-line environments Dialogue: 0,0:26:35.12,0:26:40.70,Default,,0000,0000,0000,,Which is the "--help" flag. Very often you can pass this to a program and instead of running, Dialogue: 0,0:26:40.70,0:26:46.84,Default,,0000,0000,0000,,It will just print out information about how you can run this program, often in a very short, condensed way Dialogue: 0,0:26:47.90,0:26:55.04,Default,,0000,0000,0000,,A similar one is the "--version" flag, which just prints the version of the software you're using Dialogue: 0,0:26:55.08,0:26:58.00,Default,,0000,0000,0000,,This can be really handy if you're doing something like filing a bug report, Dialogue: 0,0:26:58.01,0:27:00.01,Default,,0000,0000,0000,,Which Anish is going to talk a little bit about later Dialogue: 0,0:27:00.06,0:27:04.46,Default,,0000,0000,0000,,And you want to report what version you're running on in case the bug has been fixed since Dialogue: 0,0:27:04.72,0:27:10.46,Default,,0000,0000,0000,,Often you can also do "-V" and that means the same as version. But again, check the man page Dialogue: 0,0:27:11.50,0:27:16.68,Default,,0000,0000,0000,,There's also "--verbose", or "-v" often Dialogue: 0,0:27:16.76,0:27:20.76,Default,,0000,0000,0000,,Which is a flag that lets you increase the output of the program Dialogue: 0,0:27:21.00,0:27:26.26,Default,,0000,0000,0000,,It makes the program print more about what it is doing. And very often you can repeat this flag Dialogue: 0,0:27:26.32,0:27:31.34,Default,,0000,0000,0000,,So you can do like "-vvvvv" in order to get more information from that tool Dialogue: 0,0:27:31.46,0:27:34.74,Default,,0000,0000,0000,,And this can be especially useful if you're trying to debug a problem Dialogue: 0,0:27:34.76,0:27:39.14,Default,,0000,0000,0000,,If you're like running "rsync" and you want to know why did it decide to copy this file? Dialogue: 0,0:27:39.14,0:27:44.12,Default,,0000,0000,0000,,Or why did it decide not to copy this file? That kind of debug output can be useful Dialogue: 0,0:27:44.20,0:27:47.96,Default,,0000,0000,0000,,And often there's a sort of an inverse flag called "quiet" or "silent" Dialogue: 0,0:27:48.00,0:27:52.88,Default,,0000,0000,0000,,Which means that the tool will not print anything unless it was like an error Dialogue: 0,0:27:53.00,0:27:55.14,Default,,0000,0000,0000,,Anything else, it will stay quiet about Dialogue: 0,0:27:56.12,0:27:59.42,Default,,0000,0000,0000,,Many tools, especially those that do destructive actions Dialogue: 0,0:27:59.48,0:28:03.44,Default,,0000,0000,0000,,Or some kind of action that you cannot undo Dialogue: 0,0:28:03.52,0:28:06.32,Default,,0000,0000,0000,,Provide what's known as a "dry run flag" Dialogue: 0,0:28:06.60,0:28:09.80,Default,,0000,0000,0000,,Exactly how this is represented in the command line varies from tool to tool Dialogue: 0,0:28:09.86,0:28:16.88,Default,,0000,0000,0000,,But essentially what this dry run mode will do is it will run the tool, but it will not actually make any changes Dialogue: 0,0:28:17.04,0:28:23.02,Default,,0000,0000,0000,,Instead it will just inform you of what it would have done if you hadn't run it with dry run Dialogue: 0,0:28:23.92,0:28:30.40,Default,,0000,0000,0000,,Many of these tools also have an interactive mode. So for example, th "rm" and "mv" tools both do Dialogue: 0,0:28:30.54,0:28:33.20,Default,,0000,0000,0000,,Often just "-i", although not always Dialogue: 0,0:28:33.32,0:28:35.66,Default,,0000,0000,0000,,When you run a tool in interactive mode Dialogue: 0,0:28:35.66,0:28:40.34,Default,,0000,0000,0000,,It will usually prompt you whenever it's about to do an action that you can't undo Dialogue: 0,0:28:40.46,0:28:44.38,Default,,0000,0000,0000,,And it will sort of prompt you for a confirmation that it should actually go ahead Dialogue: 0,0:28:46.70,0:28:50.10,Default,,0000,0000,0000,,When we're talking about destructive tools Dialogue: 0,0:28:50.10,0:28:52.70,Default,,0000,0000,0000,,Many of them are non-recursive by default Dialogue: 0,0:28:52.78,0:28:57.00,Default,,0000,0000,0000,,If you try to remove a directory or you try to operate on a full directory Dialogue: 0,0:28:57.22,0:29:00.26,Default,,0000,0000,0000,,They will not continue into the files inside of that directory Dialogue: 0,0:29:00.48,0:29:05.18,Default,,0000,0000,0000,,The reason being you might accidentally like, remove your entire hard drive and that seems bad Dialogue: 0,0:29:05.56,0:29:08.10,Default,,0000,0000,0000,,Therefore for many of these tools, they have a "recurse" flag Dialogue: 0,0:29:08.22,0:29:10.68,Default,,0000,0000,0000,,Often "-r", but again not always Dialogue: 0,0:29:10.78,0:29:17.18,Default,,0000,0000,0000,,Which lets them traverse down into the tree to go deeper, but you need to opt-in to this behavior Dialogue: 0,0:29:17.18,0:29:21.76,Default,,0000,0000,0000,,So this is for example, the case for "rm". This is also the case for "cp" Dialogue: 0,0:29:23.66,0:29:28.22,Default,,0000,0000,0000,,In many tools, when they ask you to give a file name or a path Dialogue: 0,0:29:28.26,0:29:31.44,Default,,0000,0000,0000,,And we talked about this a little bit in the data wrangling lecture Dialogue: 0,0:29:31.44,0:29:34.72,Default,,0000,0000,0000,,Instead of giving a file name, you can often just give a dash Dialogue: 0,0:29:34.78,0:29:40.00,Default,,0000,0000,0000,,Just a single "-", and what that means is standard input or standard output Dialogue: 0,0:29:40.04,0:29:43.28,Default,,0000,0000,0000,,Depending on whether that argument is an input file or an output file Dialogue: 0,0:29:43.38,0:29:48.86,Default,,0000,0000,0000,,This is handy to know about if you're trying to construct those kinds of data wrangling pipelines that we've talked about before Dialogue: 0,0:29:49.10,0:29:54.86,Default,,0000,0000,0000,,Many tools will also default to using standard in or standard out if you don't give any file name at all Dialogue: 0,0:29:57.40,0:30:03.48,Default,,0000,0000,0000,,Sometimes you want to pass something that looks like a flag or an option to a command Dialogue: 0,0:30:03.62,0:30:07.12,Default,,0000,0000,0000,,But you don't actually want it to be interpreted as a flag or an option Dialogue: 0,0:30:07.18,0:30:14.70,Default,,0000,0000,0000,,Consider for example, if you wanted to remove a file called "-i", what would you do? Dialogue: 0,0:30:14.82,0:30:17.52,Default,,0000,0000,0000,,Right, if you write the following command... Dialogue: 0,0:30:19.46,0:30:22.02,Default,,0000,0000,0000,,"rm -i" Dialogue: 0,0:30:22.16,0:30:28.86,Default,,0000,0000,0000,,Well, "-i" is a flag to "rm", so "rm" would, when you run this command say Dialogue: 0,0:30:28.94,0:30:32.62,Default,,0000,0000,0000,,Tell me what file to remove, you haven't given me a file Dialogue: 0,0:30:32.88,0:30:35.58,Default,,0000,0000,0000,,And it's because it interprets this as a flag Dialogue: 0,0:30:36.14,0:30:38.50,Default,,0000,0000,0000,,Similarly, if you do something like... Dialogue: 0,0:30:38.78,0:30:48.76,Default,,0000,0000,0000,,"ssh some machine, some command, and let's say, dash r" Dialogue: 0,0:30:49.74,0:30:56.40,Default,,0000,0000,0000,,So this is saying - run command "foo" on this machine over SSH, and I wanna pass "-r" to "foo" Dialogue: 0,0:30:57.18,0:31:02.46,Default,,0000,0000,0000,,Well, the way that both of these are gonna get interpreted is that these are flags Dialogue: 0,0:31:02.58,0:31:07.18,Default,,0000,0000,0000,,Or in this case, this is a flag. But to this command Dialogue: 0,0:31:07.96,0:31:10.54,Default,,0000,0000,0000,,Which is probably not what you expected Dialogue: 0,0:31:10.92,0:31:14.50,Default,,0000,0000,0000,,Actually in the case of SSH, it has some weird special behavior for some of these Dialogue: 0,0:31:14.65,0:31:18.09,Default,,0000,0000,0000,,But often if you want something to not be interpreted as a flag Dialogue: 0,0:31:18.09,0:31:22.44,Default,,0000,0000,0000,,There's a very simple way to opt-out of that, and that is using double dash Dialogue: 0,0:31:22.84,0:31:26.02,Default,,0000,0000,0000,,If you use double dash, what you tell the command Dialogue: 0,0:31:26.12,0:31:30.50,Default,,0000,0000,0000,,Is that verything following this, you should not interpret Dialogue: 0,0:31:31.00,0:31:36.48,Default,,0000,0000,0000,,So it will not be considered a flag or an option. In the case of "rm" you can do this Dialogue: 0,0:31:36.82,0:31:40.48,Default,,0000,0000,0000,,And now "rm" you will see that the first argument is a "--" Dialogue: 0,0:31:40.94,0:31:44.52,Default,,0000,0000,0000,,And then it will keep reading arguments, but it will not interpret them as flags Dialogue: 0,0:31:44.82,0:31:50.72,Default,,0000,0000,0000,,So when it gets the "-i", it will not interpret it as the dash i flag, but just as an argument dash i Dialogue: 0,0:31:51.52,0:31:58.58,Default,,0000,0000,0000,,Similarly, for SSH you can do this to indicate that these are both positional arguments Dialogue: 0,0:31:58.70,0:32:04.02,Default,,0000,0000,0000,,They are not flags or options and you should not interpret things that start with a dash Dialogue: 0,0:32:08.72,0:32:12.92,Default,,0000,0000,0000,,(student) But if you do like "--version", it's not gonna trigger that? Dialogue: 0,0:32:13.18,0:32:17.94,Default,,0000,0000,0000,,(Jon) No, so this is a " -- ", with a space on both sides Dialogue: 0,0:32:20.22,0:32:25.04,Default,,0000,0000,0000,,Any questions about any of this sort of command line conventions business? Dialogue: 0,0:32:28.84,0:32:30.92,Default,,0000,0000,0000,,Alright then let's talk about window managers Dialogue: 0,0:32:31.81,0:32:35.43,Default,,0000,0000,0000,,So most of you are used to some kind of drag-and-drop window manager Dialogue: 0,0:32:36.04,0:32:42.60,Default,,0000,0000,0000,,If you're running Windows, or Mac OS, or Ubuntu - what comes with the machine is like, there are windows and Dialogue: 0,0:32:42.60,0:32:47.10,Default,,0000,0000,0000,,They overlap partially on screen and you can like drag-and-drop and move them around and resize them and stuff Dialogue: 0,0:32:47.82,0:32:51.12,Default,,0000,0000,0000,,And that works fine Dialogue: 0,0:32:51.16,0:32:56.20,Default,,0000,0000,0000,,But it is not the only way to manage windows on your computer it turns out Dialogue: 0,0:32:56.74,0:33:02.31,Default,,0000,0000,0000,,So what you are used to is something called a floating window manager, but not all window managers are floating Dialogue: 0,0:33:03.07,0:33:09.81,Default,,0000,0000,0000,,Often you can opt-in to other types of window managers that have different behavior for how they arrange your desktop Dialogue: 0,0:33:10.60,0:33:13.54,Default,,0000,0000,0000,,A common alternative is a tiling window manager Dialogue: 0,0:33:13.64,0:33:17.50,Default,,0000,0000,0000,,So in a tiling window manager, rather than having floating windows, Dialogue: 0,0:33:17.76,0:33:23.84,Default,,0000,0000,0000,,Everything is set up into a tiled layout. When you start a program, its window is maximized Dialogue: 0,0:33:24.18,0:33:28.40,Default,,0000,0000,0000,,If you start another program, the original window shrinks in size Dialogue: 0,0:33:28.40,0:33:32.28,Default,,0000,0000,0000,,And then the new window takes up some subset of the total desktop space Dialogue: 0,0:33:32.46,0:33:36.66,Default,,0000,0000,0000,,At no time is your desktop background visible unless you have no programs open Dialogue: 0,0:33:37.15,0:33:42.15,Default,,0000,0000,0000,,All of the programs you have open on any given desktop are going to share that space Dialogue: 0,0:33:42.70,0:33:48.22,Default,,0000,0000,0000,,This looks a little bit like tmux panes, like we talked about earlier, where you can sort of split them in various directions Dialogue: 0,0:33:49.14,0:33:54.64,Default,,0000,0000,0000,,And one of the reasons why this is handy is it means you basically never need to go to your mouse Dialogue: 0,0:33:54.94,0:33:58.94,Default,,0000,0000,0000,,In order to move between windows, there are keyboard shortcuts to move to different windows Dialogue: 0,0:33:58.94,0:34:02.96,Default,,0000,0000,0000,,There are keyboard shortcuts for resizing the windows or swapping them around on screen Dialogue: 0,0:34:03.10,0:34:07.38,Default,,0000,0000,0000,,And this turns out to be a pretty efficient way to manage windows in your computer Dialogue: 0,0:34:10.15,0:34:15.06,Default,,0000,0000,0000,,Well, I won't go into too much of detail of what kind of window managers you might use Dialogue: 0,0:34:15.06,0:34:19.32,Default,,0000,0000,0000,,Just know that these exist out there and they're worth giving a look. They can be a lot more efficient to work with Dialogue: 0,0:34:20.46,0:34:23.10,Default,,0000,0000,0000,,Questions about window managers? Dialogue: 0,0:34:24.42,0:34:28.12,Default,,0000,0000,0000,,All right, VPNs. Totally related to the previous topic Dialogue: 0,0:34:28.44,0:34:32.50,Default,,0000,0000,0000,,So VPNs are like all the rage these days and this makes me really sad Dialogue: 0,0:34:32.70,0:34:35.66,Default,,0000,0000,0000,,It's not clear that VPNs are all the rage for any good reason Dialogue: 0,0:34:36.18,0:34:39.84,Default,,0000,0000,0000,,Because you should be aware of what a VPN does and does not get you Dialogue: 0,0:34:40.48,0:34:47.70,Default,,0000,0000,0000,,A VPN, in the best case, is really just a way for you to change your internet service provider Dialogue: 0,0:34:48.04,0:34:54.42,Default,,0000,0000,0000,,It's a way for you to make traffic on the Internet seem like it's coming from somewhere else than where you actually are Dialogue: 0,0:34:57.48,0:35:00.78,Default,,0000,0000,0000,,While that might seem attractive for certain purposes, Dialogue: 0,0:35:00.78,0:35:04.04,Default,,0000,0000,0000,,It's a little unclear what it buys you in terms of security Dialogue: 0,0:35:04.06,0:35:07.48,Default,,0000,0000,0000,,Because all you're really doing is shifting who you are trusting Dialogue: 0,0:35:07.60,0:35:11.22,Default,,0000,0000,0000,,Rather than trusting who is providing your current internet service, Dialogue: 0,0:35:11.24,0:35:16.34,Default,,0000,0000,0000,,You're trusting that whatever business is giving you that VPN service... Dialogue: 0,0:35:16.42,0:35:20.24,Default,,0000,0000,0000,,You're trusting that they, first of all, have set up this VPN business correctly, Dialogue: 0,0:35:20.24,0:35:23.82,Default,,0000,0000,0000,,But also that they are not tracking what you are doing Dialogue: 0,0:35:24.04,0:35:28.78,Default,,0000,0000,0000,,And it's not clear whether that change of trust is actually worth it Dialogue: 0,0:35:28.86,0:35:33.56,Default,,0000,0000,0000,,If you're sitting at some like dodgy public Wi-Fi network then maybe Dialogue: 0,0:35:33.64,0:35:36.46,Default,,0000,0000,0000,,But if you're sitting at MIT, it's not clear Dialogue: 0,0:35:36.46,0:35:40.70,Default,,0000,0000,0000,,Do you trust your VPN provider more than you trust MIT's IS&T? Dialogue: 0,0:35:40.70,0:35:44.10,Default,,0000,0000,0000,,Or maybe you do, but that is a decision that you need to make Dialogue: 0,0:35:44.12,0:35:47.40,Default,,0000,0000,0000,,About what you trust, who you trust and why? Dialogue: 0,0:35:47.74,0:35:51.68,Default,,0000,0000,0000,,You should also know that much of your traffic, Dialogue: 0,0:35:51.72,0:35:57.28,Default,,0000,0000,0000,,Especially the stuff that's on a sensitive nature on the Internet, is already encrypted Dialogue: 0,0:35:57.30,0:36:03.52,Default,,0000,0000,0000,,Whether that's sort of HTTPS or other protocols that use something like TLS, a lot of the sensitive data is already Dialogue: 0,0:36:03.62,0:36:09.58,Default,,0000,0000,0000,,Sent over encrypted channels and it doesn't really matter who your network provider is if you're on a dodgy Wi-Fi network Dialogue: 0,0:36:09.58,0:36:15.22,Default,,0000,0000,0000,,The stuff that matters is probably encrypted anyway. Might not be, but if it's not Dialogue: 0,0:36:15.28,0:36:20.58,Default,,0000,0000,0000,,Then your VPN provider can also see it in plain text just as much as whoever's hosting this dodgy Wi-Fi network Dialogue: 0,0:36:21.12,0:36:25.78,Default,,0000,0000,0000,,And notice that I said "in the best case above" Dialogue: 0,0:36:25.78,0:36:31.82,Default,,0000,0000,0000,,There are VPN providers who have been shown to be malicious, that do logging of all your traffic, Dialogue: 0,0:36:31.88,0:36:38.38,Default,,0000,0000,0000,,That sell that traffic to third parties. There are VPN providers that have forgotten to enable encryption on the VPN Dialogue: 0,0:36:38.48,0:36:41.64,Default,,0000,0000,0000,,All of these are real problems Dialogue: 0,0:36:41.80,0:36:48.80,Default,,0000,0000,0000,,And so you should think very carefully about whether a VPN actually serves any good purpose for you Dialogue: 0,0:36:48.98,0:36:52.62,Default,,0000,0000,0000,,Questions about VPNs? Yes? Dialogue: 0,0:36:52.74,0:36:56.10,Default,,0000,0000,0000,,(student) So I have a question about public Wi-Fi networks, because Dialogue: 0,0:36:56.14,0:37:02.80,Default,,0000,0000,0000,,The traffic from your computer to the router isn't encrypted between the computer and the router, right? Dialogue: 0,0:37:02.92,0:37:06.88,Default,,0000,0000,0000,,Except for what normally is via HTTPS and [unintelligible] Dialogue: 0,0:37:06.98,0:37:13.64,Default,,0000,0000,0000,,So then doesn't that mean that people could sniff out what domains I'm going to via the DNS request? Dialogue: 0,0:37:13.70,0:37:15.70,Default,,0000,0000,0000,,(Jon) So, it's a very good question Dialogue: 0,0:37:15.72,0:37:22.08,Default,,0000,0000,0000,,If you're on a public Wi-Fi network, then the traffic between you and the wireless access point is not encrypted Dialogue: 0,0:37:22.28,0:37:27.18,Default,,0000,0000,0000,,At least it's not encrypted sort of on the outer layer, but it might be encrypted in like HTTPS, for example Dialogue: 0,0:37:27.36,0:37:34.07,Default,,0000,0000,0000,,And it is totally true the people observing that Wi-Fi network will be able to see anything that is not encrypted Dialogue: 0,0:37:34.10,0:37:39.76,Default,,0000,0000,0000,,But the solution to that is to encrypt all your traffic, rather than necessarily going through a VPN Dialogue: 0,0:37:39.86,0:37:46.82,Default,,0000,0000,0000,,So one way to do this for example is to use DNS over TLS or DNS over HTTPS, which gives you Dialogue: 0,0:37:46.92,0:37:51.54,Default,,0000,0000,0000,,A way to actually encrypt even information that might otherwise leak in plain text Dialogue: 0,0:37:51.96,0:37:55.88,Default,,0000,0000,0000,,Rather than try to sort of trust some provider to do that for you Dialogue: 0,0:37:55.92,0:38:02.45,Default,,0000,0000,0000,,Now that said, in some cases you might have a trusted institution that provides a VPN network for you Dialogue: 0,0:38:02.45,0:38:09.08,Default,,0000,0000,0000,,So for example, MIT provides a VPN network for all MIT students and staff that you can sign up to use Dialogue: 0,0:38:09.12,0:38:13.78,Default,,0000,0000,0000,,And in that case you probably trust MIT more than the other networks you might be on Dialogue: 0,0:38:13.78,0:38:18.02,Default,,0000,0000,0000,,So it might be worth it, but it's something for you to think about Dialogue: 0,0:38:18.02,0:38:22.50,Default,,0000,0000,0000,,(student) When you say you could encrypt it with, what was it, DNS, how would you do that? Dialogue: 0,0:38:24.18,0:38:28.70,Default,,0000,0000,0000,,(Jon) So, DNS is the way that people turn domain names, Dialogue: 0,0:38:28.70,0:38:32.30,Default,,0000,0000,0000,,Or your computer turns domain names into IP addresses to know what computer to connect to Dialogue: 0,0:38:32.46,0:38:37.18,Default,,0000,0000,0000,,And that protocol by default is in plain text. There's nothing encrypted about it Dialogue: 0,0:38:37.20,0:38:40.94,Default,,0000,0000,0000,,There are various ways to encrypt your DNS traffic Dialogue: 0,0:38:41.06,0:38:43.94,Default,,0000,0000,0000,,Some of them are standardized and some of them are not Dialogue: 0,0:38:44.00,0:38:49.20,Default,,0000,0000,0000,,I won't go into the exact mechanics here, but you should google it and look at some of the ways Dialogue: 0,0:38:50.10,0:38:52.68,Default,,0000,0000,0000,,Okay. The last thing I want to talk about is Markdown Dialogue: 0,0:38:52.82,0:38:59.28,Default,,0000,0000,0000,,So there is a high chance that some of you are going to write text over the remaining part of your life Dialogue: 0,0:38:59.48,0:39:02.86,Default,,0000,0000,0000,,And you will want to mark up that text in various simple ways Dialogue: 0,0:39:03.03,0:39:08.93,Default,,0000,0000,0000,,And one thing you could do is start up Word or use LaTeX or something like that to mark up your documents Dialogue: 0,0:39:08.93,0:39:10.86,Default,,0000,0000,0000,,But that is a pretty heavy-handed approach Dialogue: 0,0:39:10.86,0:39:13.32,Default,,0000,0000,0000,,Instead it would be nice if we could just sort of Dialogue: 0,0:39:13.40,0:39:16.38,Default,,0000,0000,0000,,Write things the way we feel like they should be Dialogue: 0,0:39:16.40,0:39:20.96,Default,,0000,0000,0000,,I don't know how to describe it in a better way but sort of the natural way where if you want something, Dialogue: 0,0:39:20.98,0:39:25.28,Default,,0000,0000,0000,,If you want to put emphasis on a word you just put like stars around it or something, and then it just works Dialogue: 0,0:39:25.38,0:39:31.76,Default,,0000,0000,0000,,Markdown is essentially that. It is a way to try to encode the way that we often write text somewhat naturally Dialogue: 0,0:39:31.86,0:39:37.44,Default,,0000,0000,0000,,Into a markup language that lets you write things like bold text, links, lists, that sort of stuff Dialogue: 0,0:39:37.56,0:39:41.54,Default,,0000,0000,0000,,In fact, all of the lecture notes for this class have been written using Markdown Dialogue: 0,0:39:41.72,0:39:46.26,Default,,0000,0000,0000,,And Markdown is really very straightforward. The basic rules are in the notes Dialogue: 0,0:39:46.30,0:39:53.66,Default,,0000,0000,0000,,But the basic things you need to know is, in Markdown if you put stars Dialogue: 0,0:39:53.82,0:40:00.48,Default,,0000,0000,0000,,Around a word, that word is emphasized. Or some sequence of words. If you put double stars Dialogue: 0,0:40:00.64,0:40:04.76,Default,,0000,0000,0000,,That word is emphasized strongly, also known as bold Dialogue: 0,0:40:04.76,0:40:11.08,Default,,0000,0000,0000,,There are various other things you could do, like if you put a dash before a line it is now a list Dialogue: 0,0:40:11.08,0:40:14.18,Default,,0000,0000,0000,,And there's one list item and you can amend list items Dialogue: 0,0:40:14.24,0:40:18.54,Default,,0000,0000,0000,,If you put "1." in front, or some other number, it becomes a numbered list Dialogue: 0,0:40:18.72,0:40:25.00,Default,,0000,0000,0000,,If you put a pound sign in front of something it becomes a header, like some kind of title header Dialogue: 0,0:40:25.12,0:40:30.26,Default,,0000,0000,0000,,If you put multiple of them, they become subheadings and you can keep adding more to these Dialogue: 0,0:40:30.64,0:40:37.82,Default,,0000,0000,0000,,If you want to write code you can put a single backtick, followed by some code, followed by a backtick Dialogue: 0,0:40:37.88,0:40:41.40,Default,,0000,0000,0000,,And now that is rendered in Monospaced Font Dialogue: 0,0:40:41.44,0:40:46.92,Default,,0000,0000,0000,,If you want multiple lines of code, you do a triple backtick, and then code, Dialogue: 0,0:40:46.92,0:40:50.96,Default,,0000,0000,0000,,And then maybe some more code and then triple backtick Dialogue: 0,0:40:51.24,0:40:53.84,Default,,0000,0000,0000,,And in many cases like if you're on GitHub for example, Dialogue: 0,0:40:53.86,0:40:58.44,Default,,0000,0000,0000,,You can even type the name of a language up here after the backticks, without a space Dialogue: 0,0:40:58.48,0:41:01.52,Default,,0000,0000,0000,,And it will be syntax highlighted in the language of your choice Dialogue: 0,0:41:01.66,0:41:07.90,Default,,0000,0000,0000,,This is a really handy thing that is supported in so many websites nowadays you might not even realize Dialogue: 0,0:41:07.90,0:41:11.28,Default,,0000,0000,0000,,Like in Facebook Messenger you can use many of these Dialogue: 0,0:41:11.52,0:41:14.40,Default,,0000,0000,0000,,They don't actually officially say they support Markdown anywhere Dialogue: 0,0:41:14.44,0:41:17.70,Default,,0000,0000,0000,,But many of these things just like sort of happen to work and it's worth learning Dialogue: 0,0:41:17.78,0:41:22.98,Default,,0000,0000,0000,,At least the basics and just start using them. You can do links and stuff as well, but that's already in the notes Dialogue: 0,0:41:23.86,0:41:26.40,Default,,0000,0000,0000,,Any questions about Markdown? Dialogue: 0,0:41:27.94,0:41:31.80,Default,,0000,0000,0000,,Right, Anish, you're up Dialogue: 0,0:41:34.70,0:41:37.04,Default,,0000,0000,0000,,(Anish) Is my microphone working? Dialogue: 0,0:41:38.40,0:41:41.16,Default,,0000,0000,0000,,Is this working? Can you guys hear me in the back? Dialogue: 0,0:41:42.38,0:41:46.42,Default,,0000,0000,0000,,The light's green. Oh, I think I can hear it. Okay, great Dialogue: 0,0:41:48.26,0:41:53.50,Default,,0000,0000,0000,,So, continuing with our theme of random topics that are all unrelated to the previous topics we've been talking about, Dialogue: 0,0:41:53.54,0:41:56.84,Default,,0000,0000,0000,,The next thing we're going to talk about is a program called "Hammerspoon" Dialogue: 0,0:41:56.85,0:42:00.47,Default,,0000,0000,0000,,Which is a tool for doing desktop automation on Mac OS Dialogue: 0,0:42:00.56,0:42:05.16,Default,,0000,0000,0000,,And I think there's similar tools for Windows and Linux, a lot of the ideas can carry over Dialogue: 0,0:42:05.20,0:42:08.64,Default,,0000,0000,0000,,You can google it if you want to figure out how to do these things on other platforms Dialogue: 0,0:42:08.64,0:42:13.00,Default,,0000,0000,0000,,But basically Hammerspoon is a program that lets you write Lua scripts, scripts in a programming language Dialogue: 0,0:42:13.29,0:42:15.83,Default,,0000,0000,0000,,That interact with various operating system functionality Dialogue: 0,0:42:15.96,0:42:20.28,Default,,0000,0000,0000,,So you can write code that interacts with the keyboard and mouse and connects that to window management, Dialogue: 0,0:42:20.40,0:42:25.98,Default,,0000,0000,0000,,To display management, the file system, battery and power management, Wi-Fi... All sorts of stuff Dialogue: 0,0:42:25.98,0:42:30.56,Default,,0000,0000,0000,,Like basically all the things that your operating system manages, this tool lets you hook into those things Dialogue: 0,0:42:30.56,0:42:34.31,Default,,0000,0000,0000,,And so it can let you do all sorts of neat things by writing just a couple lines of code Dialogue: 0,0:42:34.44,0:42:39.54,Default,,0000,0000,0000,,Just some examples of cool things you can do with this tool are - you can bind hotkeys to move windows to Dialogue: 0,0:42:39.68,0:42:45.24,Default,,0000,0000,0000,,Specific locations. So a demonstration of this is here. I have this window open. I press, in my particular setup, Dialogue: 0,0:42:45.28,0:42:49.66,Default,,0000,0000,0000,,"Option+Command+Right" and this window moves to the right. "Option+Command+Left", this window moves to the left Dialogue: 0,0:42:49.74,0:42:52.36,Default,,0000,0000,0000,,And I have a couple other shortcuts for moving things to various places Dialogue: 0,0:42:52.37,0:42:57.50,Default,,0000,0000,0000,,And so I can kind of have an effect similar to tiling window managers that Jon was talking about earlier Dialogue: 0,0:42:57.68,0:43:02.87,Default,,0000,0000,0000,,I can move windows to different parts of my screen to set things up in a particular way rather than have to use the mouse Dialogue: 0,0:43:02.87,0:43:07.70,Default,,0000,0000,0000,,To position things where I want them to be and then like click and drag to resize windows to the right shape Dialogue: 0,0:43:07.80,0:43:10.44,Default,,0000,0000,0000,,Just a keyboard shortcut can do the trick Dialogue: 0,0:43:10.46,0:43:15.10,Default,,0000,0000,0000,,But this tool is not limited to just moving windows around and binding that to particularly keyboard shortcuts Dialogue: 0,0:43:15.10,0:43:19.00,Default,,0000,0000,0000,,You can do other things like create a menu bar button with a bunch of different options Dialogue: 0,0:43:19.04,0:43:22.58,Default,,0000,0000,0000,,And you can bind those different options to do different things. So in my particular case Dialogue: 0,0:43:22.64,0:43:28.42,Default,,0000,0000,0000,,I've created this little menu and then I have a bunch of different things that I do reasonably frequently and clicking on these things Dialogue: 0,0:43:28.92,0:43:33.44,Default,,0000,0000,0000,,Invokes a particular Lua function that I've written that interacts with this library. So for example Dialogue: 0,0:43:34.17,0:43:38.78,Default,,0000,0000,0000,,Here, this "Rescue windows" thing is a particular thing where I often work with multiple displays Dialogue: 0,0:43:38.88,0:43:44.66,Default,,0000,0000,0000,,And sometimes my operating system gets confused and I have some window that ends up off of my display and Dialogue: 0,0:43:44.74,0:43:47.26,Default,,0000,0000,0000,,How do I how do I get this thing back? Dialogue: 0,0:43:47.52,0:43:49.78,Default,,0000,0000,0000,,Well, that's what this... Whoops, not that Dialogue: 0,0:43:52.20,0:43:56.60,Default,,0000,0000,0000,,That's what this "Rescue windows" thing does. It brings windows that are off the screen back onto the screen Dialogue: 0,0:43:57.62,0:44:01.84,Default,,0000,0000,0000,,Another neat thing I have setup here is I have particular layouts that I've named Dialogue: 0,0:44:01.92,0:44:03.64,Default,,0000,0000,0000,,So like a dorm, and a Lab and a Laptop layout Dialogue: 0,0:44:03.65,0:44:04.91,Default,,0000,0000,0000,,So for example in my Lab Dialogue: 0,0:44:04.91,0:44:08.66,Default,,0000,0000,0000,,I have this screen and I have another screen and have another screen besides that in a different orientation Dialogue: 0,0:44:08.76,0:44:11.57,Default,,0000,0000,0000,,And I have this particular setup that I want where I want Dialogue: 0,0:44:11.78,0:44:15.11,Default,,0000,0000,0000,,Maybe my terminal full screen on here, and my chat program over here and Dialogue: 0,0:44:15.27,0:44:18.41,Default,,0000,0000,0000,,This screen split up into five segments with different programs in different places Dialogue: 0,0:44:18.98,0:44:26.46,Default,,0000,0000,0000,,Here I can, when I show up to Lab I can just go here and click "Layout Lab" and it will invoke some code Dialogue: 0,0:44:26.76,0:44:32.20,Default,,0000,0000,0000,,Which is not all that complicated like 10 lines of code describes a particular layout Dialogue: 0,0:44:32.28,0:44:35.82,Default,,0000,0000,0000,,And it will instantiate that layout and put all the things where they need to go Dialogue: 0,0:44:36.10,0:44:42.02,Default,,0000,0000,0000,,I could even in theory automate some of these things where my computer could figure out like I plug in a display and my computer knows Dialogue: 0,0:44:42.02,0:44:46.37,Default,,0000,0000,0000,,Oh, this is the display that you have in your lab. Let me automatically instantiate this layout for you Dialogue: 0,0:44:46.37,0:44:50.90,Default,,0000,0000,0000,,That's another thing you can do with Hammerspoon. And also other wacky things you can do like you can do things like Dialogue: 0,0:44:51.66,0:44:55.04,Default,,0000,0000,0000,,It can detect your Wi-Fi network that you're on so it knows kind of where you are Dialogue: 0,0:44:55.04,0:45:00.11,Default,,0000,0000,0000,,Maybe I have a different Wi-Fi network name at home versus in lab and I can do things like when I show up to lab Dialogue: 0,0:45:00.42,0:45:04.04,Default,,0000,0000,0000,,Automatically mute my speakers. So I don't have like embarrassing music play out loud in my lab Dialogue: 0,0:45:05.28,0:45:07.28,Default,,0000,0000,0000,,Another kind of cool example is Dialogue: 0,0:45:07.89,0:45:09.44,Default,,0000,0000,0000,,So I have a Mac Dialogue: 0,0:45:09.44,0:45:12.05,Default,,0000,0000,0000,,It has a fancy power supply and a lot of my friends have Dialogue: 0,0:45:12.24,0:45:15.47,Default,,0000,0000,0000,,Computers that look the same as this and their power supply bricks look the same as mine and Dialogue: 0,0:45:15.72,0:45:18.86,Default,,0000,0000,0000,,Sometimes I use their power brick because I forgot mine at home or something Dialogue: 0,0:45:19.11,0:45:21.62,Default,,0000,0000,0000,,This tool can actually with like three or four lines of code Dialogue: 0,0:45:21.78,0:45:27.47,Default,,0000,0000,0000,,Do neat things like show you a warning like it'll pop up a warning if you've accidentally taken your friend's power supply and plugged it Dialogue: 0,0:45:27.47,0:45:29.47,Default,,0000,0000,0000,,Into your computer instead of using your own Dialogue: 0,0:45:29.55,0:45:35.09,Default,,0000,0000,0000,,So at a high level this tool lets you run arbitrary Lua code and do things like bind it to menu buttons or key presses and Dialogue: 0,0:45:35.34,0:45:39.17,Default,,0000,0000,0000,,It interacts with a large part of the operating system in order to do all sorts of cool stuff Dialogue: 0,0:45:39.60,0:45:42.50,Default,,0000,0000,0000,,So that is Hammerspoon, any questions about that? Dialogue: 0,0:45:44.48,0:45:46.52,Default,,0000,0000,0000,,Cool. Moving on to the next topic Dialogue: 0,0:45:47.49,0:45:51.20,Default,,0000,0000,0000,,Completely unrelated to the previous one, it's booting and live USBs Dialogue: 0,0:45:52.08,0:45:55.28,Default,,0000,0000,0000,,So the operating system on your computer, Windows or Mac OS Dialogue: 0,0:45:55.54,0:46:00.79,Default,,0000,0000,0000,,or whatever you're used to is not exactly the first thing that runs on your machine when it turns on. There's something else that Dialogue: 0,0:46:00.79,0:46:04.06,Default,,0000,0000,0000,,happens in the boot process before your operating system is loaded and Dialogue: 0,0:46:04.67,0:46:08.47,Default,,0000,0000,0000,,There's some interesting stuff that you can do there. So you might have seen when you turn on your computer Dialogue: 0,0:46:08.47,0:46:13.33,Default,,0000,0000,0000,,It says something like press F9 to configure the BIOS or press F12 to enter the boot menu Dialogue: 0,0:46:13.58,0:46:17.86,Default,,0000,0000,0000,,The particular key sequences may depend on your machine and specific configuration Dialogue: 0,0:46:17.86,0:46:22.81,Default,,0000,0000,0000,,But this is a general pattern and you can configure all sorts of interesting Hardware related stuff here Dialogue: 0,0:46:22.81,0:46:23.95,Default,,0000,0000,0000,,So it's worth checking out Dialogue: 0,0:46:23.95,0:46:29.41,Default,,0000,0000,0000,,And another thing you can do in this boot menu is you can have your computer start off from an alternate boot device Dialogue: 0,0:46:29.42,0:46:34.18,Default,,0000,0000,0000,,so by default like my laptop here has a solid-state drive and it boots Mac OS when it turns on but I can also Dialogue: 0,0:46:34.25,0:46:40.36,Default,,0000,0000,0000,,say plug in a USB flash drive that has an operating system installed on the flash drive and then at boot tell my computer to Dialogue: 0,0:46:40.36,0:46:44.80,Default,,0000,0000,0000,,Boot from that flash drive instead of the built-in solid-state disk, and this is useful Dialogue: 0,0:46:44.80,0:46:45.23,Default,,0000,0000,0000,,for example Dialogue: 0,0:46:45.23,0:46:47.03,Default,,0000,0000,0000,,If I've broken my operating system Dialogue: 0,0:46:47.03,0:46:52.24,Default,,0000,0000,0000,,Install and I want to do something like get the data off my computer or maybe want to fix the operating system Dialogue: 0,0:46:52.24,0:46:55.48,Default,,0000,0000,0000,,Like maybe there's some critical files somewhere that I've deleted or I forgot my password Dialogue: 0,0:46:55.48,0:46:59.35,Default,,0000,0000,0000,,I need to go like tweak some files in order to reset it booting from a live USB Dialogue: 0,0:47:00.02,0:47:04.42,Default,,0000,0000,0000,,Booting from the separate operating system that's installed on a flash drive can let me do that like boot up my operating system Dialogue: 0,0:47:04.76,0:47:07.30,Default,,0000,0000,0000,,Mount the hard disk that's on my current machine Dialogue: 0,0:47:07.30,0:47:09.94,Default,,0000,0000,0000,,I'm working on and then go make some tweaks or copy data off of that Dialogue: 0,0:47:10.34,0:47:16.06,Default,,0000,0000,0000,,And so live USBs are really useful and in the lecture notes, we've linked to a tool that can help you create them really easily Dialogue: 0,0:47:16.97,0:47:19.78,Default,,0000,0000,0000,,Any questions about the boot process or live USBs? Dialogue: 0,0:47:22.46,0:47:28.76,Default,,0000,0000,0000,,All right, next topic is virtual machines, Vagrant, Docker, the cloud and OpenStack Dialogue: 0,0:47:28.76,0:47:31.62,Default,,0000,0000,0000,,I think last year we had an entire lecture on this topic this year Dialogue: 0,0:47:31.63,0:47:33.97,Default,,0000,0000,0000,,We're going to condense it into like one minute Dialogue: 0,0:47:34.10,0:47:41.23,Default,,0000,0000,0000,,So at a high level virtual machines and similar tools like containers let you emulate a whole computer system within your current machine Dialogue: 0,0:47:41.23,0:47:44.44,Default,,0000,0000,0000,,so like I'm running Mac OS here, but within my Mac OS Dialogue: 0,0:47:45.38,0:47:46.46,Default,,0000,0000,0000,,environment I can Dialogue: 0,0:47:46.46,0:47:49.75,Default,,0000,0000,0000,,Simulate a machine that's running say Ubuntu or some other operating system Dialogue: 0,0:47:49.75,0:47:55.18,Default,,0000,0000,0000,,And this is a nice way of creating an isolated environment for testing or for development or for exploration Dialogue: 0,0:47:55.70,0:48:00.64,Default,,0000,0000,0000,,For example doing things like running potentially malicious code that should be isolated from my current environment. I Dialogue: 0,0:48:01.19,0:48:06.94,Default,,0000,0000,0000,,Think the most common use case for programmers is to use virtual machines are containers to create development environments Dialogue: 0,0:48:06.94,0:48:11.92,Default,,0000,0000,0000,,So I'm using Mac OS and I have some of services and stuff and libraries installed in my current machine Dialogue: 0,0:48:11.99,0:48:13.28,Default,,0000,0000,0000,,But I might want for example Dialogue: 0,0:48:13.28,0:48:18.31,Default,,0000,0000,0000,,I'm working on some web programming project and I want it to run on an Dialogue: 0,0:48:18.80,0:48:20.09,Default,,0000,0000,0000,,Debian machine and I need Dialogue: 0,0:48:20.09,0:48:24.49,Default,,0000,0000,0000,,Postgres, like a database server installed rather than install that all on my Mac OS machine Dialogue: 0,0:48:24.49,0:48:28.87,Default,,0000,0000,0000,,I can instantiate this new machine just for the development purposes Dialogue: 0,0:48:30.14,0:48:34.60,Default,,0000,0000,0000,,Now virtual machines, like that's a general concept. There are a bunch of programs that let you Dialogue: 0,0:48:35.27,0:48:37.78,Default,,0000,0000,0000,,that are called virtual machine hypervisors that Dialogue: 0,0:48:38.33,0:48:44.74,Default,,0000,0000,0000,,Support this functionality on your machine and then there are tools that let you script these hypervisors in order to specify machine Dialogue: 0,0:48:45.02,0:48:51.04,Default,,0000,0000,0000,,Configurations like operating system and like what packages you want installed and what services you want installed in plain text Dialogue: 0,0:48:51.04,0:48:56.74,Default,,0000,0000,0000,,And so this is an example on the screen right here. And this is done using a system called Vagrant. Dialogue: 0,0:48:57.86,0:49:00.79,Default,,0000,0000,0000,,It's linked in the lecture notes. You can look into this if you're curious. Dialogue: 0,0:49:00.79,0:49:05.44,Default,,0000,0000,0000,,So basically and the short plain text file I can specify okay. I want a machine that's running Debian Dialogue: 0,0:49:05.44,0:49:09.22,Default,,0000,0000,0000,,It should have "postgres" and Redis and Python and stuff installed on it. Dialogue: 0,0:49:09.22,0:49:10.88,Default,,0000,0000,0000,,And then, once I have this configuration, Dialogue: 0,0:49:10.88,0:49:16.84,Default,,0000,0000,0000,,I can just type in "vagrant up", and what it does is, it reads this file and instantiates a new machine based on this Dialogue: 0,0:49:17.00,0:49:22.66,Default,,0000,0000,0000,,configuration. And then, after I've done that I can do "vagrant ssh" to SSH into this virtual machine. Dialogue: 0,0:49:22.66,0:49:25.51,Default,,0000,0000,0000,,So it's not a remote machine running on some other piece of hardware somewhere, Dialogue: 0,0:49:25.54,0:49:30.79,Default,,0000,0000,0000,,It's just simulated on my own machine, but now here I have an Ubuntu box like I do now, let's be really stashe Dialogue: 0,0:49:30.82,0:49:34.63,Default,,0000,0000,0000,,It's like or sorry not a bunch of debian here with all the things Dialogue: 0,0:49:34.63,0:49:38.34,Default,,0000,0000,0000,,I want installed in here and I can do my development inside this isolated environment, Dialogue: 0,0:49:38.44,0:49:42.24,Default,,0000,0000,0000,,and not, kind of, install all this junk on my MacOS machine. Dialogue: 0,0:49:42.98,0:49:50.08,Default,,0000,0000,0000,,Now so that's vagrant there's similar tools like docker that are conceptually similar but use containers instead of virtual machines Dialogue: 0,0:49:50.12,0:49:52.72,Default,,0000,0000,0000,,It's a distinction that we're not going to talk about in too much detail right now Dialogue: 0,0:49:53.69,0:49:55.69,Default,,0000,0000,0000,,And so you can run VMs on your own computer Dialogue: 0,0:49:55.76,0:49:58.57,Default,,0000,0000,0000,,but you can also rent virtual machines on the cloud and so Dialogue: 0,0:49:58.73,0:50:02.86,Default,,0000,0000,0000,,It's a nice way to get instant access to like one example is you might want a computer Dialogue: 0,0:50:02.86,0:50:07.81,Default,,0000,0000,0000,,That's always on always connected to the internet and has a public IP address. Like maybe you want to run a web server Dialogue: 0,0:50:07.81,0:50:12.25,Default,,0000,0000,0000,,That's always available or you want to run some other service like say a slack bot or something like that Dialogue: 0,0:50:12.35,0:50:14.00,Default,,0000,0000,0000,,Well a virtual machine Dialogue: 0,0:50:14.00,0:50:19.24,Default,,0000,0000,0000,,rented on the cloud is one nice way to get that and these are pretty cheap for like a low capacity machine with a Dialogue: 0,0:50:19.43,0:50:21.43,Default,,0000,0000,0000,,small CP and small amount of disk space and Dialogue: 0,0:50:22.24,0:50:26.92,Default,,0000,0000,0000,,You might want to do is get access to a machine that's really powerful like with a lot of CPU cores or with a lot Dialogue: 0,0:50:26.92,0:50:31.48,Default,,0000,0000,0000,,Of RAM or with a whole bunch of GPUs for some specific purpose like say you're doing deep learning or so Dialogue: 0,0:50:31.48,0:50:33.44,Default,,0000,0000,0000,,You're doing some other sorts of sensitive computation Dialogue: 0,0:50:33.44,0:50:35.38,Default,,0000,0000,0000,,Well, that's another thing you can do with VMs on the cloud Dialogue: 0,0:50:35.38,0:50:41.14,Default,,0000,0000,0000,,And finally, you can get access to many more machines than you have physical access to. Like if I need a thousand machines Dialogue: 0,0:50:41.14,0:50:46.54,Default,,0000,0000,0000,,But only for two minutes to do some very parallel tasks. That's something I can easily do with virtual machines and Dialogue: 0,0:50:47.84,0:50:51.04,Default,,0000,0000,0000,,Popular services for doing this are things like Amazon AWS or Google cloud Dialogue: 0,0:50:51.32,0:50:56.60,Default,,0000,0000,0000,,And if you're a member of MIT CSAIL, you can also get free VMs for research purposes using the CSAIL OpenStack Dialogue: 0,0:50:56.72,0:50:59.00,Default,,0000,0000,0000,,And so this is also linked in the lecture notes Dialogue: 0,0:50:59.54,0:51:03.46,Default,,0000,0000,0000,,So any questions about virtual machines, or Vagrant, Docker, or anything like that? Dialogue: 0,0:51:12.53,0:51:17.23,Default,,0000,0000,0000,,So the question is when I say I'm running Ubuntu, or, actually, in this case, it's Debian Dialogue: 0,0:51:18.14,0:51:22.24,Default,,0000,0000,0000,,when I'm running Ubuntu here, do I have, like, Ubuntu installed on my machine, or Dialogue: 0,0:51:22.94,0:51:28.06,Default,,0000,0000,0000,,What exactly is going on here? So, basically, what Vagrant did for me when I type "vagrant up" is, Dialogue: 0,0:51:28.97,0:51:35.17,Default,,0000,0000,0000,,because I've specified I want Debian here, it downloaded Debian from the internet, like, set up a disk image for this new machine, Dialogue: 0,0:51:35.51,0:51:38.92,Default,,0000,0000,0000,,installed Debian into that disk image, then went to install these programs Dialogue: 0,0:51:39.08,0:51:44.11,Default,,0000,0000,0000,,So, like, yes, this is on my computer. But, all of this is just in a particular file that's a disk image. Dialogue: 0,0:51:44.11,0:51:48.49,Default,,0000,0000,0000,,And then, I'm emulating a machine that is basically completely isolated from my current machine. Dialogue: 0,0:51:48.49,0:51:54.91,Default,,0000,0000,0000,,This is being run as a process on my current machine. Does that answer the question? Any other questions about VMs? Dialogue: 0,0:51:56.99,0:51:58.10,Default,,0000,0000,0000,,Great. Dialogue: 0,0:51:58.10,0:52:00.10,Default,,0000,0000,0000,,Next topic is also going to be a quick mention - Dialogue: 0,0:52:00.44,0:52:01.76,Default,,0000,0000,0000,,So, Dialogue: 0,0:52:01.76,0:52:05.02,Default,,0000,0000,0000,,a lot of you are programmers, and you're used to writing programs Dialogue: 0,0:52:05.18,0:52:07.72,Default,,0000,0000,0000,,in a tool like Vim, or some other editor that you're comfortable with. Dialogue: 0,0:52:07.97,0:52:13.00,Default,,0000,0000,0000,,Another thing that can be really neat to use for particular tasks, is something called a notebook programming environment. Dialogue: 0,0:52:13.00,0:52:17.47,Default,,0000,0000,0000,,And this is a more interactive way of writing programs. Here on the screen, I have a demo. Dialogue: 0,0:52:17.47,0:52:23.44,Default,,0000,0000,0000,,This is something called Jupiter notebook and it can be used for writing Python programs. I think they also support some other languages. Dialogue: 0,0:52:24.14,0:52:26.35,Default,,0000,0000,0000,,And, basically, this is a nice way of doing interactive programming. Dialogue: 0,0:52:26.39,0:52:29.92,Default,,0000,0000,0000,,So, normally, you're used to writing a big program in a file, or a collection of files, Dialogue: 0,0:52:29.92,0:52:35.02,Default,,0000,0000,0000,,and once you're done writing it, you can just run the whole program. But, this lets you be a little bit more flexible and Dialogue: 0,0:52:35.62,0:52:39.82,Default,,0000,0000,0000,,run little snippets of code at a time. Like, for example, I can break my program into these little pieces. Dialogue: 0,0:52:39.89,0:52:45.97,Default,,0000,0000,0000,,It's just some random code I wrote. And, I can say, "execute this cell", and I press a particular key combination to execute the cell. Dialogue: 0,0:52:46.07,0:52:50.80,Default,,0000,0000,0000,,But then, I can go back, and tweak my program a little bit. Like, say I want to have this be lowercase instead. Dialogue: 0,0:52:50.80,0:52:54.61,Default,,0000,0000,0000,,Then, I can execute this cell, and then go and evaluate this thing, and Dialogue: 0,0:52:55.01,0:52:59.95,Default,,0000,0000,0000,,this way I can, kind of, run little snippets of code, within a Python environment. Dialogue: 0,0:53:00.80,0:53:05.65,Default,,0000,0000,0000,,And, it's a nice way of building up programs, piece by piece, rather than having to write everything at once. Dialogue: 0,0:53:05.65,0:53:10.75,Default,,0000,0000,0000,,This is really useful for particular research purposes, like I think a lot of people use these for doing machine learning work, for example. Dialogue: 0,0:53:13.25,0:53:17.83,Default,,0000,0000,0000,,Any questions about the idea of notebook programming environments? They're worth checking out. Dialogue: 0,0:53:24.35,0:53:27.100,Default,,0000,0000,0000,,Oh, so the question is, "This looks like it's online, is there an offline version of Jupiter notebooks?" Dialogue: 0,0:53:27.100,0:53:32.68,Default,,0000,0000,0000,,So, actually, this is the thing that runs in the browser, but it's running locally... Dialogue: 0,0:53:32.68,0:53:35.50,Default,,0000,0000,0000,,So, I don't know if you can see it on the screen, because it's kind of small, but up here Dialogue: 0,0:53:35.50,0:53:37.50,Default,,0000,0000,0000,,it says, "localhost:8888". Dialogue: 0,0:53:37.82,0:53:44.35,Default,,0000,0000,0000,,Here, I have running on my own local machine, a Jupiter notebook. And, they've just built it Dialogue: 0,0:53:44.35,0:53:46.35,Default,,0000,0000,0000,,so it runs within the web browser. Dialogue: 0,0:53:47.03,0:53:49.03,Default,,0000,0000,0000,,That being said, there are also online Dialogue: 0,0:53:49.40,0:53:54.73,Default,,0000,0000,0000,,Jupiter notebooks that you can use, where the Python kernel is actually running on some remote machine. You might want to do this Dialogue: 0,0:53:54.73,0:53:55.96,Default,,0000,0000,0000,,for example, like on my laptop, Dialogue: 0,0:53:55.96,0:54:00.16,Default,,0000,0000,0000,,I don't have a fancy GPU, but in my room, I have a machine with a fancy GPU. And so, when I'm doing machine learning Dialogue: 0,0:54:00.16,0:54:07.12,Default,,0000,0000,0000,,work, I often SSH into that machine, run a Jupiter notebook on there, and then open up the interface, in my local web browser, Dialogue: 0,0:54:07.12,0:54:09.85,Default,,0000,0000,0000,,so I have access to that powerful GPU running on my different machine. Dialogue: 0,0:54:11.90,0:54:13.90,Default,,0000,0000,0000,,Any other questions? Dialogue: 0,0:54:16.28,0:54:17.69,Default,,0000,0000,0000,,Great. Dialogue: 0,0:54:17.69,0:54:19.69,Default,,0000,0000,0000,,The final thing we're going to talk about today is Dialogue: 0,0:54:20.30,0:54:24.49,Default,,0000,0000,0000,,Github. So, we touched on this a little bit during the version control lecture. Dialogue: 0,0:54:24.49,0:54:28.12,Default,,0000,0000,0000,,But, Github is one of the most popular platforms for open-source software development. Dialogue: 0,0:54:28.40,0:54:35.44,Default,,0000,0000,0000,,It hosts source code. It hosts git repositories. But, they also have other tools for managing a project. Dialogue: 0,0:54:36.32,0:54:42.13,Default,,0000,0000,0000,,And, like, a lot of the tools we've talked about in this class are hosted on Github. For example, Dialogue: 0,0:54:42.13,0:54:45.61,Default,,0000,0000,0000,,like, Hammerspoon, the thing we just talked about, is developed on Github Dialogue: 0,0:54:46.40,0:54:47.93,Default,,0000,0000,0000,,It's really easy to get started Dialogue: 0,0:54:47.93,0:54:53.95,Default,,0000,0000,0000,,contributing to open-source projects on Github to help improve the tools that you use every day. Dialogue: 0,0:54:54.26,0:54:57.52,Default,,0000,0000,0000,,There are two primary ways you can contribute to projects on Github. Dialogue: 0,0:54:59.33,0:55:06.31,Default,,0000,0000,0000,,Let's open up some repository. We can actually go to the Github repository for the class website. Dialogue: 0,0:55:06.31,0:55:08.31,Default,,0000,0000,0000,,So, this is an open-source software project. Dialogue: 0,0:55:09.05,0:55:10.61,Default,,0000,0000,0000,,And... Dialogue: 0,0:55:10.61,0:55:14.80,Default,,0000,0000,0000,,Let's zoom in a little bit. So the two ways you can contribute to projects on Github - Dialogue: 0,0:55:14.80,0:55:17.41,Default,,0000,0000,0000,,The two main ways are through issues and pull requests Dialogue: 0,0:55:17.48,0:55:23.95,Default,,0000,0000,0000,,One thing that's actually really helpful to developers, and also pretty lightweight and easy for users to do, is to report issues with a Dialogue: 0,0:55:23.95,0:55:27.31,Default,,0000,0000,0000,,software project. Like, say you're using somebody's program and you encounter some bug... Dialogue: 0,0:55:27.56,0:55:31.99,Default,,0000,0000,0000,,Writing a high quality issue is actually super helpful to developers and hopefully doesn't take you too much time. Dialogue: 0,0:55:31.99,0:55:37.51,Default,,0000,0000,0000,,And so, you can go to here, like find the project on GitHub, go to the issues page, and click on new issue, and then Dialogue: 0,0:55:37.51,0:55:41.98,Default,,0000,0000,0000,,write some high quality bug report. And then, hopefully the developer will respond and fix the issue for you. Dialogue: 0,0:55:42.16,0:55:43.37,Default,,0000,0000,0000,,So, for example, for this class, Dialogue: 0,0:55:43.37,0:55:49.12,Default,,0000,0000,0000,,like, one of the students in this class pointed out an issue with our lecture notes, and after she pointed it out, Dialogue: 0,0:55:49.12,0:55:54.82,Default,,0000,0000,0000,,I said, okay, like, that looks like a reasonable thing. Let's fix it. And in this particular case, instead of fixing it myself, Dialogue: 0,0:55:54.82,0:55:59.62,Default,,0000,0000,0000,,I actually asked this person, "Do they just want to fix it for me?" And so, that leads into the other thing Dialogue: 0,0:55:59.62,0:56:06.01,Default,,0000,0000,0000,,I want to talk about: issues and pull requests. So, pull requests are the second way to contribute to projects on Github. And, Dialogue: 0,0:56:06.56,0:56:09.88,Default,,0000,0000,0000,,this involves actually contributing code back to the project. And Dialogue: 0,0:56:10.55,0:56:16.78,Default,,0000,0000,0000,,so if we look at the pull request for this particular project, you'll see that a bunch of people have submitted code changes. Dialogue: 0,0:56:17.51,0:56:18.80,Default,,0000,0000,0000,,And, Dialogue: 0,0:56:18.80,0:56:24.16,Default,,0000,0000,0000,,the process for doing so - so this is showing the difference, the patch, that this person submitted. Dialogue: 0,0:56:25.19,0:56:30.31,Default,,0000,0000,0000,,Basically, the process for creating pull requests is a little bit more involved than submitting issues. Like you're not just submitting text: Dialogue: 0,0:56:30.31,0:56:32.08,Default,,0000,0000,0000,,you're actually going to modify their source code. Dialogue: 0,0:56:32.08,0:56:36.49,Default,,0000,0000,0000,,And so, we've linked to some guides that explain the process in a little bit more detail. Dialogue: 0,0:56:36.49,0:56:41.86,Default,,0000,0000,0000,,But, at a high level, what you do is, you take the repository on Github, "fork" it, and then download it locally, Dialogue: 0,0:56:41.86,0:56:43.04,Default,,0000,0000,0000,,so now have your own, local copy. Dialogue: 0,0:56:43.04,0:56:48.13,Default,,0000,0000,0000,,Then, you can go and work on it, do some development work, and fix a bug or add a feature, and then, eventually, you Dialogue: 0,0:56:48.13,0:56:51.97,Default,,0000,0000,0000,,send what's called a "pull request" back to the original developer. So, you say, 'Here. I've made some changes. Dialogue: 0,0:56:51.97,0:56:54.64,Default,,0000,0000,0000,,Can you please incorporate them back into the original project?' Dialogue: 0,0:56:54.64,0:57:00.43,Default,,0000,0000,0000,,And, after that point, what usually happens with these projects, is that the maintainer will go back and forth with you, giving you feedback on Dialogue: 0,0:57:00.43,0:57:06.11,Default,,0000,0000,0000,,the changes you've proposed. And, eventually, once everybody's happy, they will "merge" in your changes, and they'll be available to everybody who uses the project. Dialogue: 0,0:57:07.50,0:57:14.18,Default,,0000,0000,0000,,So, that is how you can contribute to projects on GitHub and make software better for everybody. And, so any questions about GitHub? Dialogue: 0,0:57:19.23,0:57:24.35,Default,,0000,0000,0000,,Cool, okay. So, that is it for the topics for today. Any questions about the lecture overall? Dialogue: 0,0:57:25.92,0:57:27.84,Default,,0000,0000,0000,,Great, okay, so before - Dialogue: 0,0:57:27.84,0:57:33.35,Default,,0000,0000,0000,,before we finish, a quick description about tomorrow's lecture: so, today was all the topics we thought are interesting, Dialogue: 0,0:57:33.35,0:57:34.14,Default,,0000,0000,0000,,we should talk about, Dialogue: 0,0:57:34.14,0:57:38.90,Default,,0000,0000,0000,,tomorrow's lecture is gonna be about all the topics you think are interesting and that we should talk about. So, tomorrow is going to be Dialogue: 0,0:57:38.90,0:57:40.94,Default,,0000,0000,0000,,a Q&A lecture. And, after today, Dialogue: 0,0:57:41.43,0:57:43.17,Default,,0000,0000,0000,,uh, after the lecture, we'll submit, Dialogue: 0,0:57:43.17,0:57:48.02,Default,,0000,0000,0000,,we'll email out a link where you can submit questions for us to answer. And so, please go and fill that out, Dialogue: 0,0:57:48.02,0:57:50.02,Default,,0000,0000,0000,,otherwise, we won't have too much to talk about tomorrow. Dialogue: 0,0:57:51.18,0:57:53.90,Default,,0000,0000,0000,,Great, so hopefully, see you tomorrow in our Q&A lecture.