COLTON OGDEN: This is CS50 on Twitch.
Hello, everybody.
My name is Colton Ogden,
and today I am joined by--
NICK WONG: Nick.
My name is Nick.
Hello.
[LAUGHING]
COLTON OGDEN: Nick was
here with us last week.
Was it last week?
NICK WONG: Yeah.
Wow.
That was last Tuesday.
COLTON OGDEN: Kind of feels--
for some reason, it feels
like it was a long time ago.
NICK WONG: Long time ago.
COLTON OGDEN: I know.
Last week we went through--
remind us what we went through again.
NICK WONG: So we walked through
machine learning-- at least
the basics of machine learning, using
Keras and TensorFlow and Smoke and CV.
It was a lot of fun.
COLTON OGDEN: Yeah.
We did some basic ML today, though.
We're going to take a step back
away from the complexity of that.
Dive into-- well, let's talk about
we're going to look at today, actually.
NICK WONG: Yeah.
So we're going to talk about
the mysterious Linux styled
shell, or Unix shell--
COLTON OGDEN: Do you have your--
NICK WONG: --or bash, in particular.
COLTON OGDEN: You have
this up, actually.
I should probably bring it up.
NICK WONG: Oh, yes.
I do actually have a version
of a Shell up right now.
People talk about shell, terminal,
console, bash, Linux shell,
command prompts-- so that's
kind of all the same term.
They all mean slightly different things.
But generally speaking,
that's their idea.
They mean this.
They probably mean something
a little bit closer
to running actual commands like this,
or you can-- there's all sorts of stuff
that we're going to go
through and talk about.
But generally, that's
when you see in a movie,
there's the hacker person going like--
[KEYBOARD CLICKING]
--clickety-clack.
And they've got a bunch of stuff going
on their screen, and then they're in.
COLTON OGDEN: What's
that one website that--
NICK WONG: Yes.
That is a great website, actually.
Let's go find that.
Hacker type, I think.
COLTON OGDEN: Yeah, that's the one.
It was in today, in lecture,
during the Muppet video.
NICK WONG: Oh.
COLTON OGDEN: They actually
had it in the lecture
NICK WONG: They actually used it?
That's kind of awesome.
It always-- ay.
The Wi-Fi.
Gotta love the Wi-Fi.
COLTON OGDEN: Always the
Wi-Fi acting up a little bit.
NICK WONG: We'll get there.
COLTON OGDEN: Yeah.
NICK WONG: That's OK.
We'll get there.
COLTON OGDEN: Basically the website
lets you pretend like you're a hacker
and let you type away.
We've got a few people in the chat.
Let's catch up on that too.
NICK WONG: Yeah.
COLTON OGDEN: There's a bunch of people.
So shout outs to everybody
that was in here early.
So Bhavik Knight, good to see you.
And ForSunlight and FrostCakes--
FrostCakes is a new person.
I'm not sure I've seen
FrostCake in here.
So welcome.
Welcome to CS50 on Twitch.
Bella Kirs, AmjadQZZ1 is new as
well, and we briefly chatted.
So thank you for joining us.
Asley is in the chat.
We have TuxMan29.
This is sudo echo, let's
make some commands.
NICK WONG: And we did actually
run a version of that.
I didn't use sudo, but we did
echo "let's make some commands."
COLTON OGDEN: Doing it in there.
NICK WONG: Big fan.
COLTON OGDEN:
Administrative permissions.
Bhavik Knight-- RM-RF star dot star.
NICK WONG: Also an emoji, I think.
But that would also remove everything.
Don't type that command, as an FYI.
COLTON OGDEN: ANDRE from the Facebook.
As always, good to have
you with us, ANDRE.
I see you like to live
dangerously, says TUXMAX29.
NICK WONG: Very true.
COLTON OGDEN: In reference to
Bhavik Knight's command there.
Bella Kirs says hello, Nick.
NICK WONG: Hello.
COLTON OGDEN: TuxMan, hey, Colton.
Hey, Nick.
Hey, TuxMan.
Good to see you.
Bhavik Knight, how's your day going?
Day's going really well.
How's your day going?
NICK WONG: Fantastic.
Over here, we actually have a
huge celebration for this weekend,
because it's Harvard-Yale.
So that other school that lives
somewhere in the rest of this country
is coming here to play us in football.
And I actually don't watch any
other football games the entire year
except this one.
COLTON OGDEN: You have to.
NICK WONG: So everyone--
yeah, you have to go.
The whole school goes.
Yale's going to be there.
We've got to make sure that
they know that we care.
COLTON OGDEN: Have they won recently?
NICK WONG: They kind of
have won the past two years.
COLTON OGDEN: Oh.
NICK WONG: It was like,
I showed up to college
and they started winning,
which was super annoying.
COLTON OGDEN: Oh, OK.
And then before that, we
had like a 12 or 19 year--
NICK WONG: Yeah, it was like
super long we were winning.
COLTON OGDEN: --streak of victories.
NICK WONG: We've got to bring that back.
COLTON OGDEN: Majedrifaat, hi, everyone.
Hey, Mage.
Good to see you again.
RegEx-- the cryptic language
of forgotten deities.
Yes.
NICK WONG: That sounds
about right, yeah.
COLTON OGDEN: And on
Tuesday, David J. Malan's
going to talk to us
about RegEx's, actually.
NICK WONG: Oh, that's awesome.
COLTON OGDEN: And give us more of
a thorough introduction to that.
I'm not sure if it's "Joha-1-Na"
or if it's "Johan-a."
NICK WONG: Johana?
COLTON OGDEN: Oh, yeah.
It may Johaina.
I'm not sure.
I'm glad to have you with us.
Hello.
Let me know how to pronounce your
name, so I'm pronouncing it correctly.
And then Blue Booger.
It's been a couple of streams.
I do remember Blue Booger.
Delete star name from the chat.
Good luck, Harvard, says Asley.
NICK WONG: Thank you.
We appreciate it.
Yeah, hopefully we
break our losing streak.
COLTON OGDEN: All right.
Well, let's dive into
some Linux stuff, and this
isn't necessarily specific to Linux.
NICK WONG: No.
Although, if you were to try
and type a lot of these things
on like, a PowerShell, they
kind of work, in concept,
but you'd have to dig around in
some docs for, like, specifics.
COLTON OGDEN: For
that, people would have
to do, like, what is the
Windows subsystem for Linux?
NICK WONG: Yeah.
Oh, yeah.
They have Bash on Ubuntu on
Windows for the first time.
COLTON OGDEN: I heard
it has some limitations.
It's not quite like Parity.
NICK WONG: Yeah, it's kind of weird.
[INTERPOSING VOICES]
COLTON OGDEN: More or less close.
NICK WONG: It does get it pretty right
though, so it's like a useful thing.
You can definitely follow
along using that on this.
If you know Docker, we will
probably host a tutorial on that,
actually, in the future.
COLTON OGDEN: Yeah, yeah,
yeah, that's coming up.
NICK WONG: But you're welcome
to use a Docker machine,
and I just spun up like an Ubuntu
Docker container, which is what this is.
So yeah, there's all
sorts of ways to do this,
but I will be working in Bash,
which is the actual shell that we're
going to be using.
COLTON OGDEN: And this is
something you could do on Linux.
You could do this on, like--
obviously, you're on a Mac.
NICK WONG: Yep.
Any Unix style system is
pretty readily available.
I think Mac, by default,
gives you Bash as a shell.
It's a really common shell.
It's super useful.
Like, it's one of most
versatile shells, I think.
Some of their common ones are, like,
Z shell, which is literally Zsh.
I mean, if you ever want to,
like, test out some new shells,
you can always just type
the name of the shell,
and that'll bring you into that shell.
I apparently tried to mess with it.
COLTON OGDEN: Got some
fancy stuff in here.
NICK WONG: That is the
prompt changed entirely.
I don't remember writing
that, but I guess I did.
COLTON OGDEN: Those look like ASCII
character, or color codes, or whatever.
NICK WONG: Yeah, I think they're--
they're the color escape codes
for a prompt, and I guess
Z Shell doesn't care.
And then you can type exit
to get out of those shells.
SH is literally just shell.
Unshockingly, that
actually just does nothing,
but it did actually
move me into the shell.
There's Bash.
There's another one that I'm
going to pub a little bit,
but I won't actually use because
it's kind of its own thing.
It's called Fish.
Super cool.
I'm a huge fan of Fish.
It's super customizable.
It does all sorts of things.
The prompt is really beautiful.
Mine is currently not,
but, like, that's OK.
Fish does all sorts of just, like,
beautiful auto complete stuff.
So if I wanted to cat a thing, it'll
auto suggest all sorts of stuff for me,
and I can just tap complete
that or list things out.
It's very, very well designed.
I'm a huge fan, but we're
going to stick with Bash
for some kind of old,
old-fashioned ways of doing things.
COLTON OGDEN: Yeah, you
mentioned you used Fish actually.
I have to look for it.
I think it was last week.
NICK WONG: Yeah.
COLTON OGDEN: Let's see.
I think we're doing this a few minutes--
just here.
NICK WONG: Oh, yeah.
COLTON OGDEN: Harvard, for
the win says Bhavik Knight.
NICK WONG: Appreciate it.
COLTON OGDEN: Thanks for that.
LincePotiguara, hi, everybody.
Hi, Lince.
It's good to have you with us again.
Johanna is fine.
Johanna or Johanna?
Because I want to make
that one right, as well.
NICK WONG: Yeah, we want to
make sure we get this right.
COLTON OGDEN: WSL is open here
just in case, says Bhavik.
Bhavik, I'm assuming is
on a Windows system then.
NICK WONG: Yep.
COLTON OGDEN: BlueBooger, Docker,
isn't that a brand of clothes?
NICK WONG: Is it?
Is it actually a brand of clothes?
COLTON OGDEN: I think it is.
NICK WONG: That's awesome.
COLTON OGDEN: I think it is.
NICK WONG: Yeah, I'm not super
fashionable or into clothing.
I'm wearing a tech t-shirt.
But, like, yeah.
It also might be a brand of clothing.
We are in reference to the
containerization system,
which is a little bit different.
Although, I guess in concepts,
they both hold things, I believe.
Kind of interesting.
COLTON OGDEN: That's all you need.
Just Another Silly Bot, glad
to have you with us again.
I know you've been with us before.
NICK WONG: What a tag.
COLTON OGDEN: It's late in my
meridian, so I'm just passing by.
I want to wish you a good, fun stream.
Thank you so much.
NICK WONG: Appreciate it.
Thank you.
COLTON OGDEN: It will
be on YouTube later,
so you can watch it in all its
glory when it's fully uploaded.
And post a comment.
You'll let us know, and
join us for the next stream.
Fashion show coming up.
You going to host that show?
NICK WONG: I'm down.
Yeah.
COLTON OGDEN: Yeah?
NICK WONG: I'm super down.
COLTON OGDEN: A tech gear fashion show?
Am I crazy to remember a
shell that uses C as prompts?
NICK WONG: Oh, so I think
what you're thinking of
is the, like, Windows command prompt,
which uses, like, C colon slash slash--
COLTON OGDEN: Oh, good.
Yeah, that's a good one.
NICK WONG: --which is
technically a shell, I believe.
I'm not super familiar with it.
I try and avoid it at all costs.
I think it's super inelegant to use.
It's a pain.
I'm not a huge fan.
COLTON OGDEN: It has, like,
completely different words
for all the common stuff
too, like dir instead of ls.
NICK WONG: Yes.
And then, CD, I think
doesn't do what it does in--
it's like super annoying
if you switch between them.
COLTON OGDEN: Yeah.
It is definitely pretty weird.
Docker is having a problem in
the WSL with the daemon thingy.
NICK WONG: Oh, you might not--
depending on how WSL is
configured, you might not
have permissions to set
up Docker containers,
because they require some
kind of hardware level access.
I've had daemon issues
before, not on Mac
but on Ubuntu container-- or Ubuntu,
like, machines that run Docker.
And on those, I think I solved it
just by giving it sudo access, which
was not the most elegant solution.
Definitely not something
I would recommend,
but I know it does work in concept.
COLTON OGDEN: It's like it's
always something to try,
and I probably shouldn't have done it.
NICK WONG: Yeah, it's
probably not a good first try.
And if you're wondering what
sudo is, or what we mean by,
like, access or things
like that, then that's
exactly what we're
going to go talk about.
So don't know.
COLTON OGDEN: Yeah.
Why don't we start dabbling
into a little bit of that?
NICK WONG: Yeah.
COLTON OGDEN: We have a lot
of chat today, which is great.
NICK WONG: It's awesome.
COLTON OGDEN: It's awesome.
NICK WONG: We love the back and forth.
That's one of the best parts of this.
COLTON OGDEN: Yeah.
NICK WONG: And so in true
stream style, we actually,
basically, just have nothing prepared,
and we're going to walk through--
nothing prepared.
We have very little, like, actual
things written down that we've prepared,
but we do have kind of a general
idea of where we're going--
COLTON OGDEN: An outline, a flow.
NICK WONG: Yeah, exactly.
And I think-- I really
like that actually.
It's really fun to kind of
just walk through as we go
and have it be a little bit fluid.
COLTON OGDEN: Yeah, if somebody
suggest something cool,
we can, like, go into it.
NICK WONG: Oh, we can
definitely go into it.
COLTON OGDEN: So definitely
shoot out some ideas, as always.
NICK WONG: All right, so Bash, which
is basically what I have open now--
if you wanted to, like-- all
right, I should explain lots.
We'll start from the very beginning.
COLTON OGDEN: How about, if you're on
a Mac, how do you actually open it?
I guess that would be
a good place to start.
NICK WONG: Right.
That is a great question.
So if you're on a Mac, you can use the
Spotlight Search up in the top right.
And then just type in term,
and it'll bring up terminal.
And then pressing Enter will
bring me to my terminal.
Alternatively, if you go into
Launch Pad and Search for term--
OK, or not.
Do none of those things--
and search for terminal,
it will also come up.
And generally on any machine,
like if you have your Mac,
or if you're on some sort of a
Ubuntu distro or something like that,
they usually have the ability
to search for some terminal.
And so, you can click that.
And mine will just bring me to
the one that's already open,
but yours will open a new one
if you have not done so already.
COLTON OGDEN: Nice.
NICK WONG: Cool.
So once you're in a
terminal of some sort--
if you want to follow on
exactly what we are doing--
you can make sure that you're in Bash,
by typing in Bash and pressing Enter.
That will switch your shell.
Whatever shell you started out on,
it will switch it over to Bash,
assuming that you have Bash installed.
One of my favorite, and I think
undervalued commands, is which,
and it tells you just
which thing you're using.
But before that even
becomes meaningful--
so it'll tell me this.
It tells me a path.
We should tell you a little bit
about how the kind of Unix style
is organized.
So basically, in Unix, a lot of people
imagine it as some sort of tree.
I know some people who imagine
it as like a tree going upward.
Some people imagine as
a tree going downward.
It doesn't really matter, as
long as you're consistent.
So I generally, I think, imagine
it as kind of like a downward
looking tree-- like, it
kind of branches down,
because I referred to
going up in directories
and then down into a directory.
I think that makes a
lot of sense for me.
but if that doesn't work
for you, no worries.
And so, the way that this tree
is rooted is you have slash.
That is the beginning of the tree.
That's at the very top for
me, or at the very bottom
if you think of it the other way.
And so, slash is as
high up as you can go.
It's just the, like, directory
that contains all, mostly.
It contains all as far as, like, user
land is concerned, which is great.
So if we wanted to get into
that directory, we use cd.
cd is actually a really powerful command
if you want to go between directories.
It means Change Directory--
or it stands for.
And we can do cd slash.
And so, what cd takes as an
optional argument is a path.
It can be a relative path, meaning
like using kind of dot notation, which
we'll talk about in a sec.
Or it can be an absolute path,
which means it starts with a slash
and then writes out where
we're actually trying to go.
And so, you'll notice in my prompt--
that's the thing to the left over here--
there's a bunch of information
that I have displayed.
And you can add and customize
that however you'd like.
I try to keep mine pretty minimal.
So it just says the host of my
computer, my user name currently,
and then which directory I'm in.
And then I keep the dollar sign
for kind of traditional sake.
And so what that does is
it changed from this kind
of tilde, which means home, to slash,
which is what we just discussed.
It's the uppermost directory.
I can't go any higher than this.
COLTON OGDEN: And every
user has their own sort
of home directory on the hard drive.
NICK WONG: Yes, ideally.
You actually are not required
to have a home directory,
but generally speaking most
users will have a home directory.
And if I wanted to get back to that home
directory, I can actually just type cd,
enter, and you'll
notice I go right back.
COLTON OGDEN: Nice.
NICK WONG: And then there's another kind
of useful part to cd, which is cd dash.
And that actually brings you back to
whichever directory you were just in.
So if I go to some random
directory on my Mac,
then I can do cd dash to bring me
back to whichever directory I just
came from.
It's kind of a useful little trick, and
a lot of people don't know about it.
There's a lot of, like, little tricks.
And I'm very lazy, so I
learn a lot of these tricks,
so that I can not do as much work.
COLTON OGDEN: That's smart.
NICK WONG: Yeah, it makes it easier.
COLTON OGDEN: That'll probably
save you time in the long run.
And so, Johanna says,
I'm from Germany, Berlin.
So however you think
you would say in German.
I would imagine Johanna then, and
in that case would probably worry.
NICK WONG: Yeah, I agree.
COLTON OGDEN: And then Bhavik
Knight says, sudo su of the root.
NICK WONG: Yes. sudo su does actually--
what Bhavik Knight points out
is that typing in sudo su would grant
you root access, particularly on,
like, in Ubuntu distro.
And we will talk about that in a sec.
We're kind of going to talk by example,
because I think a lot of these things
are very difficult to
discuss without context.
COLTON OGDEN: Yeah, I think--
NICK WONG: They're hard in the abstract.
COLTON OGDEN: --showing it visibly
too and seeing what we're doing,
I think makes the most sense.
And it illustrates the utility.
NICK WONG: Yeah, makes
it a little bit easier.
COLTON OGDEN: Tux Man,
it was a TIL for him.
Or him or her.
I'm guessing it's a
him, because Tux Man.
It was a TIL for me, actually.
I didn't know cd dash.
NICK WONG: Really?
COLTON OGDEN: I'm an
intermediate level shell user.
NICK WONG: That's awesome.
I'm glad I can help.
That's fantastic.
COLTON OGDEN: Some cool
TILs that we're getting to.
NICK WONG: So we get into some
cool TIL tricks by the end.
So then the next kind of basic command
that everyone knows, or should,
is ls, which basically stands for list.
And what that does is it prints out
what your current directory contains
in it with a caveat.
It prints out the things that
are meant to be displayed
to you in your current directory.
ls takes a bunch of options.
So in command line, I guess,
jargon, people will always say,
oh, you can use flags or options
to change kind of the way
that commands work.
And in the Unix paradigm, this was
to make things really flexible.
So if you have these kind of
small units-- you have ls.
You have cd.
You have, like, all these
kind of very minimal commands.
And what the Unix basically,
like, grand ideal was was
take these, make them really
flexible with what they can do,
and then make them
pluggable into each other.
And we'll talk about that a lot
basically around halfway through,
where when you can mix all
these commands together
you can do some really complex
stuff with very minimal syntax
and without having to
rewrite code or commands.
It was a really cool idea,
and I'm a huge fan of it.
I think it's awesome.
COLTON OGDEN: Yeah, it's a very good--
like a super modular.
It's like software engineering, as well.
NICK WONG: Right.
Just modular design.
COLTON OGDEN: It's
probably a universal truth.
And it looks like TheJasong says, hello.
Nice to see you.
NICK WONG: Yes.
Nice to see you too.
COLTON OGDEN: Hi, Colton and Nick.
I'm Alvin, 15 years old from
Bergenfield, New Jersey.
I will tune in to learn
more about game development.
NICK WONG: Oh, awesome.
COLTON OGDEN: TechiTak, nice to
have-- or Alvin, I should say.
Nice to have you on.
We should have a game dev one--
well, yeah, probably within
a couple of weeks or so.
It's going to be-- it's
a busy time of year.
CS50 just ended.
We had our last lecture today.
NICK WONG: Yeah, that's true.
COLTON OGDEN: We have the--
we have Thanksgiving next weekend,
and then after that is the Hackathon?
NICK WONG: Yeah.
Maybe a week after that.
Like, you get an extra week between
Thanksgiving and the Hackathon.
COLTON OGDEN: I think you're right.
NICK WONG: Maybe.
COLTON OGDEN: So yeah, it's going
to be a busy couple of weeks,
but we'll have a ton of game
dev stuff in the future.
Super happy to have you.
Thanks for joining in.
NICK WONG: Yeah.
All right, so we have
ls, and I just said
that there is a small caveat to that.
So we're actually going to do ls dash a.
And you actually--
there's this kind of joke
amongst, like, kind of scripters or
shell devs, that the way people type ls
tells you a lot about,
like, who taught them.
So hopefully you all will start
to kind of do it the way I do it,
which is ls dash lah is my favorite
command, as far as ls goes.
And it basically stands
for a is for all,
l is for long, h is for human
readable on any sort of number.
And so, what that prints out is this.
It's technically the same
output as this in concept,
but it gives me a lot more information.
And so I also do a lot
of work in cybersecurity.
I run the cyber club
here, and we basically
end up-- that's why we
get into this habit--
is because, like, a lot of the
flags or things in our competitions
are hidden in kind of these very
clear, like, obvious ways to find them,
and no one sees them because
they're just not in this habit.
COLTON OGDEN: A cyber security
streamer would be also super sick.
NICK WONG: That I think would be
very cool, and may be coming up.
COLTON OGDEN: Linux commands are always
useful when diving into dev stuff.
NICK WONG: This is also very true.
COLTON OGDEN: BlueBooger, will you
be covering shell programming--
here scripts, for loops?
Oh, I'm guessing he's thinking
like a Bash scripting.
NICK WONG: Oh, like
Bash scripting, yeah.
So we will definitely talk a little
bit about that, especially because it's
really useful to, like, automate
a bunch of tasks really quickly,
and they're kind of useful to just
know off the top of your head.
Ironically, I'm positive I
will miss a bunch of syntax
when we go to that section.
COLTON OGDEN: I think I've written,
like, two Bash scripts in my life.
NICK WONG: Really?
Wow.
COLTON OGDEN: So I need
to brush up on that.
NICK WONG: Oh, yeah.
No, they're super helpful.
COLTON OGDEN: There were
old streams of game dev--
Asley.
Asley is generously providing
Alvin with some information.
Thanks for that, Asley.
Appreciate it.
NICK WONG: Appreciate it.
All right, so this output, it
looks like a lot, and it is.
But it's definitely breakable--
or break-down-able.
So this section here is, I
think, fairly easy to understand.
It makes a lot of sense if you're
just used to using a computer.
It's the last date that
a file was touched.
And so, the reason that I specified
touched instead of, like, open, is
there are a lot of ways of,
like, manipulating files
that actually don't open them.
So this is supposedly the last date--
it's supposed to be the last date or
time that a file was actually, like,
interacted with.
And we'll leave that
kind of vague for now.
And then here's the actual file name.
You'll see dot and dot dot
in every directory on Bash.
Dot dot means the directory above.
Dot is the current directory.
And so, sometimes people will refer to
things as using those sorts of paths,
and those are called relative paths.
So if I say dot slash, that's going
to be in the current directory.
Slash is going to just separate
folder names basically.
And then going down from
there, if I do dot dot slash,
then that's in the previous directory,
in the higher directory from me,
and then we're going to deal
with something in there.
And we'll give some
examples of that in a sec.
COLTON OGDEN: ForSunlight says, hello,
Colt and Nick, regulars and everyone.
Hey, ForSunlight, thanks for joining us.
NICK WONG: Welcome.
COLTON OGDEN: If I'm
not mistaken, I believe
you said your name was-- was
it Nate in a prior stream?
Forgive me if that was incorrect.
I thought that that was
what you said your name was.
NICK WONG: If you're
right, what a memory.
COLTON OGDEN: DCoffey3296 says, hi, all.
Actually, Dan Coffey taught
me how to use ls dash la.
That was--
NICK WONG: Oh, nice.
COLTON OGDEN: In your
conversation about ls,
that was how I used to
use it for a long time.
NICK WONG: That's awesome.
COLTON OGDEN: I think
only use ls now, because I
don't do a lot of shell stuff.
NICK WONG: That's OK.
But yeah, actually, it's
really funny that people
have all these just different
flags that they pass to ls.
Oh, Whipstreak.
COLTON OGDEN: Yes, sorry.
My bad.
My bad.
Fatma-- OK.
That's Fatma.
Fatma is on the Facebook group.
NICK WONG: There you go.
COLTON OGDEN: So I saw the
message that she posted earlier.
She was pubbing it to, I
think, her school district
or some folks she was working with.
NICK WONG: Oh, that's awesome.
COLTON OGDEN: So thanks so
much for doing that, Fatma.
I will remember that.
Whipstreak was Nate.
So thank you, Asley--
NICK WONG: That's awesome.
COLTON OGDEN: --for clarifying that.
Dan comments, ls dash lah,
add the H for human readable.
NICK WONG: Right.
That is one of my favorite flags.
I use the h to make it, so
that these sizes of files--
so this is actually the
file size right here--
are human readable.
So they use, like, b, g, and k
instead of just random gibberish.
It's not random.
It looks like this, and they tried to
give it to you in, I believe, bytes.
So I just don't like that one as much.
And then over on the left here
is a bunch of permissions stuff.
So d basically stands for--
I actually don't entirely
remember what d stands for.
My apologies.
But if you look at the next set of nine
letters, those are very useful to know,
and they're very useful to understand
why you can and cannot do certain
things.
So root generally is going to have
read, write, and execute access.
That's basically what these stand for.
R is for reading.
Can I read the file or directory?
W, write, is can I write to it?
And then execute is
whether or not I'm allowed
to execute that on this computer.
Root or sudo is generally
allowed to do all three,
and actually the super users
can change permissions at will.
So it wouldn't really
necessarily matter.
COLTON OGDEN: Oh, we've got a lot.
NICK WONG: It looks like
we have a bunch of stuff.
COLTON OGDEN: You want
to read some over?
NICK WONG: Sure.
COLTON OGDEN: I feel like I've
been reading most of them.
NICK WONG: No, you're all good.
Let's see.
COLTON OGDEN: I will pull off.
So ForSunlight-- we were talking about,
previously, about that being Fatma.
She said she had one of her students.
I guess she plugged it
in her school district.
NICK WONG: Oh, that's awesome.
COLTON OGDEN: So she plugged
the stream, so all of--
NICK WONG: Thank you.
COLTON OGDEN: --her
students are watching.
NICK WONG: We appreciate it.
COLTON OGDEN: It looks like--
you can take it from there.
NICK WONG: All right, so Math08--
right.
It's stands for directory.
Thank you.
I appreciate it.
That's what this d is for.
It actually just tells
you that it's a directory.
Very nice.
Is that-- oh, no.
Them, RM, RO.
COLTON OGDEN: TheMrMrO?
NICK WONG: Oh, TheMrMrO?
COLTON OGDEN: I'm not sure.
It's a guess.
NICK WONG: Yeah, all right.
That's a good deal.
So it says, hello, gents.
How are you this fine--
this fine evening?
I'm struggling to read.
I really need to work on reading.
We're doing are fantastic.
Or at least, I'm doing fantastic.
COLTON OGDEN: Yeah,
doing absolutely fine.
This is a ton of fun.
I love doing these streams.
NICK WONG: Yeah, I'm a huge fan.
And then TheJasong says, hey, Colton,
what language are you comfortable with?
What language are you
comfortable with, Colton?
COLTON OGDEN: English.
NICK WONG: English.
COLTON OGDEN: No, I probably like C, C+.
I don't know.
Pretty much most contemporary languages
I've used at one point or another,
and they all kind of blend
together when you learn.
It's the really paradigm shifting
ones that are kind of tricky,
like when you get into Lisp
programming and stuff like that.
Like, that can be a little bit tricky.
But Java, JavaScript, Python, C,
C++, Lua, most common languages,
I would say.
NICK WONG: Yeah.
That sounds about right.
Bhavik Knight and Irene--
IreneNaya?
COLTON OGDEN: Yeah, she goes by Irene
is how she actually pronounces her name.
NICK WONG: OK, very cool.
Both helped me out in saying
that d is for directory.
Thank you.
Tux Man says, he'll change his alias.
Very nice.
The human readable part
to ls is very useful.
Oh, and hello.
COLTON OGDEN: Hey, Irene.
Good to see you.
NICK WONG: And are we doing live
tutorials on this channel by TheMrMrO?
COLTON OGDEN: Yeah.
NICK WONG: Yes, basically.
COLTON OGDEN: Yeah.
So, Nick, today is giving us a--
NICK WONG: Yeah, pretty much.
COLTON OGDEN: --tutorial on how
to use basic Linux commands,
and maybe we'll get into
some basic shell scripting.
I do game development from Scratch too.
It's more like a build something from
Scratch typically, but we do have--
like, today is more
of a tutorialization.
NICK WONG: Right.
COLTON OGDEN: It kind of varies.
Kareem and I do tutorials, as well.
NICK WONG: Yeah.
And then Nuwanda points
out Lua's so different.
Hates Lua.
You're speaking to two people
who just taught a class in Lua.
COLTON OGDEN: Yeah, for those--
I think we mentioned
it last time, but Nick
helped teach my games course for me.
So we both used Lua for
that, and that was--
I don't know.
I enjoy Lua.
It has some shortcomings.
It reminds me of Bash
scripting, because it requires
you to end your stuff with, like, end.
NICK WONG: Right.
That is a very strange--
I mean I understand it,
but a weird paradigm.
COLTON OGDEN: Yeah, it's weird.
Like, Python, you can get
away with it if you just
use a significant white space.
That's kind of nice.
I like that.
NICK WONG: The worst,
though, in Python, not to I
guess go in too much of
a tangent, but in Python
when you accidentally use
spaces and tabs inconsistently,
it calls you out for it.
It doesn't let you compile the
code, so that's very annoying.
COLTON OGDEN: I think it's a--
I think it's kind of a blessing for--
especially when dealing with
people that are new to programming,
who don't have, like,
an enforced style--
I think it's such a
helpful thing to actually
have a consistent standard at which
the compiler is literally enforcing
it a lot like a teacher, right?
NICK WONG: That is a very good point.
Yes.
COLTON OGDEN: It's kind of
like slapping your wrist.
NICK WONG: It helps kind of
force you into styling correctly.
COLTON OGDEN: Yeah, it's good stuff.
NICK WONG: And honestly, we need
better styling in the industry.
All right.
COLTON OGDEN: Just going to hit
that Follow button, says MrMrO.
Thank you so much.
NICK WONG: Appreciate it.
COLTON OGDEN: Appreciate it.
NICK WONG: Lua scoping system.
COLTON OGDEN: Lua scoping
system gave me a headache.
Yeah, it's--
NICK WONG: It's annoying.
COLTON OGDEN: --a little bit.
You have to be careful,
that's the only thing.
It's like the inverse of
Python, where, like, Python,
you have to leave-- global,
specifying that a variable is global.
Yeah, it can cause a headache.
NICK WONG: Kind of like
JavaScript, I think,
where it's just kind of like random.
You're like, willy nilly scoping,
and you like, oh, I hope it worked.
COLTON OGDEN: JavaScript is
a bit screwed up as well.
Definitely.
TuxMan says, over the moon for Lua.
That's because it's a reference to Lua
being the Portuguese word for moon.
Appreciate that.
NICK WONG: That's awesome.
COLTON OGDEN: That's a good one.
MrMrO, will you guys help me
improve my understanding of C++?
So we don't have anything
lined up yet for C++.
It's possible that, in the future,
we may do a tutorial on C++,
but we'll have to give
some thought to that,
because I haven't coded in a
game development context before.
I just haven't done it recently,
and it's kind of a-- it
can be tough to debug live sometimes,
because memory management can
be a little bit finicky.
NICK WONG: Yeah.
Well, maybe we'll have a
tutorial on mem management.
COLTON OGDEN: Yeah, I know
you like low-level C stuff.
NICK WONG: I'm a huge
fan of low-level C.
COLTON OGDEN: So we'll
maybe look into that.
And C++.
Are you familiar with C++?
NICK WONG: Yeah.
Actually, one of the courses I'm
in right now switched over to C++.
Great transition.
COLTON OGDEN: From C?
NICK WONG: From C, yeah.
COLTON OGDEN: Which course is that?
NICK WONG: 61.
So it's basically, like,
low-level systems design.
COLTON OGDEN: Interesting.
NICK WONG: Very cool.
COLTON OGDEN: I didn't realize that.
That's pretty cool.
My CS50x final project
was actually a small game
that played in a virtual computer
in Minecraft that uses Lua.
NICK WONG: That's awesome.
COLTON OGDEN: Was it using the-- was
it the ComputerCraft, I think, mod?
NICK WONG: I think.
That sounds like it.
COLTON OGDEN: Yeah,
that does sound like it.
Or I think it was also
RedPower used Lua scripting.
I forget which one it is.
That's awesome though.
Good job on that.
What does the l stand for in dash lah?
NICK WONG: Long form.
So instead of printing out the kind
of shortened, abbreviated version,
it just prints everything
out on one line each,
and they're in a very lengthy format.
Very nice question though.
COLTON OGDEN: I just realized,
thanks to Dan Coffey,
my mic has been muted the whole time.
So hopefully you've
been able to hear me OK.
NICK WONG: It works for me.
COLTON OGDEN: Hopefully, I
have been speaking loud enough.
I apologize for that.
I should sound a lot better now.
Jasong, any game dev soon?
Probably in about a week or so.
The next week is going
to be a little light.
It's Thanksgiving break.
And then after that, we'll
probably do a game dev--
a game dev stream.
NICK WONG: Yep.
COLTON OGDEN: Hinalr-- this is
the first time we've seen Hinalr,
so thank you for joining us.
He says, nice.
Asley says, cool.
AmjadQZZ1, can you guys
keep moving forward
and specialize a specific
time for comments?
Sorry, we're getting so many--
NICK WONG: Very good point.
We are very excited.
COLTON OGDEN: That's a very good point.
We will do so.
NICK WONG: Yes.
All right, so we have ls'ed things.
We've listed out what's going on here,
and generally ls works pretty well.
A very common paradigm is you'll
see people traversing directories,
doing this.
Like, they might go cd library ls,
and then they'll do cd, like, logs ls.
And you kind of see this.
Like, cd, ls, cd, ls,
which is very entertaining.
To give an example of how you
go back up those directories,
I can go back up both
of them at once by doing
dot dot slash dot dot, which
means go into the directory that
is two above ours, which is
currently where we are now.
And basically, when I refer to
most Linux things or most, like,
terminal style stuff, I'm
going to use terminology
like, we are currently in something.
That's, I guess, a very common paradigm
for users of Linux style things.
COLTON OGDEN: It's kind of
like the state of your shell.
NICK WONG: Right.
It means the state of
where I am in shell.
What my shell has
access to at the moment.
I saw that MrMrO says, why is the
Linux terminal so intimidating?
And hopefully, it'll be a little
less intimidating after this,
because it isn't necessarily
inherently terrible.
I think people just-- it has a lot
of jargon to it and has a lot of--
just, people seem to,
like, just know things,
and that can be really, really weird.
And it's not necessarily understood
as to, like, how did they get there?
How do I know cd dot dot?
And things like that--
and I think lot of people
just kind of learn it by example.
COLTON OGDEN: And I
think the interface to is
kind of disparate-- or
not disparate, but it's
kind of so separate from
the GUIs that we're just
used to, like with all the
devices we use on a daily basis.
Like, obviously, terminals
were super ubiquitous back
in the '80s and '90s
even, but like now today--
NICK WONG: Now we use a GUI.
COLTON OGDEN: We always
use a GUI for everything.
So it looks kind of arcane for, I think,
most people when they first see it.
NICK WONG: And it's kind
of cool once you actually
start getting really familiar with
it and using it for a lot of things.
I use it to open up apps and
stuff, because I think it's faster.
I don't know if that's actually true.
I just feel faster doing it.
So I think a lot of people look at my
laptop, and they're kind of confused.
And actually, what is that?
LincePotiguara talks about
the tab auto completion
feature, and that's a great
feature that people often
forget about or don't know about.
If you start typing-- let's see if I
can find something that has multiple--
if you start typing something-- like,
if I wanted to cd into a u-directory--
I can actually tap tab, and
it'll try and auto complete it.
However, it can only auto complete
up to the information it knows,
and there are two directories in here--
user information and users--
that both start with u.
So what I can do is double tap tab,
and it'll list out the options for me.
And I can then pick between them.
I might say, whack space--
oh, sorry.
Whack is backslash.
COLTON OGDEN: That's a term that
I just learned today actually.
Whack is back slash?
NICK WONG: What a term.
Working with all of
the cyber tech people,
they always will say
things like, oh, do this.
Whack whack, this, whack.
And you're just kind of
like, oh, right, that.
And I kind of just got used to it.
And now it will auto complete
the rest of that directory.
And I can press Enter, and
now I'm in that directory.
Spaces are kind of annoying in Bash.
If you, like most people, try
not to name things with spaces,
because it's kind of annoying
to type that whack space.
Because you have to tell Bash
to not exclude that space
from the actual name of a thing.
Another way to do that
is to wrap it in quotes.
That also does this.
COLTON OGDEN: APSKnight
says, hi, I'm Aman
from India, joining for the first time.
Thank you so much for joining, Aman.
Glad to have you with us.
NICK WONG: Sweet.
Oh, and just-- we researched
a little bit about Lua's name.
It comes from or after SOL, Simple
Object Language, as a joke since sol
is son in Portuguese, and
lua is moon in Portuguese.
And now I have to like
Lua for the wordplay.
COLTON OGDEN: Exactly.
You're in now.
You're in now.
NICK WONG: It's great.
Gotta love CS humor.
C was invented on a machine
with 10 kilobytes of RAM.
That, I didn't know.
COLTON OGDEN: I wouldn't be surprised.
NICK WONG: Yeah, it kind
of makes sense why they
were so obsessed with memory things.
What do you think about
the hacks from Mr. Robot?
How accurate are they?
So Mr. Robot does all
sorts of cool things
on, like, cyber tech challenges
and cybersecurity things.
I'm a huge fan.
So generally, I think
they're pretty accurate.
He does all sorts of cool work
on projects ranging from, like,
the exploding bomb pset for example,
and all the way to the vulnerability,
I think, disk image,
which was very cool.
It's a very fun thing to go with.
And then Bhavik Knight
points out that, yes,
space has to be escaped with a whack.
It's super annoying to
make a dir with a space.
I agree.
Generally, I use underscores
instead or just don't use spaces.
Camel casing and underscores are
kind of two different paradigms,
and both I think are very valid.
Cool.
So I'm going to go back
into my home directory,
and we're going to talk a little
bit about some other commands that
might be really useful.
So we have cd, and we have ls.
cd is to change directories, and
it takes a directories name--
or just kind of where you want to go.
If I tried to go into developer--
which is a directory from
my previous directory,
but it is not in my home
directory-- this should fail.
And it says, no such file or directory.
And that's kind of a pain,
but it's just because I
didn't provide the right path.
So what I can do is add a slash,
and this will work totally fine.
And so, that's a actual, like--
I'm forgetting the name-- absolute path.
There, we go-- adding
that slash, as opposed
to the previous one which just
assumes some sort of relative path.
COLTON OGDEN: Right.
NICK WONG: And I'm going to go back.
I could have also just
typed cd on its own.
And also, some useful
tricks that are related
to terminals on a lot
of systems, but are not
necessarily directly inherent parts to
the terminal are the control commands.
So I'm a huge fan of
using them, because they
can make my life a lot easier a
lot faster, but a lot of people
don't know about them.
So let's say I was typing
out some very long command.
This is totally valid CS.
And I realized that I forgot to put a
quote at the beginning and type echo.
So I can do Control-A, and I can then
be at the beginning of my terminal.
And I can do just that.
Now it's a valid command.
COLTON OGDEN: I didn't know that.
NICK WONG: It's a very useful one.
COLTON OGDEN: That's a new one.
NICK WONG: Using your arrow
keys, you can actually
go up in order to access previous
commands on most systems, which
is also super useful as a shortcut.
Bless you.
COLTON OGDEN: Thank you.
NICK WONG: So I can go back
up to this previous command.
I can use Control-A to
edit something here.
And maybe I wanted to echo
echo or something absurd,
and then I realized that's a
completely invalid command.
So I could just press Enter, and
have it give me some sort of error.
But I can also Control-E to
go to the end of the line,
and Control-U wipes the line for me.
And so, I'm a huge fan of
using kind of the Control-A,
E, U, and L to clear off my terminals.
COLTON OGDEN: This is
very clearly, very quickly
showing me how little I know
about using the command line.
NICK WONG: I'm a huge fan.
COLTON OGDEN: MrMrO says, if I learn
Chinese, can I join the dark army?
I'm not sure what that's a reference to.
Do you happen to know that?
NICK WONG: I believe that's a
reference to the group of hackers
that kind of lives on the dark web.
COLTON OGDEN: Oh, OK.
NICK WONG: Ish, if you can find them.
COLTON OGDEN: Gotcha.
I had known nothing about
that, I have to say.
Tab is the only way you can get
around without ripping his hair out,
says TuxMan29.
My system is in English and French.
Can we talk about--
I'm assuming you'll probably get to--
NICK WONG: Yep, PS is the next
thing we were about to talk about.
Very nice.
COLTON OGDEN: I think this
is useful-- explainshell.com.
I'm not super familiar with it.
NICK WONG: Sounds like it
would explain the shell.
That's cool.
I like it.
COLTON OGDEN: GNOME Terminal displays
the full path before the dollar sign.
Is there any way to set
that in max terminal,
or do you always need pwd for it?
NICK WONG: Yeah, no, you
can totally set that.
And actually, we'll talk about
that right after we talk about ps,
or process, because I'm a huge fan of
customizing my actual prompt, as well.
And Macs totally allow you to do that.
COLTON OGDEN: You want to read this one?
NICK WONG: Yeah.
Frame of-- nice.
Frame of Ref says, hi.
Thank you very much.
I'm currently using
a piece with Windows,
and I'm wondering how to get a
PC with Linux through a server--
PC with Linux OS without dual
booting or installing it on my PC.
Thank you.
Basically, a virtual machine
would be a way of doing that.
VirtualBox is a great,
basically, visor for that.
It's free and totally open to download.
And then you could also use Docker,
which definitely has a Windows port,
I believe-- or it has
a Windows download.
And that would allow you to spin up
machines of kind of any operating
system on your computer.
COLTON OGDEN: They make
that super easy, right?
NICK WONG: Yeah.
COLTON OGDEN: Like you just did?
Docker for Windows and then
just get the, like, yeah--
super easy.
NICK WONG: So either
one would totally work,
and neither require you
to actually go through.
COLTON OGDEN: Tune in for our Docker
tutorial which will be coming up.
NICK WONG: Yes, that's coming up.
COLTON OGDEN: I'm not
sure when we booked that.
I think it was, like, after
Thanksgiving or something like that.
NICK WONG: Yeah, something like that.
COLTON OGDEN: It's coming
up, if you're curious.
And thank you, also, for
joining us, FrameOfRef.
Appreciate it.
RuneMacs, you can also Control-R to
search for previously used commands.
NICK WONG: I'm a huge fan
of the reverse search.
So Control-R-- if you have a command
that you know you typed a very long
time ago--
and you wanted to go
and find it, but you
don't want to press up
arrow to just go up one
at a time-- you can do Control-R
and then start typing the command.
And it will bring up the closest match.
It tries to go to the
nearest one in your history.
COLTON OGDEN: That's pretty cool.
NICK WONG: And basically, my
previous commands that had a py in it
is not Python.
It's actually me grabbing a
Lorem Ipsum from baconipsum.com
and pasting it into my clipboard.
So now if I do Command-V, we get this,
which is a weirdly meat-filled Lorem
Ipsum.
I don't know why that was
my command, but that's OK.
COLTON OGDEN: Get a little
insight into Nick Wong's daily--
NICK WONG: Into what it does.
Apparently, it's very strange.
COLTON OGDEN: ShanahG,
hello, with the Bob Ross--
PixelBob.
NICK WONG: Nice.
COLTON OGDEN: I'm wondering
this so I can learn Linux OS--
is there any online website you can
practice to type in the terminal
without installing Linux?
Do you know about that?
NICK WONG: Yes, there is.
I believe repl.com has a terminal--
COLTON OGDEN: --if your
internet's working for you.
NICK WONG: Oh, actually this worked.
So this is the Hacker Type.
COLTON OGDEN: Oh, nice.
NICK WONG: I can type random things.
COLTON OGDEN: So Nick is
actually typing right now.
This is him typing in
the console, showing
how skilled he is as a programmer.
NICK WONG: I believe this
is C++, so just funny.
COLTON OGDEN: You would
be the richest man--
NICK WONG: I would be so rich--
COLTON OGDEN: --in the world.
NICK WONG: --if I could type
that quickly that accurately.
COLTON OGDEN: All bug free?
NICK WONG: Super bug
free, that's awesome.
That's hackertype.net.
They're pretty cool-- or Hacker Typer.
And then there's also repl.it, I
believe, and that allows you to do it.
Or as suggested in the
comments, you can use Linux--
like, Bash on Ubuntu on Windows 10.
Or you can use a virtual machine.
You can use Docker.
There's a bunch of ways
that you could do it
without actually loading
it into the computer,
or at least without installing it.
COLTON OGDEN: Cool.
TIL.
A lot of TIL's for me today too.
This is very exciting.
Let me see.
Where did we catch up.
Sorry.
The Dark Army is a hacker
group in Mr. Robot.
NICK WONG: OK, good to know.
COLTON OGDEN: Docker is
very heavy, to be honest.
Yeah.
NICK WONG: Definitely room for debate.
COLTON OGDEN: It can be,
yeah, because I think
if you have multiple installations
that use the same container,
they optimize their space, right?
NICK WONG: Right, yeah.
There's some, like, very
good use cases for Docker.
And also the Docker
paradigm is certainly
not to have a full machine
running on a Docker container.
Although, a lot of us use them for that.
That is actually not
their intended use case.
They tried to make it more of like a--
kind of the Linux paradigm
but for applications,
like full complete applications,
which is very cool.
COLTON OGDEN: APSKnight, can we
customize the terminal in Ubuntu?
I think we're getting to that, right?
NICK WONG: Yep.
COLTON OGDEN: PerthKumar,
hi, I like your live session.
So easy to understand,
how you guys talk.
Thanks a million.
NICK WONG: Awesome, yeah.
COLTON OGDEN: Thank you, Perth.
Thank you so much for joining us.
Happy you think so.
PerthKumar007, great username.
Windows installed Docker today.
They ran out of memory many times.
I had to remove it.
Oh, sorry to hear about that.
That's unfortunate.
Don't leave your shell open.
Just Control-R, but will it--
NICK WONG: Control-R is
reverse search, so I'm not
exactly sure what you
meant by that, ForSunlight.
COLTON OGDEN: In case, he means--
he or she means-- maybe
if you quit your terminal,
they think that Control-R will
still work for what you did before,
but that's not the case, is it?
NICK WONG: Not entirely.
Not that I know of.
So basically, if you are--
I think, possibly what you mean
is like clearing out history.
So I can actually type history, and
I'll get a list of all the-- what is it?
The past 1,000 commands that I ran--
COLTON OGDEN: Wow, that's cool.
NICK WONG: --which is kind of neat.
There's some interesting ones in here.
There is some, like, waitress serving.
I was doing some git stuff.
COLTON OGDEN: What is waitress-serve?
NICK WONG: Oh, Waitress is a
server for, like, serving websites,
and it happens to work
with any WSGI application--
so like, Django, for example.
COLTON OGDEN: Oh, I see.
NICK WONG: Actually, I think I'm giving
a talk, that we'll talk about that,
on Monday.
COLTON OGDEN: Seminar or separate?
NICK WONG: Yeah, seminar
for, like, Django,
and how to kind of get
that out the ground.
COLTON OGDEN: Oh, OK.
Tune in for that--
CS50 Monday with Nick on Django
and Whiskey applications.
NICK WONG: Yep.
COLTON OGDEN: You can also use
Linux Bash on Shell or git.
Yep.
I was always told rm dash rf slash is
a fun time, says SlaterUSA, that's a--
NICK WONG: That's funny.
COLTON OGDEN: Definitely
don't type that.
NICK WONG: Don't type that.
Although, we will destroy a
Linux container later, but--
COLTON OGDEN: We had the troll
face-- we had some troll faces
in the chat for that one.
How did you pipe the output of your
curl command to your paste clipboard?
NICK WONG: So piping is
also a super cool feature
of, like, the kind of the Unix
paradigm or the Linux paradigm.
And basically what it does
is, let's say I wanted
to type in some random gibberish.
A pipe, or a vertical bar, basically
takes the output of that thing
and sticks it into the
input of the next thing,
and it's one of the greatest
inventions, I think, of all of Linux.
COLTON OGDEN: Piping, yeah.
NICK WONG: Piping.
COLTON OGDEN: Maybe like
chain programs together.
NICK WONG: Right.
And that's why everything can be so
modular-- so kind of lightweight.
You're not reusing things, and
it's also a lot easier to debug.
And so, when I echo this
random gibberish into--
I was going to pipe it into Word Count,
which also has a character parameter,
so you can just count how
many characters that is.
It's actually kind of
fun, so we'll do that.
So apparently, I typed 25 characters
of gibberish, that's coming along.
COLTON OGDEN: It's taking
the output of one program,
putting it into another
one, and then just, like,
chaining that over and over again.
NICK WONG: Yeah, you just chain them
all together, which is very fun.
But the question was actually, how
did I put that into my clipboard
and then paste it?
And so, on Mac-- this is actually
a Mac feature, I believe.
I don't know about it on Ubuntu.
But you can type pb copy, Paste
Bin Copy-- or Paste Board copy--
and that will allow you to
copy whatever the output was--
whatever went to standard out.
And then if I wanted to
paste that, I can either--
I believe pb paste is a command.
Yes.
So I can run pb paste to actually
paste that from my clipboard.
Or I can just Command-V,
and that will do the same.
COLTON OGDEN: Is that
for clipboard globally,
or is that just for your shell?
NICK WONG: That's for
the entire Mac computer.
So if I wanted to, like,
grab that onto my copy,
and then I could type
that gibberish here.
COLTON OGDEN: That's so cool.
NICK WONG: Very useful.
COLTON OGDEN: Yeah, that's really cool.
NICK WONG: I'm a huge fan of using that.
COLTON OGDEN: Let's see
where did we leave off on.
Hacker Typer is the Linux kernel source
code, which is in C. OK, that's right.
I think I did hear that before.
NICK WONG: That makes a lot of sense.
Yeah.
COLTON OGDEN: ForSunlight, Colton is
awesome to understand my questions.
Yeah, my pleasure.
Thank you so much.
JinxDecoy, the D is silent--
NICK WONG: --in Django, I believe.
COLTON OGDEN: Oh, yeah, yeah, yeah.
I'm on that, Django.
Can you please give us a big picture
of why one should learn Linux OS,
and basically how we can
become a skilled hacker
like protrayed in the show
Mr. Robot, says FrameOfRef.
NICK WONG: Oh, you guys
are referring to the show.
Oh, I understand a little bit better
what we're actually talking about.
I was thinking you guys were talking
about the guy, Mr. Robot, who--
I just realized that's also a show.
Sorry, one sec.
This is a little bit of a tangent,
but it is worth knowing about.
What is the name of--
virtual machine.
There's a Mr. Robot.
This is what I was thinking of--
was the mystery robot
virtual machine, which
is a CTF style virtual machine
totally worth going through.
It's very fun.
Sorry, I forgot about that.
Cool.
Now we're all on the same page.
And the question from
Frame of Ref was can
we have a big picture of why
one should learn Linux OS?
And to kind of break that
down, Linux is the name
of the actual kernel, just as an FYI.
And so, kernel is basically
the all-powerful being
that runs your computer.
There is-- in kind of, like,
low-level systems, classes,
and things like that-- people will talk
about user land versus kernel land.
And user land is very pretty,
like the rules all work.
People won't break things.
They're controlled.
It's like it has regulation.
It's like a civil society.
Kernel land is like just chaos.
It's just like, good luck.
Hope you don't die.
And so, kernel land is
basically not something
we're going to talk
too intensely on here.
But the Linux kernel has--
I think is on version 4.3--
4 point something at the moment.
I could be entirely wrong on that.
It is a pretty recently
developed kernel,
but it is a fantastic system
for how lightweight it is.
It's very small.
I don't actually remember whether or not
it's a monolithic style kernel or not,
and that probably was meaningless
to a lot of us, including myself.
But it is-- basically, it was built
by Linus Torvalds, which I'm hopefully
not pronouncing his name too horribly.
COLTON OGDEN: I think that's correct.
NICK WONG: And so, he did--
basically, I think he
wrote it mostly on his own,
and then there was a team
that kind of added on later.
And a lot of his greatest
inventions were the fact
that it is a just very modular system.
So I can take all of these pieces,
and plug them into each other,
and get things out of it.
It's very clean, as far as
like that modularity goes.
You don't need a command--
an individual command for everything.
You can kind of just go.
And you can build it with
these building blocks
to make all sorts of beautiful
tools and stuff like that.
I'm a huge fan of kind of
the Linux style of design.
I think that it's a very good,
like, clean coding style.
And I think that learning any operating
system based on the Linux kernel--
so like Ubuntu or like Arch
Linux or things like that--
gives you a lot of understanding
of just how your computer works
at a little bit lower level.
And I saw some paste, as we were going.
Someone asked how you could
find the kernel version.
U name dash a also works.
It'll release everything.
My kernel is not Linux, as an FYI.
It's the Darwin kernel
because I'm on a Mac,
but if I was on this, which is
a Linux machine in concept--
4.9.93, just as an FYI.
That lists all sorts of
information about your machine.
COLTON OGDEN: And that one's just
kind of, like, booting up the machine,
like it kind of tells
you in the beginning?
NICK WONG: Yeah, so it basically just
displays that information back out
to you. u name is kind
of useful, in general.
It has all sorts of
parameters and flags.
COLTON OGDEN: Oh, you typed in u name.
NICK WONG: I'm sorry.
Yeah.
COLTON OGDEN: I thought you
booted up a Docker shell.
NICK WONG: Oh, yeah.
This is a Docker container, but that
is basically what's going on there.
COLTON OGDEN: NikolajAJ123
says, what are you guys doing?
We are currently answering
questions, but we're
giving a Linux tutorial, Linux
commands, sort of Linux Flow,
and answering some other sort
of philosophical questions.
Like, how one can
become a skilled hacker?
That's not a philosophical question.
That's more--
NICK WONG: That one is a lot
of just experience, right.
Like, a lot of what we talk
about in our cyber security group
here is basically you want
to just go and learn stuff
by experience, by trying it.
And so, what we do is we host
a bunch of labs for people
and kind of throw them through it.
I have I have an open challenge,
I think, to anyone in my club.
If they can avoid being hacked by me,
I think, for like an entire session,
I'll give them $20.
COLTON OGDEN: White hack.
NICK WONG: White hat hacking.
White hat hacking.
This is all legal.
It's totally with their permission.
We're not hacking their
personal computers.
They all get a Docker
machine, and we go from there.
And I don't think I've
ever paid that out.
I'm looking forward to
hopefully next year.
I've heard there are some
cool people out there.
COLTON OGDEN: Sort of humble brag?
NICK WONG: Yeah, like a weird
flex, you know what I mean?
COLTON OGDEN: That's a straight up brag.
This is a straight up brag.
IAmKappa, what do you work with?
NICK WONG: So that's a great
question and a very large one.
Generally speaking, I like to
flip between some form of Ubuntu.
I actually have one open, I think.
Maybe not.
I have Ubuntu Virtual Machine
that I use for all of my projects
for my CS classes.
And then I use--
my just built-in Mac OS, and its kind
of systems for the rest of things.
But from time to time, I do switch over.
I do also have a Windows laptop
that I use for a lot of other stuff.
It actually dual boots Ubuntu,
so I can't really get away
from Linux and Unix style machines.
But I generally try to
stick to Unix style stuff.
I like Bash.
I like Fish, as far as shells go.
And I'm a huge fan of Linux.
COLTON OGDEN: JBorgon, says, oh, my god.
This is so cool.
Why are you like-- why
are you like a CS God?
NICK WONG: I don't necessarily
agree, but I really
appreciate the compliments.
COLTON OGDEN: Welcome,
also, IAmKappa and JBorgon.
I don't think we've seen you before.
And NikolajAJ123, as well.
Thank you for joining us.
NICK WONG: Yeah, thank you.
COLTON OGDEN: LincePotiguara,
you just did many CTF's?
NICK WONG: Yes.
So CTF stands for Capture The Flag.
It's something that a lot of
cyber people do just for funsies.
And you're very right.
That is why I'm struggling to
remember which one is which.
COLTON OGDEN: How do we
find the kernel version?
You went over that, u name dash r.
RuneMacs says it's monolithic,
referring to the [? Unix. ?]
NICK WONG: I believe it's a mix.
Oh, OK.
And then NikolajAJ123 says that
it is actually a hybrid of both--
COLTON OGDEN: --monolithic
and micro kernel.
NICK WONG: Thank you.
COLTON OGDEN: JinxDecoy, you can find
this info on the Linux Essentials.
It lets you get info for free
before moving on to LPIC-1.
NICK WONG: Yes.
That is very true.
I actually don't know
what LPIC-1 is, so you're
welcome to explain that in the chat.
But yeah, I agree.
Documentation is a great way to learn
a lot of things, if you can read it.
COLTON OGDEN: APSKnight
says, in my OS course
I learned that whenever
we run a command,
the shell creates a fork
process to execute commands.
What is the need for executing
commands in a new process,
using exec system call?
Why it can be executed-- why can't
it be executed in the same process?
What is the need for forking?
NICK WONG: Oh, great question.
We're probably not going
to get too into it,
because it is a very cool and
interesting thing to talk about,
but also very complex--
relatively complex.
But your question basically being,
why do we have to fork processes?
Why is every new process
thing a forked process?
Why does every parent have
to get a child and then,
like, exec some sort of
actual process in that child?
And the reason being for that--
roughly being that your computer has
several processors, but a processor,
give or take, can only
execute one process at a time
or one thread at a time even.
And so, what that means is that if
we want to run multiple process--
or multiple, like, things all at
once, like having the screen display--
having, like, Windows open or
having, like, a Microsoft Word open,
and then also checking your email.
You want them to be able
to run simultaneously,
and they do not share
almost any of the same code.
And so, basically, what
should happen there
is you should be able
to open up some process
and then have it create a new
child process that can do that.
So I believe-- oh, I forgot
the name of this one.
There is a, just, grandparent process.
I believe your kernel is
that grandparent process.
And it forks a bunch of processes
out from underneath itself,
and then those become kind of
what you end up actually using.
And so, there's all sorts of really
cool things in theory on that.
If you want, CS61 at Harvard
has a great website for that.
You'll know you're there, because it
has the Hello Kitty icon, I think.
That Hello Kitty picture actually has
a bunch of executable stuff in it,
which is kind of cool.
And they do a really great explanation
much more eloquently than myself,
but it is a very cool way to learn
all sorts of things about that.
Oh, yes.
The name of my cyber security club
is Harvard College Cyber Club, HC3.
And we do all sorts of cool things.
At the moment, we're kind of on a
hiatus, because I have been busy.
But generally speaking,
in the spring, we actually
go and compete in a
cybersecurity competition.
We do the Northeastern Collegiate
Cyber Defense Competition.
It's very fun.
Cool.
Andre pointed out that Ubuntu's
version of pb copy is x clip,
but in order to actually copy to
the clipboard you have to make sure
that you point out selection clipboard.
That's very good to know.
I didn't know that.
COLTON OGDEN: And that's just
a repeat of the other one.
JinxDecoy, chmod or change--
I forget what that's short for.
NICK WONG: Yeah, change modification.
COLTON OGDEN: Hungry.
NICK WONG: That's awesome.
COLTON OGDEN: It's a good incentive
for not get pwned, says LincePotiguara.
NICK WONG: Oh, I haven't
learned pwned in a long time.
That's great.
COLTON OGDEN: JBorgon, do you
do CS50 as a full-time job,
or do you have other stuff you work for?
NICK WONG: Yes.
Actually, CS50 is just a very
small part-time job for myself.
I do it as kind of a CA.
And I like to teach people.
I really like teaching.
I'm a huge fan, but I'm
actually a full-time student.
I go here.
COLTON OGDEN: Yeah, it
takes a lot of time.
NICK WONG: And I spend
most of my time doing that.
COLTON OGDEN: I heard
it takes a lot of time.
NICK WONG: It takes a
little bit of time, yeah.
Oh, LPIC-1 is the first half of
a certification for Linux admin.
Oh, that's awesome.
OK.
So that is really cool to know
and certainly worth going through.
I think a lot of--
there's a lot of these, like,
great kind of certification courses
and kind of ways of
educating yourself on this.
And at the very least,
they just tell you
all sorts-- they give you the
experience you need, basically,
to see all of these things by
experience, which is very cool.
Oh, right.
The init process is your grandparent.
Thank you.
It's the granddaddy of all
processes, roughly speaking.
Very cool.
If you don't fall asleep,
you can take LPIC-2.
That's good to know.
And then we got the grandparent process.
Awesome.
COLTON OGDEN: Boi got
ambition, says Nikolaj.
NICK WONG: Appreciate it.
Yeah, there's a there's a lot to that.
Cool.
So we have covered,
what, I guess cd and ls.
So we're also going to
talk about ps, which
was requested a little bit earlier.
It stands for process, and it's going
to list out to us all the processes
running on our machine, in concept.
It will try and list
out, for you, all the
processes you have access
to, kind of, talking about.
And it will tell you any information
you really want, actually, about these.
This is another command, where
the flags that people pass to them
tell you a lot about
how they learned it.
So my professor for the class
that I'm in right at the moment,
I believe he uses aux ww.
I don't know what the ww is
for, but it seems kind of cool.
I use aux, which is All
Users and Executing, I think.
Don't quote me on that.
It helps me-- nope.
OK, maybe I don't use aux.
That's kind of cool.
Good to know.
I really don't use aux then.
Let me think about that for a second.
I'm pretty sure I do.
Oh, OK.
So that's actually a slight difference
between Bash on an Ubuntu server,
versus Bash on Mac.
I didn't realize that.
I guess I've just never tried
to run ps.aux on my Mac.
So ps dash a will tell you as
many of the processes, I believe,
as it can-- with capital M.
COLTON OGDEN: Just infinite
processes right there.
NICK WONG: And we can
actually-- maybe at the end,
we'll run a fork bomb
on one of our machines.
COLTON OGDEN: What is a fork bomb?
NICK WONG: So basically, discussing
what was kind of brought up
a little bit earlier-- was
having the, like, forking things,
forking processes.
A fork bomb is a process
that, basically what
it does is, it just forks
itself and then runs forever.
And so, it tries to fork--
it creates a copy of
itself, forks that, and then
also continues running on its own.
And so, eventually, you
just run out of memory.
COLTON OGDEN: It's kind of
like recursion, kind of like--
NICK WONG: Yeah, it's a
recursive forking of processes,
and it's really cool.
It's kind of funny.
It became really popular,
in part, because it just
looks really cool when you
type it out, because there
is a way to type it
that's all in just, like,
colon bar and, like, curly braces.
COLTON OGDEN: So that's something
you think you might try and do?
NICK WONG: Yeah, I think we'll run
that on one of my Docker computers.
COLTON OGDEN: Yeah,
probably not on your--
NICK WONG: Not on my actual computer.
I want to be able to kill it.
Sweet.
COLTON OGDEN: Nick, are you Elliot
from Mr. Robot, says Shanah.
NICK WONG: I'm not sure if
that's a compliment or an insult,
and hopefully that's a compliment.
Either way, I'm glad I'm
a person from a TV show.
I appreciate that.
COLTON OGDEN: They were asking, earlier,
if you were a hacker, or how to be one.
Sorry, how to become a hacker.
So I'm guessing maybe
there might be some--
NICK WONG: Hopefully.
COLTON OGDEN: Please list the website.
I can write it in here, if you want
to tell me the website with the--
NICK WONG: Yes, it's
cs61.cs.harvard.edu.
COLTON OGDEN: That it?
NICK WONG: Yep, that's the one.
It's a great site.
The professor is fantastic, and the
class is also just very, very well
taught.
So I believe those lectures
are open to everyone,
and you're welcome to read
through all the stuff we've done.
It's definitely, I think, one
of my favorite CS classes here.
Sorry, 124, and 121, and CS50.
COLTON OGDEN: No, I totally understand.
You're here today with us, so
that's all that matters, man.
NICK WONG: That's true.
Wow, that's awesome.
I didn't know you were still a student.
Yes, still a full-time student.
I am a junior.
We're still working through that.
Do you still work with CS50 over the
summers, or do you do other stuff?
I actually thought about working
for CS50 over this last summer,
but this upcoming summer I'll
be going and working at Google.
COLTON OGDEN: Shout
outs to Nick for that.
Congrats to Nick.
NICK WONG: Thank you.
I appreciate it.
And so, I'll actually be over kind
of in California for the summer.
COLTON OGDEN: No dashj--
what was that a reference to?
NICK WONG: I'm not entirely sure.
But no dashj--
I'll take your word for it.
That's probably correct.
COLTON OGDEN: Am I late, says DhananJay.
We haven't covered too much.
NICK WONG: No, we actually
haven't gotten through too much.
COLTON OGDEN: ls, cd, ps.
Much more, I imagine that we can--
oh, it looks like they found it,
cs60.seas.harvard.edu/site/2018.
NICK WONG: Exactly.
And then NikolajAJ123
points out that you can
combat a fork bomb by setting ulimits.
Ubuntu also has some kind
of built-in stuff on,
like, how many children
you can fork at a time.
And like, there's a limit on how many
you can do to actually help that.
But that is very good to know.
Oh, ps aux.
Very good to know.
Thank you.
COLTON OGDEN: They found your club too.
NICK WONG: Oh, nice.
Yes, you did find our club.
That website has not been updated
in an embarrassingly long time.
Yeah, we should really update that.
I will update that probably over
winter break when I actually
have time not to do psets.
That is very good to know.
On a Mac, it's psaux no dash.
I did not know that.
COLTON OGDEN: TIL.
NICK WONG: Oh, yea.
TIL.
COLTON OGDEN: TWL.
NICK WONG: There you go.
Sweet.
So looking through this output,
it can be very confusing.
There's a lot of output here.
It tries to give you the path
of the executable that was run.
That's at the very right.
And maybe you only want to know if,
like, a certain process is running.
So what we might do is let me
see if I have any executables
that I can just run and then ditch.
Let's go and do faceAuth.
So let's say that I'm running some
sort of Python3 manage.py runserver.
Hopefully, that just runs on its own.
Of course, it doesn't.
Is it worth showing?
Yeah, it's probably worth showing.
Oops.
OK, maybe not.
You can run a process.
I just can't think of anything
reasonable to run right now.
As it's running in the background,
you could then go and search for it.
So let's say that I wanted to go
find a process, and I knew its name.
A process that I happen to know is
probably running would be ps, actually.
And so, I can use this
program called grep,
and this is a really good command for
demonstrating just the power of kind
of the Linux paradigm--
is basically I can run ps, which
just lists out a bunch processes.
aux customizes that command to
give me actual output that I want.
Then I can pipe that output into
some other command that takes,
as input, a bunch of, like, strings.
And so, what you can
do is-- then grep will
allow me to search through those
things and only print out lines
that contain parameters that I want.
Or you can actually flip
that by using dash v,
and that will, say, don't throw any
of the things that you want in here.
But we're going to actually look
for ps, and apparently there's
a couple of lines that have ps in them--
which makes sense.
It's literally going to just
kind of do a, like, ps check.
It just takes the characters p,s, and
sees if they're in that string at all.
So this giant line seems
to have ps somewhere.
I believe it.
COLTON OGDEN: HTTPS.
I see it.
I see it right there.
NICK WONG: Oh, there it is.
Yeah.
Wait, where is it?
Oh, yes.
There we are right here.
COLTON OGDEN: A couple places.
NICK WONG: Nice job.
So yeah, there's that.
It'll also tell me the line
that is running ps itself,
as well as grep, because
those are both processes,
and they will show up
in our psaux command.
They will also give you the
PID, which is very useful.
COLTON OGDEN: Bhavik says it's
working on WSL, the psaux.
NICK WONG: Oh, beautiful.
That's great.
COLTON OGDEN: Kareem's asleep.
NICK WONG: Good point.
COLTON OGDEN: Shout outs to
Kareem in the chat, everybody.
Kareem did the GitHub and
CICD stream with us before.
NICK WONG: So we can sleep 1,000--
Control-Z stops a process
but doesn't kill it.
And then I can just background
that process using bg,
so it throws it into the background.
It is actually still running.
And now if I psaux, I can grep for
sleep, which is honestly something
I should probably do in my real life.
And that will tell me that sleep 1,000
is still running, which is very cool.
Now if I wanted to kill it, I
could look at this process ID 7717,
and I can say kill.
For a stronger version of kill, kill 9,
but I'm going to be gentle, I guess--
7717.
And now when I rerun that,
it's been terminated,
which is very useful to know.
If you're actually on a Linux machine,
this can be kind of entertaining,
where if someone has ssh'ed
into your Linux machine,
you can do w to see who is on there.
Watch is another useful
command to combine with that.
I don't have a particularly great
example for this, at the moment,
but that's OK.
And so, w just tells you who's
on the machine currently,
and you can actually find, like,
the process that is their shell,
and kill it, and you can
kick them off your machine.
COLTON OGDEN: That's amazing.
NICK WONG: The more you know.
COLTON OGDEN: That's really cool.
NICK WONG: Cool.
COLTON OGDEN: Frame
of reference said, I'm
amazed about both your energy levels.
I really appreciate both
of you for doing this.
Well, thanks for Nick for kindly
taking us through this tutorial.
This has been really cool.
This is educational for me, as well.
NICK WONG: That's awesome.
COLTON OGDEN: I enjoy doing this a lot.
NICK WONG: Awesome.
Another runable command that
would just go on forever,
while true loops are also very useful.
COLTON OGDEN: Run nano or vim.
Less.
NICK WONG: Literally, it's like--
when you're doing a live demo,
you will immediately blank on anything
you actually want to say or do.
COLTON OGDEN: This has
happened to me so many times.
NICK WONG: All the time.
COLTON OGDEN: Like, I'm trying to
find, like, stupid bugs that take me,
like, 10, 15 minutes.
NICK WONG: Yeah, exactly.
COLTON OGDEN: Like, a
beginner would be like, dude.
NICK WONG: Right.
And like, everyone in the chat
is like, it's very obvious.
And you're like, yeah, you're right.
No, you're correct.
It's very obvious.
I'm just dumb.
COLTON OGDEN: What is the
difference between pipe and the--
NICK WONG: Oh, and arrow.
COLTON OGDEN: --the greater than sign?
NICK WONG: Great question.
So that actually brings
us to our next, kind of,
set of commands, which is great.
Let's say I wanted to just take
a snapshot of everything that's
running right now and write
it to some sort of file.
So I can use this redirect or
the kind of greater than sign,
and I can pipe output into some files.
This will save it in some file.
We'll say current--
OK, another thing with live demos is any
time you try to type, you're screwed.
You will just not be able
to type correctly live.
COLTON OGDEN: Yeah.
NICK WONG: I misspell
things constantly on here.
So I have now piped that
into currentprocess.txt.
People have suggested that I could
use, like, nano to view that.
Tab completed there.
And I can now see everything
that's going on here.
Very useful.
And then to get out
of nano, you can write
output using Control-O. I
use Control-X. And then if I
made a change, Control-X, Y, Enter.
And that means that it's just going to
Control-X, save everything, and then
save at the current name that it is in.
There are all sorts of
ways to customize that,
but if I didn't want to do that I could
actually cat this into my console.
And cat is concatenate--
is what it stands for,
which is kind of counter-intuitive,
because we don't seem
to be concatenating it with anything.
But we are actually concatenating
it with the console's input,
so you're just kind of
shoving it into that.
And that's what actually
ends up happening.
COLTON OGDEN: Is it
accurate to frame them
as, like, pipe would be
used in between processes,
and then the greater than
sign is used for files?
NICK WONG: Yeah.
So the greater than sign, or
redirect, is going to write to file.
And this is a write redirect.
However, you can also instead
of-- so if I rewrite this,
this will overwrite the file.
It just starts at the beginning,
rewrites it, that's it.
But I can append to it too.
So if I do two of these, now it's going
to append to that output every time.
And what I can do is if
I cat current process,
and I do a word count by line, that will
tell me how many lines are in there.
And doing this append, we're going to
just increase in the number of lines
as we go.
COLTON OGDEN: So what would happen
if you did this with a fork bomb?
NICK WONG: That would
be very, very funny.
If you basically monitored
the number of processes,
you would see it just shoot
upwards, hopefully, exponentially.
COLTON OGDEN: Or if each of those
processes did that-- append to a file?
NICK WONG: Oh, like append to a file.
That, I believe, what
ends up happening is
you would end up just writing an
enormous file, which is very cool.
COLTON OGDEN: There are no
precautions against it, necessarily?
NICK WONG: Not necessarily.
I think you would just would run
out of disk space eventually.
COLTON OGDEN: Wow, that's one way
to screw somebody over, right?
NICK WONG: Yeah.
It's a very-- it's like the
troll way of messing with people
is doing something like that.
COLTON OGDEN: Kareem says,
amazing as usual, Nick and Colton.
Thanks so much, Kareem.
NICK WONG: Thank you, Kareem.
COLTON OGDEN: Looking forward
to having you on again.
We're going to get you back in here.
Here's one from APSKnight.
What's the difference between
Control-C, Control-D, and Control-Z?
NICK WONG: Very nice.
So Control-Z will pause a
currently running process.
So I can do while true, as given
in the previous suggestions.
Let's say do--
COLTON OGDEN: And so right now you're
writing, like, a Bash scripting syntax?
NICK WONG: Yeah, this is actually
a Bash scripting style syntax.
So the semicolons
separate out statements,
so that you can run it all in a line--
or do it in a one-liner.
The while true means just go
forever, because while checks
if some sort of condition is true.
And true is always true by
definition, so it will run forever.
And then within that,
we have do and done.
That's kind of the body
of your while loop,
if you're used to programming in, like,
C, or C++, or something like that.
And done is basically where
it stops running that loop,
and then do will execute
everything after it.
And so, this is going to just echo
hello forever, which is very cool.
Now I can stop that
with Control-C. That'll
prevent it from continuing to run.
Control-D doesn't actually do anything
in this case, because it's end of file.
That's what it actually sends.
And so, you can do all
sorts of cool things
with Control-D if it's
looking for an end of file
as it's, like, condition for ending,
but you don't want to kill the process.
And there's actually some other nuance
to Control-D that I am not aware of
and will not try to
pretend to be aware of.
Control-Z is going to--
well, when it gets there.
Yep.
Oh, that was a mistake.
There we go.
Control-Z will background a process.
Sorry, not background a process.
It will stop a process but not kill it.
And then you can
background it from there.
You can foreground it from there.
You can do all sorts of
things with it from there.
So what we're going to do is
actually stop having it print output,
because that is very annoying.
We'll just sleep 1, and this is just
going to kind of infinitely pause.
Control-Z will pause that--
will stop that process.
And then I can actually bring
it back into my foreground,
using fg, which means that it's
a job that is running, like--
currently I can interact with
it and do all sorts of things.
But I can also put it into the--
or there is no current job.
But you can type bg to background
it, which is what I did earlier.
And if I wanted to just check
and see if it was still running,
I can see if it's actually
going, and it's done.
Sleep 1 actually doesn't do
anything very much on its own.
It just sleeps for a
second, and then it's done.
So it's a very quick program.
And basically, what ended up
happening there was the process,
that we were in at that
time, was the sleep process.
And that's what got stopped.
The name of the process
is generally-- like,
if I were to wrap that in some sort of--
put it into a Bash file and
then run that as a script,
then it would have actually stopped
that file because that file was
being executed as process.
But in this case, we actually just
stopped it in the middle of sleep,
and so that's the process that
actually got foregrounded.
And that's why it exited very,
very quickly, which is very cool.
So I'm actually going to check and
see if that while is still running.
Oh, no.
OK.
COLTON OGDEN: NikolajAJ123
says, of course, it's hard.
It's pressure.
No worries.
I work with this, but I enjoy the
stream and might learn new stuff too.
NICK WONG: That's awesome.
Thank you.
COLTON OGDEN: Thanks for tuning in.
We appreciate it.
It's part of the fun of
doing everything live.
You know, you never know
what's going to happen.
And also, thank you for--
since you can't subscribe
with a Prime sub,
thank you very much for your support.
We are working on getting subscriptions
working, but in the meantime
your Follow is much appreciated, as is.
NICK WONG: Yeah.
COLTON OGDEN: Blue Booger
says, greater than ampersand 2.
NICK WONG: Right.
So basically what Blue Booger's
comment is greater than ampersand 2--
means pipe, or redirect--
both your standard output,
which is what will be redirected
regardless, and the standard error.
So there are actually two outputs
that go to console, in general.
And on this sort of like Bash
and kind of paradigm shift,
in general, they will
use standard output
to just print out the actual output.
That's what actually gets redirected
usually when you just use this.
If you add the ampersand
too, there's the error output
will also get printed out--
or redirected to wherever
you want it to go.
So this is a really useful
kind of thing to add
if you want to make sure you're
capturing all output, not just
the standard output.
Very good point.
COLTON OGDEN: It looks like
GX2G says, great show, guys.
NICK WONG: Thank you.
COLTON OGDEN: I'm going to
watch this all the time now.
GX2G says, hi.
Thank you very much for joining us.
Glad to have you with us.
Let's see.
Make sure we didn't miss anything.
SergiVB01 says tail dash f.
NICK WONG: Cool.
So tail is-- actually, there's a
counterpart to that command, head.
And basically what those
allow you to do is--
the concept is head will just take the
first 10 lines, by default, of input
and print them back out.
So if I were to do--
what was it?
I think head of currentprocess.txt.
That's just the first 10 lines.
tail of currentprocess.txt
is the opposite.
It goes from the bottom and
reads out the last end lines,
or you can actually customize that.
I actually don't know
the f parameters in tail.
Oh, follow, like continue.
So that'll just do it as you go.
It'll only display out to
you the last, like, 10 lines,
but it will kind of keep
updating it as you go.
So I could run in another window.
This is another version of my Bash.
I think it's really cute-- penguin.
And it says random gibberish from
the internet, which is kind of cool.
I could actually right now--
that hasn't been written yet.
We can just take this and append
it to currentprocess.txt, sleep 2,
and then that'll execute.
Oh, I'm clumsy.
I tried to get back there
before, so you can see it.
COLTON OGDEN: But you can see there--
NICK WONG: But it has changed.
The output has changed.
COLTON OGDEN: So just any
time the file gets modified,
it's listening for that modification.
NICK WONG: Yeah.
And it just kind of sits there
and waits, which is very cool.
COLTON OGDEN: That's really cool.
NICK WONG: Oops, I just tried to
clear a screen that is still running.
COLTON OGDEN: Even
after hundred of times,
I always get the standard out
and standard error pipes wrong.
NICK WONG: Yes.
COLTON OGDEN: I usually
use the ampersand--
NICK WONG: Ampersand redirect, yes.
That is a great point.
COLTON OGDEN: By greater than filename,
make it empty the contents of the file.
Control-D quits.
NICK WONG: Correct.
Control-D does not
necessarily always quit,
though it does frequently
get used for that.
It actually just sends end of file.
so if you have something that
is listening for end of file,
then it will actually quit, which
is pointed out by the next comment--
which is if you use a while cn,
greater than, greater than--
then Control-D will end it, because
that one is actually listening
for end of file to be printed.
And this is a very good command
to know, which is basically
just taking nothing and echoing that, or
redirecting that, into currentprocess.
So now if we cat currentprocess, there's
nothing in it, which is very cool.
It is a very clean way to empty a file.
COLTON OGDEN: This one right here.
NICK WONG: You talked about sys calls
when now going through processes.
If you use my while loop
above and then use strace,
you can see the sys calls
the processes performing.
Yes, that is 100% correct.
Sys calls are things that actually
happen between the user land and kernel
land.
So it's my way of invoking the kernel.
It results in a protected
control transfer,
and then the kernel takes over
and starts actually doing things.
So some very common sys
calls are like wait--
sorry, write.
I tried to spell it in my head and
spelled it wrong-- are write and read.
So am I reading or writing to disk?
And there's all sorts
of cool things about,
like, how buffers work
in a modern computer,
and they make writing and reading
a lot easier a little bit.
Well, easier in the sense
of they are much faster.
They aren't necessarily easier.
They're a little bit
harder to understand.
But yeah, so sys calls are the way that
we actually interact with the kernel.
It's very protected, and there are
some pretty-- they're pretty minimal.
They generally do just
very simple things,
and they also have that
concept of modularity.
COLTON OGDEN: Kind of like an
API the kernel defines for you.
NICK WONG: Yeah.
Actually a very good
way of thinking about it
is it's just kind of your
interface for the kernel,
and that's, yeah-- that's a rough
idea of it, but it is kind of-- it's
definitely correct.
And that's what we're
looking for here. strace
is a program that lets you actually see
the sys calls that are being performed.
And the cool thing
about is trace output--
I don't know if I have any programs
that would have good output.
I'll think about that.
But a cool thing about strace is
it also tells you the parameters
that the, like, read and write
calls were performed with,
so you can actually see what was written
actively to file, which is very cool.
What is multiple files--
oh.
If multiple files are sleeping,
which one will go in the background?
It's whatever the current job is.
So you have an actual job
or process that your shell
keeps track of as like the current one.
The shell, itself, kind of
keeps track of that for you,
so it's whatever one is the current
one will get put into the background.
COLTON OGDEN: D3AA says, I hope
you'll get affiliate Twitch.
My internet here is bad.
We're working on it.
We hope to have that adjustable
stream quality here for you soon.
tail -f is dope for logs.
NICK WONG: Tail -f is dope for logs.
COLTON OGDEN: JLardinois,
which, correct me if I'm wrong,
but I believe this is John
Charlie on the Facebook--
says I must have missed
something, just joined.
Sweet matrix animation.
NICK WONG: Oh, right.
This is one of my favorite
things in a Bash terminal.
This is actually the C
Matrix program running,
and then it's being piped into
lolcat which makes everything
beautiful and rainbow colored.
And you can change, like, the
speed, and colors, and things.
COLTON OGDEN: I feel like you
should bring that up at some point--
how you actually do that--
because it's a super cool thing.
You touched on it last time.
NICK WONG: Touched a little
bit on it, but I can actually
go into that here, especially in this.
Oh, right.
COLTON OGDEN: Let's fork bomb.
Let's fork bomb, says X2G.
Oh, we got a special guest
here in the chat, everybody.
NICK WONG: Special guest.
DAVID MALAN: It sounds
like you're really
doing an in-depth academic
discussion here, huh?
COLTON OGDEN: Just talking about
some, you know, white hat type stuff.
NICK WONG: Yeah, we've got some
we've deviated all over to like,
Hacker Typer.
DAVID MALAN: Oh, so
you're simulating doing--
NICK WONG: Yeah.
That way we look cool, but--
DAVID MALAN: We actually just showed
Hacker Typer today in our Muppet video.
COLTON OGDEN: I realized that while
I was watching it, because remember
I sent you the link for it recently.
I was like, go check out this website.
I thought it was a new website.
It was from, like, 2010.
DAVID MALAN: Well, I
don't mean to interrupt.
But hello, everyone.
Nice to see you, as well.
Just wanted to pop in to say hello
to Nick, our special guest, and then
Colton.
NICK WONG: I appreciate it.
DAVID MALAN: The Jedi Master--
NICK WONG: Good to see you, as well.
COLTON OGDEN: --says, John.
Hey, professor.
Hi, David.
Nice to see you.
Hi, David.
We had we had a lot of people today.
We were at 66 people earlier.
Right now we're at 41, so
we are-- we have a lot of--
DAVID MALAN: [INAUDIBLE]
NICK WONG: They knew you were coming,
so they're like, I got to leave.
COLTON OGDEN: Watch
them pour back in here.
But yeah, I think-- what
we're about to talk about?
DAVID MALAN: Hopefully Linux commands?
NICK WONG: Yeah, all
actual Linux commands.
DAVID MALAN: Nice to see you, everyone.
NICK WONG: Yeah, thank
you for coming by.
COLTON OGDEN: Thanks for stopping by.
NICK WONG: Yes.
So we were going to go and talk about
something-- redirection, and kind
of piping, and things like that.
So yes, we have this
kind of appending, which
is using the double greater than sign.
We have just catting things out
or redirecting and rewriting
the files, which is just
the greater than sign.
And then we have pipe, which takes
input and writes it to output.
Cool.
So I think we have now gone through
ps, aux, and the options to that.
Oh, right.
Someone also pointed out that
there are some really cool ways
to watch what processes are going on
in, like, a little bit more informative
and maybe interactive ways.
So top is a program that
is really useful for that.
I don't know--
I don't remember if it
comes by default on Mac OS.
I have it because I brew installed
it if it didn't come, and if it did
then I have it because of that.
So you're welcome to
try and figure that out.
If you don't have it, and you type
top, and it says command not found,
then you can use homebrew, which is
kind of like a package manager ish,
unofficial package manager, for Mac OS.
Super useful.
They do a lot of really cool work, so
I use them to kind of install stuff.
And it will list out
the processes, and you
can organize it by all sorts of stuff.
You can like-- there's all sorts of key
shortcuts that I don't know in this.
Yeah, here's some cool ones
that let you change what
is actually being displayed in top.
Top on Mac OS is not super great.
I actually don't like, it a whole lot,
but it technically works pretty well.
It also works really well on Linux
systems, so it's very useful for that.
There's an even cooler
version of it called htop,
and that puts things in color.
It's the same information
but a little bit prettier,
and I actually personally prefer this.
It also gives you the
instructions at the bottom,
which I really need
because I'm constantly
in a state of losing my marbles.
COLTON OGDEN: It looks like
an old DOS user interface.
NICK WONG: Yeah, exactly.
That's exactly what it is.
And I think it's built by the same set.
And so, yeah, you can
actually scroll through this,
and you can, like, mark processes
that you really want to watch.
And there's all sorts of cool
things you can do with it.
I'm a very big fan of htop.
Top is OK.
COLTON OGDEN: Is it kind of like a CLI
version of, like, activity monitor,
or like the--
NICK WONG: Yeah, that's
exactly what it is.
I think Activity Monitor actually
is a GUI version of that.
COLTON OGDEN: Yeah,
that would make sense.
That would make sense.
NICK WONG: It came afterward.
COLTON OGDEN: That makes sense.
Let me see.
Abdel24Hour, greetings from Egypt.
NICK WONG: Oh, wow.
COLTON OGDEN: I have been
using Linux for four years now.
NICK WONG: That's awesome.
COLTON OGDEN: Thank you
for joining us from Egypt.
Glad to have you, Abdel.
rm dash rf, then two characters,
and everything is gone.
NICK WONG: Yes, rm rf.
rm is actually a useful
command, in general, to know.
rm actually just says remove.
And so, if you wanted to
remove a directory though,
that gets a little bit trickier.
Let's see if there's a directory
I don't care about removing.
COLTON OGDEN: To demonstrate,
make a dir, and then delete that.
NICK WONG: Right.
Actually, a good point.
So let's make dir somedemo. mkdir is--
I dunno why I'd say dir.
I sound kind of dumb when
I say that, but it's mkdir.
And so, I'm going to make directory.
I should've switched the order
of those words, but that's OK--
my Linux demo directory.
And now I have a directory.
I can go into it.
I think I have a bunch
of things called demo.
And there's nothing in here.
If I do-- all right, that's not on OS.
ls dash alh--
I just see the current
directory, the one before.
And so, there's nothing
in this directory,
but even then if I try to remove
demo Linux, it's going to tell me
it's a directory.
So you can actually remove
dir, which technically works,
but it's kind of annoying.
So rm dash r.
Excuse me.
If you add i, that makes it interactive.
Do you actually want to, like,
see what's going on in there?
And no, I don't.
And so, that's kind of
a useful thing to know.
Otherwise, the f will
force it to happen.
It won't ask you.
It won't care.
Any error that occurs, it
just powers through it.
So when people suggests like rm dash rf
like slash or like slash star dot star,
things like that, they basically allow--
that command would, in concept, ruin
everything it could possibly touch.
Now if you run it as a
regular user on a computer,
hopefully the permissions
have been set up such
that they can't actually touch anything
in these kind of upper directories,
but they would still get anything
below because it's recursive--
so it would just go all way down.
And so, don't do that.
Not a very good command.
COLTON OGDEN: Which is what
JLardinois, John, suggested.
Can you make rm dash rf slash
for backing up files, right?
NICK WONG: That is fantastically funny.
rm dash rf dot slash is
for backing up files.
It certainly is not for backing up file.
Do not use it to back up files.
We have to be very clear
that we are joking,
because there is possibly
someone who will do that,
and then we will feel very bad.
COLTON OGDEN: Yeah, that will delete
your hard, or at least delete as much--
NICK WONG: As much as it can.
COLTON OGDEN: --files as
you can have access to.
NICK WONG: There are some
things that it cannot remove.
Can you make a file named recursive.txt
with the code sourcerecursive.txt
and run sourcerecursive.txt?
In concept, yes, you can do that.
I don't know what it would do though.
I'm not entirely sure
what it would try and do.
It hopefully would stop.
rm dash rf slash is
blocked on today's Linux.
If you run it as sudo, nothing can
really actually be blocked from you.
So technically yes, but you
could actually get it to go.
We will get customizing the prompt.
That is our next section.
ncurses is a very cool,
little thing to use.
It's something to go and
look up, if you'd like.
Move home--
COLTON OGDEN: I think they're
referring to the activity monitor
thing you were after.
I think that was ncurses.
NICK WONG: As the--
oh, right.
That's exactly what
they're referring to.
I'm losing my marbles.
Moving your home directory, all of
the items in that, into dev null.
So dev is an interesting directory.
It stands for devices, and it has all
sorts of interesting things in it.
So for example, we'll do head
of this, because it's going
to ruin a little bit of my output.
dev random spits out random
gibberish, and my console just
doesn't know what to do with it.
That was actually a pretty mild version.
If you spit out random
bytes to a console,
you can actually mess up your
prompt and all sorts of things,
because you can run sorts of,
like, control commands by accident.
So that's kind of cool, and I actually
just found out about dev random.
I didn't know about it
before-- super useful.
dev null is another thing
that is also kind of cool.
And what we can do is
let's say cat dev random,
and we're going to just redirect
that output into dev null.
And this will do nothing, because
it doesn't have any other output.
But it's going to do that forever,
because dev random is actually
an infinitely long file in
that I can cat it forever.
And that's kind of nifty.
I'm going to exit out of that one.
But it's kind of a fun, useful thing.
If you wanted to take some output of
some program and just throw it away,
then you can actually do that
redirection into dev null,
and that does that right for you, which
can be very useful in certain cases.
So the devices directory is very useful.
Apparently, you can do wget.
wget is like web get.
You just pull a website,
and it just downloads it.
So you can do like HTTPS
google.com, and it will bring it
to me, which is kind of cool.
I now have their index page, not
that I couldn't get it before.
COLTON OGDEN: This person
is saying, malicious source.
NICK WONG: Malicious source, yeah.
COLTON OGDEN: And they
have this dash zero dash.
I'm not sure what that is.
NICK WONG: Right.
That's a set of parameters
to wget that allows you,
I believe, to dictate, like,
what kind of objects you can get,
and how you wrap them
up when you get them.
And then it pipes them into
shell, which will then execute it.
From the name, malicious source,
sounds like it's not a very good thing.
It sounds pretty dark to you, so
probably don't want to do that.
inode, cool.
And then what's the code to--
oh, that's the code to
install more ram, right?
Very funny.
Yeah, no.
That is not the code to install
more ram, just to be clear.
That is not how that works.
Cool.
It might actually break
your disk if you're unlucky.
Read an article about it.
Yeah, it can do all
sorts of nasty things.
It also depends on the permissions
setup, and which user is running it.
Generally, it's just not
a good command to run.
COLTON OGDEN: No, yeah.
NICK WONG: Usually.
rm dash rf to clean log
files, totally reasonable.
I use rm dash rf constantly.
I just don't use it
on my home directory.
Null is a black hole.
Yeah, it's exactly a black hole,
and it just kills off data.
To the best of my knowledge, it
does not get bigger and bigger.
It stays at its own size.
The difference between wget and curl.
So wget will actually
download that file.
I now have index.html on my home
directory, and that is now Google's.
You can see the, like, did
you mean, and blobbity-blah.
But curl is going to just
actually look at the URL.
So let's say HTTPS google.com.
I swear I'm not a living
advertising for Google,
and that's actually going to just
print out back to me what I typed in.
Sorry, not what I typed in,
but actually the website
that I wanted to go and view.
So that tells me that, apparently, they
have a permanent redirect, that 301
code, and they redirect to
their www dot subdomain.
And that's kind of cool.
I didn't know that.
COLTON OGDEN: I think--
Nikolaj says, I thought you
wanted to explain inode?
NICK WONG: Oh, I see.
I think I'm good.
I actually don't know enough about
it to give a very valid explanation,
so I would say I probably cannot.
Yes, dev tty is the--
what does that stand for?
I'm sure someone will
comment what that stands for.
COLTON OGDEN: It's teletype, right?
NICK WONG: Did you say teletype?
COLTON OGDEN: Teletype.
NICK WONG: Oh, very possible.
COLTON OGDEN: I think it was.
NICK WONG: That's very likely.
COLTON OGDEN: Oh, text telephone.
I'm sorry.
What am I thinking of?
What's teletype?
Oh.
No, it is tty.
teleprint, teleprinter, teletype,
or TTY like you have a typewriter.
Oh, because the original
typewriters were TTY.
NICK WONG: I see.
Oh, good to know.
That's very good to know.
Did not know that.
COLTON OGDEN: There's a couple
of different ones, it looks like.
NICK WONG: Yeah.
Actually, you can just ls what's in dev.
There's all sorts of things in there.
All of the hardware devices that
are connected to your machine
are also in there, which is very cool.
COLTON OGDEN: Curl
refuses to work on my PC.
I've been trying to build
some code from source,
but I can never find curl
libraries despite having them
in my environment variables.
NICK WONG: Oh, that sounds--
I mean, there's all sorts of reasons
that that could be going the way it is.
Good luck.
There's generally all sorts
of actual reasons for that.
COLTON OGDEN: Yeah, you get in
the weeds with that, for sure.
NICK WONG: Everything
in Linux is a file.
Yeah, actually that's a very good point
is that Linux represents everything
as a file.
The whole thing is a file, so that
is a very good distinction to make.
And then inode number is the
representation of that file.
Sure.
Yeah, that sounds good, and I
think that's a valid explanation.
That's fine.
Did you cover all of grep yet?
We actually very briefly touched
on grep, and what it can do.
It allows you to just see
you through standard out,
unless you redirect both
standard out and standard error--
and then tell us, like, what things
actually start with those letters.
grep is actually extremely powerful.
It can do all sorts of stuff.
Dash v excludes just those letters.
And then you can do actual,
like, regular expression
matching, using I believe Perl's
regular expression patterning?
A lot of shell stuff, you can use,
like, Perl's version of things,
and it works pretty well.
So that's kind of cool.
Cool.
Is it hard to get a job at Google?
Yeah.
Yeah, I think it's pretty hard.
COLTON OGDEN: Didn't they
said that, themselves,
in that Barack Obama interview?
NICK WONG: Yes.
COLTON OGDEN: They're like, oh,
it's hard to get a job at Google.
It's hard to be president--
or someone like that.
NICK WONG: Right.
Yes.
It is a lot of prep work.
I spent a lot of time on that.
And then you can view it
by statfile.txt, right.
So referring to that idnode, or
the number given to each file,
is you can actually
do stat of some file,
and it will tell you all
sorts of information about it,
as well as that inode
number, which I believe--
I don't remember which one of
these two that is, but one of them
is probably the file
size, as you might guess.
But that's OK.
Actually this-- I don't know.
There's all sorts of
ways of reading that.
And actually, when I get to this point
where I'm like, oh, I don't know you.
You have, like, have
to deal with whatever.
You can actually man
page it, and so that
will give you all sorts
of information on it--
on what it does, and what it means--
which is very cool.
As far as Nikolaj is pointing
out that that is a weird output.
You're correct.
It's because I'm on Mac OS.
They do all sorts of
weird things, but yes.
man pages are a great way to
actually read through and understand
how things work.
Sometimes you'll see-- what's man read?
Because that's kind
of an interesting one.
So there's all sorts of versions of
read, and a lot of times commands
will have the same name
but mean different things.
And so, this is the read in the
built-in section of the manual,
so that's section one.
And you can also go
into the system section
of the manual, which is section two.
Whoops, I'm an idiot.
There we go.
And so now this is the actual
sys calls part of the section,
and it says what read does
in the system calls context.
And it tells you how to use it.
It'll tell you who invented it,
or who wrote it, things like that.
All sorts of cool stuff in it.
So there's all sorts of
really useful ways to use man.
It's actually kind of funny.
I know someone who
was a friend of mine--
is still a friend of mine?
She graduated last year, and she
actually aliased woman to man--
COLTON OGDEN: Oh, nice.
NICK WONG: --which I
thought was kind of funny.
So now you can type woman ls, and
it'll bring up the same manual page.
Man does not stand for the gender term.
It stands for manual, but I
still think that's really funny.
So I don't think I have that as
a built-in alias, but it's OK.
alias is a command that allows you to
alias certain commands into other ones,
and if you type in alias it will
list out your current a-lee-i.
A-lee-i?
Aliases, there we go.
That's the correct plural.
So, very cool.
After that, we are going to talk about
how to customize your command promp
comp prompt.
Oh, I am losing my marbles.
Cool.
Could you tell it how to
set an environment variable?
Sure.
Actually, that's totally valuable.
So, echo.
And there's all sorts of
environment variables.
In Bash, they're going to be
prefaced with this dollar sign.
So I think I can echo
environment-- oh, it disconnected.
I thought-- there we go.
I was not entirely sure,
but env as a command
will list out all of the currently
set environment variables.
And so, if I wanted to echo or
see what one of them looked like,
I might echo something like--
let's see a useful one.
Oh, user is kind of a fun one.
I just don't want to edit it.
So I can echo user, and that'll tell
me what the current user environment
variable is actually set to.
But then we can export, and we can
set some environment variables.
So like, example env is
going to be equal to 42,
the best number in the
world, and that has now
set that environment variable for me.
So if I echo example env, it'll return,
to me, 42, which is very useful.
So export is the way that
you can actually set them.
You can also change where the, like,
customization happens of your Bash.
So there's a script that actually
runs at the very beginning,
and it's in your--
oh, god.
I always forget that I'm on a Mac.
In Bash profile on a
Mac on an Ubuntu server.
Oops, I swore on that.
It is under Bash rc.
And this allows you to
edit all sorts of things
about how the actual shell
session goes and works.
And so right here, that's
actually in my Bash script.
I export a variable and set it.
I don't believe I actually
need to type export there,
but I probably modified it
when I didn't know as much.
And there you go.
And it tells you where to put the
history file and stuff like that.
Here's some, like, custom
aliases that I have,
where I, like, use this to show
files or hide hidden files on finder.
And then all the other ones--
oh, so I have vsc open because
Mac does not have the code
command, which is really annoying.
On like a Linux distro that has Visual
Studio Code, you're just like, code,
and it opens up Visual Studio code.
But, oh well.
play is what I was using for--
I think I just thought it was
kind of an easier thing for me
to remember instead of love dot, which
is what we were using in our class
last semester.
COLTON OGDEN: Yeah, I like play.
NICK WONG: play is, I
think, kind of cool.
I use rest to alias this command, and
this command is what you see here.
This kind of beautiful
output is from that command,
so it's the C Matrix program.
I did not write it.
I wish I had.
It's very cool.
And so, what that actually does is
it prints like kind of in the matrix,
like that kind of just stream
of random numbers and letters.
And then dash c is the color.
But I actually overrode that when I used
lolcat, so I don't need that anymore.
Dash s is, I believe, the speed.
And then we pipe that into
lolcat, and lolcat takes any input
it gets and just makes it beautiful.
Or it makes it rainbow
colored, which is really cool.
COLTON OGDEN: I think it's beautiful.
NICK WONG: I think it's beautiful, yeah.
And there's a bunch of, like, paths
for the other things that I use,
and then I titled this this.
Also, this is where I actually
customize my Bash prompt.
So exporting ps1, I don't exactly
remember what it stands for,
but it is kind of cool.
And I basically went through and found
a bunch of these, like, escape codes,
and then what they actually mean,
and what they pronounce the user.
And so, you can customize that.
There's like a whole, like,
language basically there,
where you can go and research,
like, all of these escape codes,
and what they each do,
and what they mean.
Some ones that are really common are,
like, whack you, which is my user.
COLTON OGDEN: Whack you.
NICK WONG: Yeah, whack you.
Whack h is the hostname
that you're currently
on-- so the hostname of
the computer if that set.
And then I just have a colon
because I think it's clean,
and I use the dollar sign for
kind of historical purposes.
I have seen people who
don't have this space here,
and that actually
weirdly bothers me a lot.
Like, when they don't set that space
correctly, it bothers me insanely much.
COLTON OGDEN: I think David may or
may not do that for his lecture.
NICK WONG: Oh, man.
COLTON OGDEN: I don't remember.
I think I customize ps1 to be nothing
but the dollar sign for presentation.
NICK WONG: Oh, right.
COLTON OGDEN: And I just
copied whatever he gave me,
and I think it was literally
just the dollar sign with--
NICK WONG: With nothing.
COLTON OGDEN: With no space.
So I feel you on that.
I didn't notice that.
NICK WONG: Yeah.
All right.
What do I see myself
doing in 10 to 15 years?
To be honest, I see
myself running a company.
COLTON OGDEN: Respect.
NICK WONG: It's the answer I
gave in my interview actually.
COLTON OGDEN: Respect.
NICK WONG: Google should
give me pay raise.
I'm just very glad to
be working at Google.
And if Google watches
this, I'm very happy.
You do not need to give me a pay raise.
To work at Google, say that graphs
are better than red black trees,
and you're hired.
I think if you brought up a red black
tree, they might be wondering why.
But generally, their interview
questions don't need them
in order to be answered.
Yeah, the OS X file system is
something, treating camel case files
the same as lower case files.
That is a very good point.
They do treat them the same kind of.
Like, you can--
I can actually cd into desktop
lowercase totally validly.
That's my desktop.
That's very valid, but that's
annoying because the actual file
name is a capital D. I'm not sure
why OS X made that decision--
or the designers over at Apple.
Alias is a lifesaver.
It can't even function
without it some days.
Very true.
Oh, welcome to Shanah.
COLTON OGDEN: Oh, I think she--
I think she left.
At 1:56 AM, she put the heart.
She said ciao.
So goodbye for now.
See you on the next stream.
Alias is a life saver.
Why is 42 the best number in the world?
NICK WONG: That's an allusion to
a book-- a very popular nerd book,
I guess.
The Hitchhiker's Guide to the Galaxy.
Great.
It's the answer to the question of--
oh, man, I'm going to
bungle that phrasing.
COLTON OGDEN: Meaning
of the universe, right?
NICK WONG: Meaning of
the universe, yeah.
COLTON OGDEN: Asley posted that there.
NICK WONG: Meaning of the
universe according to Nwaanda.
You can also-- the variable in scope.
Right.
You can do, like, using an actual
variable as if it was a Bash script.
So in scripting stuff, you don't
actually have to type expert.
You can actually just
use a variable like my--
actually, there's a better,
more useful version of this.
For i in, like, 110 do echo $i, and that
will echo out the numbers from 1 to 10.
And so, what we did was we
actually created a local variable
that i is not set.
Like, if you do n grep for i--
that was a stupid idea--
grep for i equals, it's
not going to show up.
And that's just because
this is a local--
it's the equivalent of a local variable.
It only gets scoped to the
usage here, and then it
doesn't exist anywhere else.
And we can prove that
it's a variable just kind
of by example or upon examination.
In CS50 IDE, I added the source
path to alias builder file
at the end of my BashRC.
And then that file has all my aliases.
Yeah, that's a very nice,
actually, demonstration
of kind of understanding how
things should be module--
modular.
There we go-- where you basically can
put all of your aliases into a separate
file, and then just have that get
exec'ed at the end of your Bash.
COLTON OGDEN: Someone--
NICK WONG: Yeah,
someone read my comment.
God dang it.
Yeah, so I leave funny comments
for myself, generally speaking.
I looked it up.
42 is a product.
Oh, OK.
That's cool.
I did not know any of what gx2g
is currently telling us about 42
as a number, but that
is very good to know.
That's kind of cool.
COLTON OGDEN: It sounds impressive.
NICK WONG: Yeah, it
sounds very impressive.
Like, if you're at a party--
OK, don't say this at a party.
But if you're at, like, a nerd party,
then, like, that'd be pretty cool.
You can sit out there, and
people would be very impressed.
Do you have an online copy of your--
COLTON OGDEN: Yeah, I've seen
Hitchhiker's Guide to the Galaxy.
And they're like, yeah,
get this guy out of here.
NICK WONG: Do you have an
online copy of your Bash config?
I do not.
Although, my Bash config is
definitely not terribly interesting.
There are some really cool
ones out there though.
If you just Google, like, cool
Bash prompts, it's very, very cool.
COLTON OGDEN: Also, thanks too,
RoMackNatividad, for joining us.
That's a new person.
NICK WONG: And welcome.
COLTON OGDEN: And MinRaws, as well.
NICK WONG: Yes.
Make is actually not necessarily
an alias for your long
clang commands, though
it can look like it,
and it effectively kind of does do that.
Make is its own program that does
all sorts of cool things for you,
and it has a bunch of parameters
to it that are really useful.
But make, you can think of it as kind
of like acting as similar to an alias,
but it is actually its own program.
Bash the born again shell.
Very nice.
Is Bash my favorite to code in?
So I actually code generally using,
like, Visual Studio Code like a text
editor, and so I actually use, like--
I'm a huge fan of writing code in,
like, Visual Studio Code or Atom.
I like Atom's simplicity
and kind of its modularity.
In case that has not been
the message this whole time,
I really love modular
and very simple things.
Having the very clean cut--
COLTON OGDEN: Modular, modular, modular.
NICK WONG: I love modular.
Very cool.
One of my favorite languages to write
in is actually definitely Python.
Although, I am a huge fan of C++--
I also really love C. I just
love things that are statically
typed and strictly typed,
because I think that that
makes your coding a lot easier.
COLTON OGDEN: That's why we got to
get you on here for a low level--
NICK WONG: Exactly.
COLTON OGDEN: --or a C programming one.
That would be cool.
I'd like that.
NICK WONG: That's awesome.
Oh, what is Fish?
Is it new?
Another zshell?
It's the Friendly Interactive Shell.
That's what it stands for.
Very cool, I didn't actually
know that, but Fish is also
just a very cool shell.
I can bring it up right here.
It does all sorts of cool things
for you, and I'm a huge fan.
There's all sorts of
research on it also,
if you would like to look that up.
COLTON OGDEN: OmarBeBallin,
thank you joining us.
That's a new one.
NICK WONG: Love the gamer tag.
COLTON OGDEN: I use Atom too, he says.
NICK WONG: Oh, sweet.
Yeah.
COLTON OGDEN: Or he or she.
Hey, Mr. Google Intern, learn Golang.
NICK WONG: Actually, I did
mess around a little bit
with Golang earlier this summer.
I thought it was really eloquent.
I'm a pretty big fan.
I just don't use it for
that many other things,
and I'm still kind of trying to
become more masterful at Python.
So I generally focus
a little more on that.
COLTON OGDEN: Are Go and
Golang two separate languages?
NICK WONG: No, they're are the same.
COLTON OGDEN: They're the same.
NICK WONG: Golang is kind of the
way Google people will generally
talk about it, and then Go is the
way everyone else refers to it.
COLTON OGDEN: APSKnight, when
is the next stream scheduled?
On Monday, join us for a
Python tour, 100 things--
100 cool things you can do in Python.
We may or may not get
to all 100, and that's
going to be with Veronica
Nutting, the current head CA.
NICK WONG: Yeah, Veronica.
COLTON OGDEN: Yeah, that's
going to be awesome.
NICK WONG: Love Veronica.
COLTON OGDEN: She's great.
Tune in for that one.
She's awesome.
Love Veronica.
Dynamic auto complete
stuff is available in Fish.
NICK WONG: Fish has all sorts of,
like, cool features implemented.
I'm a huge fan.
And then Python is my favorite too.
I started with Learn
Python the Hard Way book.
I highly recommend it.
I thoroughly agree.
There's also a really good
Python reference online
that I may point out later.
Cool.
Haven't taken CS50 yet,
plan to in the spring.
Awesome, we're super
excited to have you.
COLTON OGDEN: Stay Peaceful
89, thank you for joining us.
NICK WONG: Very cool.
COLTON OGDEN: Do you happen to know?
NICK WONG: Oh, is Go
related to Alpha Go?
So Alpha Go is actually--
I don't know if the terms
are actually related.
They were built--
I don't-- to my knowledge, they were
built by completely separate teams.
Alpha Go was basically
related to Go, the game,
whereas Go is related to Golang, the
language-- basically, Google language.
So to the best of my knowledge,
no, they're not related.
COLTON OGDEN: Bhavik has been patiently
waiting for us to customize the prompt.
NICK WONG: So actually going
to customize the prompt.
COLTON OGDEN: Let's make
that the next chapter here.
NICK WONG: Yeah, I thoroughly agree.
So basically, on OS X, it's
actually a little bit weird.
So I'm going to switch over to Linux--
or to Ubuntu-- and that should make
it a little bit easier, as far as
what we're going on here.
So in Linux, you actually
have, in your home
directory-- we're in root right now,
which is the way Docker set things up,
but that's OK.
And so, basically, what we have is--
oops, ll.
I can't type for crap.
So ll is the Ubuntu
version of ls dash alh.
I don't know exactly all their flags,
but it does roughly the same thing,
maybe no h, just al.
And so, what I can then
do is nano.bash rc.
Right.
Nano's not found.
So what we'll do is this.
apt get install dash y nano.
And there's a bunch of other
commands that are probably
really useful to know or have on here.
That'll install, and
it'll take a second.
So we'll go back when it gets there.
I don't actually need
this one open anymore.
There we go.
Cool.
So what we actually can do, as
far as customization on this goes,
is I can nano my bash profile.
Oops.
If I can spell.
How complete.
COLTON OGDEN: I know
the feeling too well.
NICK WONG: And wherever I
put that PS one variable.
Here it is.
I should probably clear that line.
Oops.
And so we can customize
all sorts of things here.
So for the sake of just kind of
not forgetting what this one was,
I'm just going to comment it out.
COLTON OGDEN: Thanks, Jasong.
He says, good night, guys.
Well done, Nick and Colton.
As usual, keep up the good work.
NICK WONG: Thank you.
That's awesome.
Thank you for coming.
COLTON OGDEN: YumHainhum, is
I think a new one possibly.
Any cool Linux commands that
most students don't know?
We'll say it now and get to it after
we've finished customizing the prompt.
But do you know one?
NICK WONG: What is a great command
that no one really knows about?
I think there are a
bunch of commands that I
think are very under-appreciated.
I think one of the better ones--
or no.
That's not true.
Nothing pops into my head as something
that's like-- something you don't know.
I think a lot of people know them, but
don't actually necessarily use them,
or at least don't use
them in a way that I
think is demonstrating
how cool they really are.
So I'll have to think about that.
We will definitely try and cover as
many of the commands that I think
are cool in the next
20 minutes as possible,
because I'm a huge fan of a bunch
of stuff that people don't use.
So this will be the-- we'll call
it the DJ end prompt for now.
COLTON OGDEN: Oh, by the
way, shoutout to CodeHeir
raiding with a party of nine.
Thank you very much.
Appreciate it so much.
NICK WONG: That's awesome.
COLTON OGDEN: MikeeK says, ey.
We're getting a few new people in here.
NICK WONG: That's sweet.
COLTON OGDEN: Sudo.
NICK WONG: Sudo.
COLTON OGDEN: There we go.
That's the command.
NICK WONG: Yeah.
Talk about an overpowered command.
There is that one.
Cool.
So I have now edited my bash profile.
And I can open up a new tab.
And I have now edited what my
prompt actually looks like.
So my prompt now is literally
just the dollar sign.
I added the space.
I can't stand the non-space.
I really can't.
COLTON OGDEN: I totally agree.
I think it's great.
CodeHeir says, hey, have
a good stream, lads.
Thank you very much, CodeHeir.
Appreciate it.
Appreciate it.
NICK WONG: That's awesome.
Oh, sweet.
Thank you.
So yeah, we basically can edit the
comp prompt through our bash profile.
So I'll edit it to be a
little bit cooler than that.
And this is something that
people do very frequently
and forget that it does
what they think it does.
So basically what we're going to do is
I'm going to copy some of the coloring
that I do in the top section here.
So these are escape codes that do
coloration of the actual prompt.
And so what I'm going to do--
oops.
I always forget which
language I'm writing in.
I never remember which-- when
you're switching between like Mac OS
and like a Linux kernel based system I
frequently mix up my keyboard shortcuts
and then I start going to the end of
a nano file and then command V'ing
and opening up all processes.
COLTON OGDEN: It's similar,
but still have those little--
NICK WONG: A little off.
So we can do this.
And there's a common bug
that people generally
end up getting when they do this.
So now my prompt is blue,
which I think is cool.
I'm a huge fan of blue.
I have way too much blue--
too many blue things.
But the problem is all of the rest
of my typing is now also blue.
And so every output will also be blue.
COLTON OGDEN: Feature or a bug.
NICK WONG: Feature or a bug.
I don't know.
If you like blue more than me,
then this is actually a feature.
If you don't, this is a bug.
And like for any colored output,
it'll all get overwritten.
It's all blue now.
Unless they explicitly
alter the previous one
and then open up a new colored prompt.
But basically everything-- what would
be kind of fun here is to just cat
dev random.
And, oh, that one actually overrides
the blue because it's so weird.
That's kind of funny.
So it ended up not being all that blue.
And I don't know if I can scroll
back up to the top of that.
But if I could, the top
half should be blue.
COLTON OGDEN: It's like a lazily
evaluated stream essentially.
NICK WONG: Yeah.
That's kind of cool.
COLTON OGDEN: Generated stream.
NICK WONG: Generated.
I believe it is actually a
loosely generated stream.
Very nice.
Cool.
So that prompt is now kind
of screwed, but that's OK.
Cool.
We now have it on the
Linux version as well.
I believe you can do the same thing,
but we'll just go ahead and prove that.
So we can nano bashrc.
The default here is that
everything is not in color.
Like, this is kind of the
only time that that happens.
But basically you could make it
such that this is just always true,
like color prompt equals yes.
What is that there in variable name?
Or you can do what they suggest
below, which is force color prompt.
And I always love this comment.
It's actually kind of
funny if you read it.
The focus in a terminal window
should be on the output of commands,
not on the prompt.
That person is probably very
practically minded and very correct.
But I like the color of the prompt.
I like it to be pretty.
Oh well.
COLTON OGDEN: Aesthetics are important.
NICK WONG: So we can exect
bash to re-execute things.
And I don't know if you
can really clearly see,
but my prompt is now in color.
And execting bash just kind
of brings up a new bash.
I think exiting brings you back out
to whatever you were in previously.
So I could also just
run bash, I believe,
it does something roughly equivalent.
For our purposes, it does the same.
So our prompt is now in color.
And now we can go and
edit bash RC again.
And what this basically does is--
the PS one variable actually refers
to your entire terminal.
So if it's not set, then this
just doesn't do anything.
This whole file doesn't actually work.
But we can kind of keep
going and skimming through.
PS one, I don't know if it
actually gets modified in here.
Oh, there it is.
So yeah, what this actually does
is it modifies the PS one variable
all over the place and
you don't necessarily
need to actually modify that by hand.
You don't have to understand all
of this in order to modify it.
You can just do the coloring of
your prompt down at the bottom.
Because basically as long as you're
not dealing with all of that code
and you kind of overwrite it, you would
also equivalently achieve the same.
So we can actually
just do PS one equals--
here, let's make it a Python prompt.
COLTON OGDEN: Somebody said that.
Who said that?
JLardinois, John Charlie, says that I
like that as my prompt, feels neato.
NICK WONG: Yeah, it is very neato.
I actually have an Ubuntu server
somewhere that uses like dash dash
greater than.
And I think that's kind of cool.
COLTON OGDEN: That's pretty cool.
Yeah.
NICK WONG: So this is our prompt now.
And we can go modify that variable again
and get kind of a super neato version.
You might actually do
something like this where you--
and then you could do that to
point at your actual current thing.
I think that's kind of nifty.
There's all sorts of things you can do.
I mean, if you're creative enough,
prompts can get very, very interesting.
And so this will switch
if I switch users, right?
So if I did like a user
add Nick, and then su--
or switch user into Nick, then--
oh, my prompt-- my prompt is actually
set differently for this user.
It's set to the default one.
So, oh well.
COLTON OGDEN: I'm going to
set you up with that one.
We're not going to show them--
NICK WONG: That is very funny.
So yeah, there are all sorts
of cool prompts you can do.
And that's roughly all you
actually need to do in order
to customize your prompt,
which is very cool.
COLTON OGDEN: APSKnight,
to answer your question.
Monday stream is scheduled at 1:00.
So join us for that at 1:00.
Let me make sure that we
get somewhat caught up here.
There was a lot of comments there.
There's no really cool commands the
way you use them, but they don't know.
Like how to Breeze, use a
combination of cat, tail--
so I guess they basically
pipe stuff together.
NICK WONG: Yeah.
Combinations are very cool.
COLTON OGDEN: Super awesome.
I mean, literally sudo--
use sudo.
If you have a command
without sudo, then you
can run the last command
with sudo by typing sudo--
oh, exclamation point,
exclamation point.
NICK WONG: That is a very good point.
I just did it, and then did not
get to speaking about what it was.
Exclamation point, exclamation
point is previous command.
And it'll just run it,
which is kind of neat.
You can-- I was trying to think of
a creative way you can mess around
with that.
I can't think of one using nano, but
there are some interesting things
you can do with that.
So you can do stuff like drop it
just kind of into its own shell.
You can make it into a bash
variable, the output of it.
You do all sorts of things.
So there's some stuff that I
think is actually really useful.
Like cat of the bash variable
version of LS, but only grab--
well, you should actually
just do LS instead of cat
because it might be a directory.
LS and grepping for--
or not grepping for, let's
actually just do head and one.
And so what that does is it
creates a variable for bash
to actually use from LS
piped into head and one,
which means take only
just the first line.
So I do LS.
I get this.
If I do LS and head in two
and one, then I just get this.
And if I try and LS
a non-directory, it's
not going to actually LS anything out,
but I would have actually ended up
getting out that same output.
So if I do 2017 this, it just
outputs the file name back to me
because it doesn't contain
anything as far as directories go.
So that's kind of a cool
thing that you can do,
is creating these bash
variables as you go.
I think it's super useful if
you're trying to construct a path
and you don't really want to type
out the whole current directory.
I can do like PWD.
And so this is kind of a neat ability.
It's like, that slash my stuff here.
And that will then
give me the full path.
So if I'm writing some sort of script
that relies on the actual full path,
then this is really useful.
And basically just being able to do
that bash substitution is kind of nice.
However, if I switch
this to be single quotes,
it doesn't actually
do that substitution.
So that's a really useful
distinction to know,
is that double quotes allow for bash
substitution of variables and anything
starting with a dollar sign is going
to be kind of treated like that.
However, things that start single
quotes, or that are in single quotes,
do not.
They will not actually run anything
from there, which is good to know.
What do you think about Oxford
teaching students Haskell first?
That's very interesting.
I think it's a very interesting idea
to start with a basically purely
functional programming language.
I'm a huge fan of
programming languages, but--
that too.
But functional programming
languages because I
think that they have a very eloquent
way of expressing kind of the same thing
as certain OOP languages.
However, ironically, I
then go and use Python.
And a lot of things are not
purely one or the other.
They tends to be generally in one
paradigm or generally in another one.
Python can actually
act very functionally.
And [INAUDIBLE],, which is generally
a very functional language,
can act in an object oriented paradigm.
So they aren't exactly exclusive.
I think Haskell is pretty
strongly functional.
But it is interesting to me because I
actually hated functional programming
when I first learned it.
I thought it was needlessly
making us do things with scoping
and I thought that was really annoying.
I've actually come around
to liking it a lot.
But it is interesting, I think,
to teach it as a first language.
I actually really like
the way CS50 does it
where we teach kind of
low level language, which
is a little bit obscure.
It's a little hard.
You have to keep like types
in your head and stuff,
but that's really useful to know.
It's like, things have a type,
how things are represented,
and how data works.
I think that's actually
a really cool idea.
So it's interesting.
COLTON OGDEN: CodeHeir says
that you look like a Luke
from Modern Family, which I pulled
up a picture, which that's what
Luke looks like from Modern Family.
NICK WONG: Oh, OK.
Yeah.
Not terrible.
COLTON OGDEN: Looking pretty ripped.
NICK WONG: Yeah.
I want to get more swoll like that.
COLTON OGDEN: Yeah.
[? AithWall, ?] so thank
you for joining us.
I don't think I've seen you in here.
Personally I've just
started learning Haskell,
which we forgot to shout you
out when we read the questions.
It's the first time.
Personally, I've just
started learning Haskell
and it's so different to everything.
NICK WONG: Yes.
So it is quite--
I mean, basically everything else
in the way that humans tend to think
is very object oriented, right?
Like, there's a person, and this
person has a name and that's
a specific instance of a person.
That's very object oriented thinking.
Functional languages
are very much not that.
Everything's a function.
Like, I can do one
plus, that's a function.
And then I add something to that
and then I get that plus one.
It's a very interesting paradigm.
COLTON OGDEN: (WHISPERING) Omar says, in
Mac you can change the look of terminal
with a single click.
NICK WONG: That's a very good point.
I love that that's how you went for it.
You can go into--
I don't even remember
what I was looking for.
COLTON OGDEN: (WHISPERING) By the way.
NICK WONG: By the way.
You can edit all sorts of things
on Mac using just the GUI.
I mean, this is the actual
look for the terminal.
And so you can do, I think--
OK.
That was-- I didn't really
think that one through.
I'm not going to lie.
You can do that, for example,
which is kind of cool.
COLTON OGDEN: That is--
NICK WONG: Yeah.
That's a style.
COLTON OGDEN: That is beautiful.
NICK WONG: Oh, what a--
COLTON OGDEN: Yes, please.
Can we please continue like that?
NICK WONG: Yeah.
We're going to actually
leave this like this here.
I tend to-- yeah.
That's kind of cool.
COLTON OGDEN: I've never seen a
more beautiful shell in my life.
NICK WONG: Wow.
Yeah, no.
That's gorgeous.
COLTON OGDEN: And
neither has anyone else.
NICK WONG: This is how you could set
up your shell if you wanted everyone
to talk to you every time
they walked by your computer.
COLTON OGDEN: Nicholas says, if you
want to go the functional route,
go for list instead.
NICK WONG: This was a fun language.
Actually, like Haskell,
Lisp was F sharp.
And then Closure is
another cool language.
And Closure, I think, can be
compiled and/or transpiled
into JavaScript, which is kind of cool.
COLTON OGDEN: Runs on the JV engine.
NICK WONG: Sweet.
Nano for the win.
I'm a huge fan of nano as the kind of--
I don't know.
I learned it first and I was
kind of like, oh, this is cool.
VI is very fast though, so good to know.
COLTON OGDEN: Haskell
is purely functional.
Lisp is like the opposite.
Well, Closure, which is a
Lisp, is primarily functional,
but does have some mechanisms to allow
you to program procedurally and mutate
variables.
NICK WONG: Window title show
the character directory.
Yes.
You can actually customize that.
So the window title
itself is actually more
of a property to my
knowledge of like, you
could customize it using the actual GUI.
I don't know off the top
my head the variables
you'd have to set in order to get that
to happen from the command line though.
Although, I'm sure that
that's also possible.
Source file name do.
I use it for creating aliases.
So Bhavik Knight asked, what does
the source of some file name do?
That's a really great question.
I can source all sorts of files.
This won't hurt me too badly.
I can source the file
that we did previously
and it doesn't necessarily do anything.
It doesn't really change my prompt much.
It doesn't unset stuff.
But source basically
says, for this shell,
or whatever terminal you're
currently looking at,
then take that and run those commands as
the source for whatever we want to do.
So basically execute those commands.
It's generally used for setting
up environment variables
or basically doing what
bash profile does in Mac OS.
So that's basically this whole file.
COLTON OGDEN: I love how
we're still using that too.
NICK WONG: We're still using
this awful, awful background.
Does that change all of them?
Oh, no.
Just that one.
COLTON OGDEN: Completely
discredited as a--
then you see this in a thumbnail-- not--
NICK WONG: They're going
to be like, nope, this
dude never touches a computer.
So funny.
Yeah.
So that basically is
what source is doing.
Is it's setting up
environment variables.
It might set up a bunch of aliases and
scripts and things, all sorts of stuff
like that.
Yeah.
COLTON OGDEN: Fredrick
[INAUDIBLE],, can you hack NASA?
NICK WONG: Can I hack NASA?
According to NASA, no.
COLTON OGDEN: If you went on their
website right now and were able to it'd
be the most hilarious thing.
NICK WONG: On livestream and using this.
COLTON OGDEN: What a troll.
What a troll move.
NICK WONG: What a troll move.
Yeah.
That's [INAUDIBLE] right there.
Just functional program
statelessness-- yes.
COLTON OGDEN: I'm not sure
what that was related to,
but, yeah, the two are
tied together more or less.
NICK WONG: It's really not something
I'd use for anything real world.
If you ever want to know a great example
of real world functional languages,
OCaml, which I don't really like--
or didn't really like as a language
when I learned it, but I do like it now.
Is used in the real
world by Jane Street.
And they're an active trading company.
They do all sorts of cool things.
And so they actually are a great
example of using basically exclusively
functional programming.
I know Facebook users some
functional programming
in some portion of their
code base, or at least I've
been told that that is true.
And so that's kind of interesting.
COLTON OGDEN: It's Erlang.
NICK WONG: Yes.
Right.
So that's kind of interesting.
There are definitely some
real world use cases for it.
It tends to be a lot faster, like,
OCaml is going to generally be faster
than Python for equivalent programs.
And what I mean by that
is in the real world
it's just faster because
it has less overhead
to translate it down into machine code.
Although there are ways of getting
around that in Python and there's
a whole debate there.
COLTON OGDEN: Fun fact though.
John Carmack did port Doom to--
or Wolfenstein to Haskell.
NICK WONG: Oh, right.
I did see that.
COLTON OGDEN: I think at
the end of that he ended up
saying that he would not like to
actually use it for game development,
but that it was a cool
idea and that he liked--
I think he liked the
mental exercise of it.
It burned LincePotiguara's eyes
more than the light theme of an IDE.
NICK WONG: That's hilarious.
COLTON OGDEN: It is pretty hard to
look at the light theme of an IDE.
NICK WONG: Yeah.
I'm not a huge fan of the light themes.
Yeah.
Let's hack NASA for the new 101 class.
Felony 50.
Very good point.
It is felony-- and actually, we were
talking with the FBI a little bit ago
and they were talking about how a
lot of the government's websites
could certainly be hacked.
They just will respond.
They'll come back to you.
So maybe don't.
I will generally advocate
not breaking the law.
COLTON OGDEN: How do they
feel about white hat do
you think if you would say, hey, you
have this explained in your website?
NICK WONG: So I think their
official message is, don't hack us,
that's a crime.
Don't do it.
Big bad.
But I will say I've heard some kind
of interesting stories of people
doing that and telling them about
it and kind of telling them like,
hey, I could fix it too.
And they're like, OK,
cool, come work for us.
I think that's not generally
their hiring process.
COLTON OGDEN: That's such
a split of risk and reward.
I don't know if it's worth it.
NICK WONG: I think if you're already
just an awesome, an epic hacker,
may be might be worth your while.
But you could also just drop a resume
through their job application portal.
I'd say that's a better way of doing it.
And they will probably
appreciate that method.
COLTON OGDEN: Well stated.
How many languages do you guys know?
You want to rattle off some of yours?
NICK WONG: Oh, man.
So I would say that I'm super
familiar with Python, C++, and C.
But then technically, as far as
languages I've built projects
in, it's definitely those three
as well as Java, JavaScript,
if you count JavaScript
as a language, and then--
COLTON OGDEN: Burned.
NICK WONG: Yeah.
Got them.
And then I've definitely
built stuff in Lua,
both for the class that Colton taught,
as well as just Minecraft stuff.
Huge fan of Minecraft stuff.
I've also worked a
little bit in F Sharp.
I've worked in Closure before.
One of my workplaces used
Closure for everything,
so I learned that pretty
well through them.
COLTON OGDEN: I wanted to work for
a company doing Closure, purely
Closure for just a long time.
NICK WONG: It's a very cool language.
I think it's just awesome as far as
the developers who built it and the way
that they built it.
I think that's awesome.
I worked a little bit with
Golang, but I don't know it.
I would say I don't know it.
I've also worked in
Ruby for a little bit.
And then I basically just decided
that Python was equivalent.
And I only use Python now.
And then I've also
touched a little bit of--
there's a language in there that I'm
missing that I'm pretty familiar with.
I don't know.
Colton said it very well earlier, where
they can all kind of blend together.
COLTON OGDEN: Yeah.
Unless you talking about object
oriented versus functional,
that's really the core divide.
I mean, those are the paradigms.
But--
NICK WONG: Yeah, exactly.
COLTON OGDEN: That's kind of it.
NICK WONG: How is
languages for yourself?
COLTON OGDEN: My list
is similar to yours.
I think you have a
couple more than I do.
I haven't touched F Sharp, but Closure,
Java, JavaScript, Python, C, C++.
Yeah.
Most of all that.
I looked at Haskell.
Messed with Rust a little bit.
NICK WONG: Oh, yeah.
Rust is a cool--
I have not touched it at all, but
I've seen kind of postings on it
on Reddit and stuff.
COLTON OGDEN: Yeah.
Did you ever meet Chad?
NICK WONG: No.
COLTON OGDEN: One of the devs
that we're working with who
goes to University of Michigan.
NICK WONG: Oh, sweet.
COLTON OGDEN: He's big
fan, big fan of Rust.
NICK WONG: Yeah.
I've heard a lot of
good things about it.
I'll have to check it out.
COLTON OGDEN: All languages--
it's all one thing.
NICK WONG: I think a lot of
the focus for a lot of coders
should be just the logic.
COLTON OGDEN: Python feels like the
big one for most day to day stuff.
NICK WONG: Yeah.
COLTON OGDEN: Have you done CTF, Nick?
NICK WONG: Yes.
I've done a lot of CTFs.
I don't think I've ever done
particularly well at them.
We tend to do them--
COLTON OGDEN: Can you
explain what that is?
NICK WONG: Right.
So the capture the flag--
COLTON OGDEN: Non-hacker
types in the room.
NICK WONG: So they're called
capture the flags, or CTF for short.
And basically they put you on some
sort of Linux machine like this.
I actually have one in my Docker list.
Docker.
Oh, actually, I don't have it on here.
It's on the server that we use for CCDC.
But we build these Docker images of
Ubuntu containers and stuff like that.
And a CTF means-- there's a
lot of ways you can do them.
The way that I like to do is
you're given an image of a computer
and you load it into some
sort of virtual machine.
And you go through and you're
looking for these flags.
And a flag is usually
either a number or a string.
It's usually a string that you
can then submit for points.
And generally different strings have
different difficulties of obtaining.
There are like-- Pico CTF is
a-- it's literally a small CTF.
And that's an online one every year.
They're really cool.
I think it's mostly geared
at high school students.
And although, they do get very hard.
Pico CTF has some very
difficult parts to it.
That one's more like a graphic one.
You go to a website.
They have kind of this
version of a shell.
And you do start to get into
like SSH and stuff like that.
But you solve puzzles and
you're rewarded with strings.
COLTON OGDEN: Doing a live
CTF would be super sick.
I'd be super stocked
to see one of those.
What's the min size, because,
obviously, if you're looking
for a string that's like AW, right?
Like that can be anywhere.
There has to be a minimum size for--
NICK WONG: There's usually--
so Pico CTF just does
random generated strings.
And I think around 28
to 32 characters long.
They're pretty lengthy.
And then I know there's the bomb
piece set, which is kind of CTF style,
where you basically
solve faces of a bomb.
It's a binary bomb, so it
just goes off every time
you like let it execute
all the way through.
And that's a really cool one.
Basically the strings are like phrases.
So I think mine was like, I am so
strong I could pull out my own teeth,
but I don't want to.
Was a very weird phrase,
but it's not a phrase
you could come up with on your own.
You wouldn't think of that.
And some other people had phrases like,
I'm a brownie and I could be eaten.
They're really weird phrases.
And so there's some really
interesting ones out there.
COLTON OGDEN: Doing something
like that would be super cool.
I think that would be super cool.
NICK WONG: I think
that would be awesome.
COLTON OGDEN: Government
sites can be hacked,
but all the government data
isn't connected to the internet.
Darknet/private nets, you could maybe
access office memos to the website,
but not much else.
NICK WONG: Yeah.
I'd imagine their websites should
be pretty segmented off from them.
CIA, NSA, FBI all have some really
talented people working for them.
COLTON OGDEN: 2HStrike,
thanks for joining us.
Lua with LuaJIT has got to be
one, if not the fastest scripting
language known to man.
Yeah.
It's definitely fast.
I have to reread the--
I looked at benchmarks at
one point, LuaJIT is fast.
It's faster than Python, JavaScript.
But I don't remember what its
other primary competitors were,
but it is very fast.
Yes.
Most coders are fan of
the dark side Darth Vader.
Appreciate it.
NICK WONG: Yeah.
I agree with that.
And then they pointed out,
computer craft for Minecraft.
That's how I got started
with Lua actually.
I thought that was really cool.
COLTON OGDEN: Back in the old--
were you doing this in like 2011, 2012?
NICK WONG: So I didn't actually
write any code until I came here.
But I was kind of messing
around with Minecraft.
And then when I came here and
learned a little bit of coding,
I was like, oh, this is cool.
I now understand what computer craft
is and know what to do with it.
And then it was like beautiful Lua.
And that's kind of what ended
up happening freshman year.
COLTON OGDEN: Yeah.
It's such a good language
to have in there too.
Such a simple language.
NICK WONG: Yeah.
It's so simple.
And it's very nice.
Very easy to learn.
COLTON OGDEN: [INAUDIBLE] project called
Craft [INAUDIBLE] using [INAUDIBLE]
as modifying a Minecraft [INAUDIBLE].
I'm familiar with that.
I'm familiar with that repo, actually.
Yeah.
They did a very good job.
It runs like butter on a low end--
not low end, but like a non-GPU one.
But yeah, it's a super good repo.
Definitely check that out.
When [INAUDIBLE] [? to ?] [? the ?]
[? US, ?] would US [INAUDIBLE],,
I need to borrow some GPUs for
a Bitcoin mining operation.
NICK WONG: I have a strong
feeling that, one, I
don't get access to that,
even myself, and two,
I certainly would not
be able to do that.
I like having a job.
COLTON OGDEN: [INAUDIBLE] awesome now
also has procedural macros [INAUDIBLE]
fanatic at this point.
NICK WONG: That's good to know.
That's sweet.
Yeah.
COLTON OGDEN: The Closure
macros are really cool.
NICK WONG: Yeah.
Closure has some
beautifully designed things.
Just use [INAUDIBLE] mod for Minecraft
[INAUDIBLE] loaded with Bitcoin miners.
All right.
I like any script language.
LincePotiguara, you
really nail these names.
I just realized you say them no problem.
I'm struggling to read basic English.
And I definitely--
COLTON OGDEN: It's like
my number one focus.
I'm dedicated to making sure.
NICK WONG: That's awesome.
I like any script language that
integrates well with C or C++.
I thoroughly agree,
but I also am biased.
I love C++.
That's awesome.
And then you can use
[INAUDIBLE] for Bitcoin miners.
So cool.
We would love to have a
special CTF stream from you.
Yeah.
We could definitely make that happen.
COLTON OGDEN: Are you able to easily
just generate one for yourself
that you can do without having
to involve other people?
Because I feel like it would
be tough waiting for an actual.
NICK WONG: Yeah.
Waiting for timing in and everything.
No.
We could definitely have a CTF show.
We could both do it.
COLTON OGDEN: I would be trash at it.
I guarantee you.
I'm not flagging that string, 100%.
But I would love to see your workflow.
And I think that would make
for a very interesting--
NICK WONG: I very much agree with that.
COLTON OGDEN: Because
then you could explain
like sort of what you're trying to do.
And actually put quality commands
into an actual physical use case.
NICK WONG: It's actually a
really good supplement to this.
COLTON OGDEN: Yeah.
It really would.
Yeah.
Let's talk about that a little bit.
Minecraft is for soy boys.
Not sure what a soy boy is.
NICK WONG: The Urban
Dictionary's probably got it.
COLTON OGDEN: [INAUDIBLE] CTF
is really nice for beginners.
NICK WONG: Yeah.
I very much agree with that.
And we use it in our club to
kind of introduce people to CTFs,
so that they actually go through it.
Let's see.
Have you experimented with GCP and
Kubernetes before the Kali period
at Google?
Dev ops engineer in Sweden
and I'm going to try and get
certified as a professional
cloud architect on GCP.
I really have not experimented
with them that much.
I was recently kind of shown that
TensorFlow got a port to JavaScript
and I've been super into that
because up until that point
there wasn't a great way
of doing it on the browser.
And so I'm a huge fan of kind of that.
And I'm going into learning that.
I'm trying to learn a lot more
of like Node.js and Angular.
But it's also on my
docket of things to learn,
is like Kubernetes, Docker
Swarms, and actually really truly
utilizing Docker containers for what
they're intended and stuff along
those lines.
So I think a lot of my cloud stuff
has not really been fully developed,
but it will be eventually.
COLTON OGDEN: Do you use a
lot of angular node at Google?
NICK WONG: I don't know.
I actually don't know super
much about Google's code base.
I think they generally
kind of keep it hush
and then they tell you in
retrospect, oh, here's what we did.
Blaze or Basil was done like that.
But I'm very excited to
learn a lot about it.
COLTON OGDEN: PresidentOfMars,
a CTF show would be great.
And thanks for joining again.
I remember you came last time.
JavaScript with the dance game face.
NICK WONG: That's hilarious.
JavaScript is-- what a time.
And that's very cool to know.
So as kind of an advertisement
for, I guess, the Kubernetes work,
is they have a $300 free trial period
and an always free micro instance.
So definitely worth setting up.
Very cool.
Yeah.
So I think we've--
we tried to cover kind of as
much of the basis as we could.
We got sidetracked often,
but I think that that's
one of the best parts of doing
these sorts of screenings.
COLTON OGDEN: I think we went in
a lot of cool directions though.
I think it was pretty cool.
Like the CTF, that could have
inspired a new string, right?
That's why we kind of do it.
Yeah.
Nick is going to join us for
quite a few streams in the future.
We have two coming up.
Docker.
And what was the other one?
You remember?
NICK WONG: Docker and--
I was about to just
pull out my messages.
You don't want to see those.
Or maybe you do.
I don't know.
Docker and something else.
COLTON OGDEN: I mean, I could
probably look it up on the calendar.
I think I put it in here.
I got you for Docker on the 27th.
C basics.
NICK WONG: C basics.
OK.
Cool.
So then we'll go through Docker and
just everything Docker, or as much
as we can cover in that time.
And then we'll go through
kind of just low level C,
cool things you can do in C, all
the weird things you can do in C.
COLTON OGDEN: Not as much of a basics,
as more of kind of like a dive.
NICK WONG: Yeah.
Kind of diving in to sea.
COLTON OGDEN: And then, yeah.
We've got to figure out
a CTF, either if there
is a slot open before the holidays
where you're free or after the holidays.
We do have a very busy
period coming up for CS50.
So next week is Thanksgiving.
NICK WONG: Oh, man.
COLTON OGDEN: So next
Thursday and Friday.
So next Friday.
Well, Fridays we normally have a stream.
We will not have a stream next Friday.
But we do have a stream
Monday, Tuesday, and Wednesday.
And then the week after that
will be the week of the 26th.
We actually have the Hackathon
that week it looks like.
NICK WONG: There we go.
COLTON OGDEN: Thursday and Friday.
NICK WONG: That is right
after Thanksgiving.
Holy crap.
COLTON OGDEN: It is.
Thursday, Friday of the week after that.
And that week Nick is going
to do a Docker stream.
And we have someone else doing
a biostat stream, which we'll
release more information about soon.
So that Monday is free.
I might do a game stream that Monday.
Then the week after that
it looks like the fair.
See, week after week
after week of busy stuff.
NICK WONG: All right after one another.
That's awesome.
COLTON OGDEN: Yeah.
We'll talk about it and then we'll
figure out, because that would--
I think that'd be super cool.
That'd be super cool.
NICK WONG: That'd be fantastic.
I actually also just thought of, because
someone brought up the bitcoin stuff,
we can go through a small
tutorial on bitcoin and--
COLTON OGDEN: That would be--
that would be really cool.
I think that's going to make
for some awesome content.
NICK WONG: Yeah.
I mean, everyone's always
talking about bitcoin.
It would be nice if you guys
actually knew what that was.
COLTON OGDEN: Tangibly demonstrate
what it means to do it.
I mean, I'm curious because I
haven't ever thought to look into it,
so I don't know.
NICK WONG: Actually, I got into it a
little bit maybe about two years ago.
Right after I kind of went through
CS50, and then I was like, oh, wow,
CS is so cool.
And I just drove into a bunch of things.
And bitcoin was one of them.
And I actually did all sorts
of cool things with that.
COLTON OGDEN: Yeah.
Let's do it.
Let's do it.
We'll do a CTF, we'll
do a bitcoin stream.
NICK WONG: We're getting
these streams out there.
COLTON OGDEN: There's so many topics--
there's so many topics.
Like a CS renaissance, man.
NICK WONG: Oh, thank you.
COLTON OGDEN: You guys are a power duo.
You should do a rundown of Kali.
NICK WONG: Oh, Kali would be awesome.
I would love to do that.
COLTON OGDEN: So I don't
know what that is at all, so
if you could explain what that is.
NICK WONG: So it's a Linux
distribution that is explicitly
designed for penetration testing.
So for white hat hacking.
It comes pre-installed with
all of these crazy tools.
It created a lot of
script kiddies, basically.
There's a bunch of people
running around and they're like,
oh, I know how to hack.
And then they go and just
write a bunch of script.
And that's OK.
I think that's a great
way to get started.
I think people kind of abuse
it a little bit, but that's OK.
But it's also a fairly
lightweight distro.
I know someone who keeps a
version of it on a bootable USB
that they just carry around and they
can just boot any computer into it,
which is very cool.
We should definitely do that.
COLTON OGDEN: Yeah.
That'd be cool.
I'd be super curious.
I don't know if there's any way
to tie that with the CTF stream,
but the two are at
least somewhat related,
but maybe they're both completely
worth having separate streams for.
Great stream.
Fix that subscribe button
in the [? bids ?] button.
We will do.
Thank you very much for being
willing to show us some support.
Can't talk.
Thank you very much, Nikolaj.
Appreciate it.
Can you do a basic tutorial
on machine learning as well?
So I guess maybe--
because I know-- I think Asley
was there for the other one.
NICK WONG: Yeah.
So we can also cover--
COLTON OGDEN: I guess maybe a smaller--
NICK WONG: A bit more in smaller chunks.
A little bit more low level just kind
of like, here's an explanation for--
COLTON OGDEN: Maybe describe what
we have from the very ground up
like if you were to talk about--
I don't know anything
about machine learning,
but like linear regression
is a thing, right?
NICK WONG: Sure.
And we can go through a
little bit more of the theory.
COLTON OGDEN: That'd be cool.
I think people will get
some value out of that.
When's the Docker one?
The Docker one is-- let
me pull up the calendar.
It is on the 27th of November.
11/27.
So that's the week after next.
So stay tuned for that one.
That'll be cool.
That'll help us cover some of the
gaps that we have now because it's
talking about Docker as well.
NICK WONG: There's all
sorts of tools that we use
that we forget that we haven't talked.
COLTON OGDEN: I enjoy the stream,
but try to stay a bit more on topic
in the beginning and save the free
talk for later, says PresidentOfMars.
Good point.
NICK WONG: Very good point.
COLTON OGDEN: We'll try to do so.
We had a lot of really nice tangents.
You did lead us in some
good direction though.
NICK WONG: It definitely
got us to some places.
COLTON OGDEN: We got to explore some
things that we might not have come up,
or necessarily organically the
CTFs of being part of that.
But yeah, we did have a
very, very lively chat today.
More blockchain tech, which
is tied with the bitcoin.
We'll be rich.
Let's be rich.
We'll give the cut to Nick.
NICK WONG: I appreciate it.
Thank you.
COLTON OGDEN: Keep it on USB and
the second one for persistence.
Stick it in a library
computer and go nuts.
NICK WONG: There was an experiment
done, I want to say Hack Five.
They're a really cool group.
If anybody from Hack Five is
ever watching one of these,
you guys are awesome.
You've inspired a lot of
my own personal projects.
And so Hack Five did this kind of like--
maybe informal experiment
where they took a bunch of USB
sticks with a bunch of
scripts on them and they just
tossed them around a campus.
And they wanted to see who would
actually plug-in these USBs
and then just see-- like let things run.
Apparently it's like a
frighteningly large number of--
it was like 60% or something actually
ran these scripts on their computers.
So yeah, as like a PSA, don't
pick up random USBs and use them.
Maybe run that through
a sandbox computer
that you have, or set it up
like a virtual machine that
is pretty safely sandboxed and
then throw it through that.
Don't run it on your actual computer.
I think that that's some computer safety
that people don't necessarily know.
COLTON OGDEN: Oh, right.
And then also cyber security.
NICK WONG: Yes.
Yeah.
So we'll definitely,
especially towards the spring,
we'll cover a lot of stuff--
COLTON OGDEN: Part of the CTF--
it's all kind of interrelated.
NICK WONG: They're all
touching each other.
COLTON OGDEN: We have a lot of-- yeah.
We have a lot of intersectional
ideas at this point.
Check out Python Anaconda.
Takes about 10 years to
load, but it works nicely--
and Jupyter, says
LincePotiguara, the two of those
are kind of more or less related.
NICK WONG: PyCharm is also very nice.
There's a lot of things built around--
Python is just beautifully well built.
COLTON OGDEN: There's just so
much stuff period, in the world,
in the universe that is computer
science and cyber security and hacking.
[INAUDIBLE] IT security
go over to security now
and start listening to the pod.
IT's [INAUDIBLE] security, best security
pod out there, like 800 episode.
You'll be busy for a while.
NICK WONG: That is a very good point.
They cover all sorts of cool things.
I think they're on Spotify too.
COLTON OGDEN: Interesting.
This is a world that I have not
dived into, so I would be curious.
I'm just a novice
grasshopper at this point,
enjoying the stuff
that you have to teach.
Picking up a USB you find
is like getting an STD.
I guess, you could sort of--
NICK WONG: You can make that analogy.
Yeah.
COLTON OGDEN: I use VS code for
everything in Vim and dire situations,
especially Python.
NICK WONG: I love the
way that's phrased.
In dire situations, I use Vim.
It just comes out of me.
COLTON OGDEN: Basically
like SSH'ing into a server.
That's what comes to my mind.
I'm sure there's other ones.
NICK WONG: That's a very good point.
COLTON OGDEN: Steve
Gibson and Leo Bonaparte,
Nikolaj referring to the other one.
If Colton is a novice, what are we?
Says ForSunlight, says Fatma.
NICK WONG: Yeah.
That's a good point.
He's not a novice.
He's very experienced
in a lot of things.
COLTON OGDEN: In the field of
cyber security, I am a novice.
I know some things about some things.
But in the world of CS and I
think this is universally true,
just whatever field you
want to go into and whatever
you want to explore and
deep dive into, you're
always going to find more
streams and just areas to go to,
which you're just completely lost.
But it's fun.
Exploring new stuff is cool.
NICK WONG: It's super cool.
It's why I love the field.
COLTON OGDEN: It's cool
that we can do this
and, not it's not just Nick showing me
stuff, it's like we get to show stuff--
we put this on YouTube.
It's going into the world
for everybody to learn from.
So it's a great time.
NICK WONG: It's a lot of fun.
Actually, I really like
that, like CS is just such
a field where you can learn forever.
It's just perpetually growing.
Even in any one facet, if
you were to just pick--
I don't know, it's
like a small-ish one--
if you just picked C--
if you picked malloc, you just
picked a single function in C,
and you could spend your
entire career on that.
And that's crazy.
I think that's fantastic.
It's super cool.
It's what's inspiring about this.
But you could take--
I think Google has its own malloc team.
And there are people who still rewrite
malloc and try to make it better
and try to make it faster and try to
do all sorts of cool things with it.
That's just one function in C, in C++.
COLTON OGDEN: It's an
important function.
NICK WONG: Super
important, but only one.
There can be like a whole
specialist around that thing.
And so I think that that's really cool.
I also just am very
inspired all the time in CS.
Anytime I meet someone who
also does CS, they always
have something that I can learn from
them and I can teach them something.
And I think regardless of how far you
go in CS you are always just learning,
which is very cool.
I know even professors
here will say things like,
oh, I didn't know that, in lecture.
We'll teach them something.
Very rare.
Very rare.
But it's very cool.
I think that's one of the
strengths that CS has,
is that it should be an all inclusive,
should be an all supportive community.
And if that's not true,
then I'd be very sad.
COLTON OGDEN: [INAUDIBLE]
says, I wonder if I
could build a Skyrim, Fallout
for a modding team with you guys.
If I were into modding I would be down
because I like Skyrim and Fallout.
I don't know if I would spend that--
if I decide I want to spend the
time to do a Fallout or Skyrim mod
I will definitely--
I know the first person
I'm going to come ask.
NICK WONG: That's a good point.
COLTON OGDEN: I would have
to get into that zone.
NICK WONG: I think someone
put Doom on the Pip-Boy.
COLTON OGDEN: Did they really?
NICK WONG: That's kind of awesome.
COLTON OGDEN: That's really cool.
I did not know about that one.
You need to pick a really small area
to be a specialist says Nikolaj.
I feel even that, probably
still keep learning forever.
NICK WONG: Yeah.
I'm sure you're still just going.
COLTON OGDEN: Always.
NICK WONG: Even as an expert, I
think, people are still learning.
Unrelated, but, Nwaanda
says that, did you
know that the characters from the
matrix, like in my screensaver,
were from a Japanese cookbook?
I did not know that.
And I am, right after
this, going to try and find
a way to include those as the only
characters on the screensaver now.
Just as an FYI.
That is very cool.
Awesome.
COLTON OGDEN: David Sir is Master
Yoda for me, says Bhavik Knight.
Yes.
Yes, indeed.
NICK WONG: And David has a
lot of really cool things.
That's awesome.
I would be [INAUDIBLE].
COLTON OGDEN: I know how things are
done, but not really complete a project
beyond teaching it.
Yeah, no, it's a universe.
Just dive, do what's
interesting too, because you
specialize in what you find fun, right?
I love games.
You like games and a
bunch of other stuff.
NICK WONG: I do like games,
I just had a lot of--
COLTON OGDEN: You've got your hands
in a lot of pots at the moment.
I think I tend towards games, I think.
But I like-- all the
stuff's interesting.
NICK WONG: Yeah.
That's awesome.
Yeah.
I would definitely advise,
like just-- people always,
in CS and in Silicon Valley there's
this culture of everyone needs
to be spending all their free
time on personal projects.
And that is, I guess,
maybe true-ish, there's
some portion of that that's
true, but I personally
spend a ton of my time
on personal projects.
But I think a lot of
people try to focus on,
what's the most prestigious
personal project I could build?
Things like that.
I just do it out of pure
interest if I could.
Like, is it even
possible for me to do it?
I just think that's cool.
And so sometimes you'll find that
you build cool personal products.
I mean, one of my personal products
was setting up my local DNS network
in my house and finding
your way to attack it,
an automated way to attack it.
I thought that was really cool.
I just did it for that.
But it ended up being
kind of a cool process.
COLTON OGDEN: And then
I shut down Google.
NICK WONG: And then I
went and hacked the NSA.
I did not-- NSA, I did not hack you.
COLTON OGDEN: This is a pet project.
NICK WONG: It's a pet project.
But there are other ones that
are way dumber where I just
thought they were kind of
cool and did them for fun,
like build a new way to cheat at
Scrabble, very algorithmically, super
simple.
There's very little that
actually has to be done there.
It's a very limited project.
It has almost no scope.
I just thought it was cool.
I just wanted to do it and
I wanted to mess around.
And so I think that pursuing projects
that you're just interested in,
you eventually stumble
into something that
is actually just people will be amazed
by and along the way you learn a lot.
COLTON OGDEN: Things grow, like a
small project can evolutionarily--
that's a terrible word, but it can
grow, and piece by piece it can evolve.
NICK WONG: Evolve is what it's going to.
COLTON OGDEN: Yeah.
John says, hey, Colton, I'll ask
the big question, Unity or Unreal?
I think I talked about
this in one of the streams.
I like Unity--
I like them both.
I don't use Unreal a lot, but
I think it's a great engine.
It's very cutting edge.
Its graphics and shader
technology is amazing.
And from what I understand,
better than Unity,
although unity is catching up and
doing a great job, Unreal and Unity
kind of different in their
paradigm in terms of how
they get people actually making games.
Unity does kind of
require that you script,
and Unreal has a visual scripting
language in wrap C++ instead of C
Sharp.
Unity is adopting bits
and pieces of that.
And I imagine Unreal is
probably doing the same thing
with how Unity does its stuff.
They're both great engines.
I would say, if you're getting
started on lower hardware,
Unity is going to work a lot better.
Unreal is very taxing.
My computer cannot run the
Unreal Engine to make projects,
but Unity runs perfectly fine.
NICK WONG: That's a good point.
COLTON OGDEN: Try them out and see
which one you prefer, honestly.
NICK WONG: That's a very
good, very good point.
So Lardinois asks, could
I show everyone how
to set up a Raspberry Pi or
some other mini computer,
like a Snapdragon or something, as
hardware host file between the machine
and router?
So basically it has like a caching
server, I think is what you're asking.
And like, yeah, actually,
I would super love
to do something Raspberry Pi streams.
I have like a million Raspberry Pi's.
I honestly would love to
advertise for Raspberry Pi
because I think they wrote an
article where they're like,
oh, we're only going
to sell 1,000 of these.
It might not-- it'll flop.
And it's like the most successful
mini computer business ever.
And it's super cool.
I would really love to go through
just like a whole process on what you
can do with the Raspberry Pi.
I've built a ton of things
on them just for fun,
like DNS servers all the way
to an email server for myself,
or my own personal VPN actually
runs on a Raspberry Pi, I think.
I've built some kind of
like load balance there.
And just kind of practicing network
practices and ideas in my home.
My parents hate my WiFi.
My WiFi is setup very weirdly
in my room, but that's OK.
COLTON OGDEN: I can imagine.
I'm having a hard time
figuring out how you get
all this time to do all these things.
NICK WONG: I just don't sleep very much.
COLTON OGDEN: As a
Harvard student as well.
Yeah.
Well, I know Robert wanted
to do a stream on Arduino,
and so we would need to get a computer--
a camera set up to film
right up close here,
so we can actually see what
you're doing with the hardware.
Although, for--
NICK WONG: Raspberry Pi
would probably be OK.
COLTON OGDEN: You
wouldn't need that, right?
NICK WONG: I can just port the screen
on to one of these-- and they use HDMI.
No.
COLTON OGDEN: Yeah.
OK.
Yeah.
That would work totally fine.
So I guess we would need that.
I guess if you did want
to do hardware specifics,
so we could have that as well.
NICK WONG: There's so many--
we should write this down.
COLTON OGDEN: Oh, I know.
I'm going to go through all these ideas.
We'll talk about it.
We'll schedule it up.
We're going to have that.
We're going to get that
taken care for [INAUDIBLE]..
OneBadPanda says, hello, handsome--
I'm assuming they're referring to you--
NICK WONG: Probably to you.
Yeah, we'll figure that out.
COLTON OGDEN: So thanks, OneBadPanda,
to whomever you are addressing that.
NICK WONG: We appreciate it.
We'll just mutually appreciate it.
COLTON OGDEN: Mutually appreciate it.
Just one collective--
NICK WONG: Just a collective handsome.
I like that.
That was good.
COLTON OGDEN: Nick can do that
Rubik's cube solver game in 3D
unity in no time, says Bhavik Knight.
They were talking about making a
Rubik's cube game where you actually
have a Rubik's cube--
I guess not a solver--
I think they specified that
it wasn't actually a solver,
they just meant a game where you
could play, but a solver too, I guess?
You can make a solver for it too, right?
NICK WONG: Yeah.
I would imagine he could build the
game a lot faster than I could.
I can maybe write a script to solve it.
COLTON OGDEN: I don't know about that.
NICK WONG: That's awesome.
COLTON OGDEN: Nick can have
his own channel I think.
YouTube channel Nick and Things.
I'm sure that would
actually do quite well.
You do have a stream,
but you don't use it--
NICK WONG: I do.
But I use it for gaming
and other things.
COLTON OGDEN: Another question.
Do you guys have your own Twitch
streams for games and projects?
NICK WONG: Yes, I do actually.
So I think my Twitch stream, it
comes straight from my console.
Let me think of the name.
I will remember it for next time and
then we will broadcast that on here.
COLTON OGDEN: I might do a games
one in the future, a personal one,
but I don't have one set up now.
NICK WONG: That'd be sweet.
COLTON OGDEN: I've
thought about it though.
It would be pretty cool to
play some games on streams.
NICK WONG: Yeah.
Yeah.
COLTON OGDEN: Maybe figure that out.
Good portable wireless
server to a Raspberry Pi.
Do you guys have your own--
if we need one--
and we need one robotics or Matlab--
if you [INAUDIBLE] camera
[INAUDIBLE] for Arduino.
NICK WONG: What a--
every biology professor
has us use Matlab.
I'm actually pretty good at
Matlab now, but it's just
such a weirdly written
piece of software.
It's very powerful and does
a lot of very cool things.
Has a function for everything you
could do in like signals processing,
stuff like that, it's just so strange.
It's just like a weird
thing to work with.
I'm not a huge fan personally, but
I've gotten to be a lot better at it
and I've gotten to be
a bigger fan of it.
And now when we get piece sets that are
all in Matlab everyone's like, oh, no,
I don't know how to code.
But like, I'm half CS,
so it's like, oh, sweet.
That's an easy night for me.
COLTON OGDEN: It works.
NICK WONG: Yes.
We could do a stream on that.
COLTON OGDEN: We'll figure it out.
We have like literally thousands--
NICK WONG: We have a bunch of ideas now.
COLTON OGDEN: We've been
going for 2 hours 20.
I think maybe we'll
take any last questions
and then probably adjourn for the day.
It's Friday, so that's the
end of the week for streaming.
NICK WONG: At least here.
COLTON OGDEN: Next--
the stream went away?
Or the chat went away?
I should say.
NICK WONG: Oh, no.
COLTON OGDEN: That's tragic.
Let's bring that back up.
The chat messages will still pop up.
But yeah, Monday, Veronica, Tuesday--
what's on Tuesday?
I lose track.
Regular.
Oh, David J. Malan is going
to do a regular expressions--
I should've done this better.
I've been bugging him to get this--
to get on camera.
A regular expression tutorial with DJM,
David J. Malan, on next Tuesday at--
is it at 1:00?
What time is it at?
That one's at 3:00.
So that one's going to be at 3:00.
And then on Wednesday we have a very
secret special stream starring David
as well.
And that one is going to be at 1:00 PM.
NICK WONG: That's awesome.
COLTON OGDEN: Yeah.
That one's going to be fun.
But we're purposefully not
releasing any details on that one.
And then the week after that we
have some other streams lined up.
But that's next week's agenda.
And Thursday and Friday
are Thanksgiving,
so we're not streaming at that point.
One last question.
By reading this you agree
to buy me a Tesla Roadster.
NICK WONG: Oh, bummer.
That's on you.
COLTON OGDEN: I read it.
NICK WONG: You read it out loud.
COLTON OGDEN: I read it.
NICK WONG: That's on video.
COLTON OGDEN: I should
have read it in advance.
I trusted John no to do that to me.
That's what you get.
That's why you can't trust people.
[INAUDIBLE]
NICK WONG: Especially
not on the internet.
COLTON OGDEN: If I
get rich enough to buy
you a Tesla Roadster just casually--
NICK WONG: Yeah.
Why not?
COLTON OGDEN: I'll consider it.
Thank you Nick and Colton
for the great stream.
This is Bella.
Thank you for joining us.
Thank you, everybody
who's here and the people
that watched earlier, for joining.
NICK WONG: And watching in the future.
COLTON OGDEN: Yeah.
NICK WONG: We really
appreciate that too.
COLTON OGDEN: It was awesome.
Great energy, great vibe today.
After 3:00 PM, unfortunately,
it's going to be after 3:00 on--
which day was it?
I think it was--
Tuesday is going to be at 3:00.
Thank you so much, says GX2G.
PresidentOfMars, I'd
be great if you give us
some kind of further
reading recommendations
at the end of the stream.
Do you have any by chance?
Do you know any?
NICK WONG: Off the top of my head
I would say looking at Pico CTF,
they talk about all sorts of things.
And then also just googling--
googling.
Someone brought up a site that was
really good, like explainshell,
I think.
Explainshell.com.
Yeah.
So this is kind of a cool useful way
of figuring things out as you go,
is explainshell.com.
It's very similar to like
learning how to use the man pages,
which I would also certainly recommend.
But generally speaking,
yeah, edX has a class
on Linux, which I just
pointed out in the comments.
There's a bunch of resources online for
like how to do certain things in shell.
Generally speaking, it's not done--
they're not usually done as
projects in and of themselves.
It's usually more you start to kind
of use it as you do other things.
That's like a general idea.
That's not entirely true there.
There are certainly projects you can
build exclusively in shell, like using
bash scripting and stuff like that.
But I think generally, just like pulling
up a terminal and starting to kind
of mess around with what
you can and cannot do,
great way to kind of get going on that.
But yeah, further reading, there's all
sorts of tutorials on the internet.
And I think just bash scripting--
yeah, actually, on its own is
probably a fine Google search that
tells you all sorts of stuff about it.
COLTON OGDEN: There's a lot of YouTube--
there's like multi-hour YouTube hacking
tutorials.
I imagine some of that is
good Linux or command line--
it's white hacking
generally that I've seen.
But good tutorial on how to--
I feel like if you
can do that stuff, you
have to have a good knowledge
of what your environment is
and what other peoples'
environments are made out
of because you have to navigate them.
NICK WONG: Navigating
foreign environment.
COLTON OGDEN: Have a good
weekend, guys, says Bhavik.
On Monday, we're having
the first female guest.
Ladies would appreciate that.
Yes, we are.
Veronica Nutting.
Shout out to Veronica.
She's going to be giving
us a Python stream.
NICK WONG: That's awesome.
COLTON OGDEN: Really nice
stream, says [INAUDIBLE]..
Thank you very much.
And then Fatma says, can we use sandbox
[INAUDIBLE] for Pico CTF practice?
NICK WONG: I don't see why
you wouldn't be able to?
COLTON OGDEN: I think the
sandbox is a little bit more--
NICK WONG: It's probably
a little limited--
COLTON OGDEN: --IDE then, right?
NICK WONG: You might want to
switch over to the IDE for that
because it might not interact
super well with Pico CTF.
Also, Pico CTF has its own
stuff on their actual website
where they force you to go
through them for a while.
And then later on you actually
start to use your own local machine
to do things.
And if you have anything that
is Linux or kind of Unix style,
that'll generally be pretty compatible.
So even your own local
machine would work too.
Actually, there's another resource.
I'll give you the link for it.
It's on Von hub.
The Mr. Robot Von hub image--
COLTON OGDEN: Von hub, that just
sounds like a dangerous website
to be visiting.
NICK WONG: This one's really cool.
So this is a CTF that you
can do entirely on your own.
And maybe we'll walk
through it or something.
COLTON OGDEN: Over here.
I'll pull up the--
NICK WONG: Oh, yeah.
Cool.
So there's this.
COLTON OGDEN: It keeps switching off
the chat box every time I do that.
NICK WONG: That's very annoying.
Well, I'll figure that one out.
So if you go to Vonhub.com they
have all sorts of cool things.
There's also No Byte and Wonder How
To, also great resources for stuff
like this.
Something to keep in mind,
people will post on the internet
their understanding of things and
generally they're not necessarily up
to date on like
theoretical understanding
or they aren't always
advocating best practices.
So something that I
would generally recommend
for people is make sure that
you're really thinking like,
is this the best practice?
Is this logical?
Can I figure that out?
Because it helps make you a
better CS person in general,
makes you a better thinker too.
But Mr. Robot is a CTF kind of.
It's an image, so you would load it up
through some sort of virtual machine,
like virtual box, would be
a great example of that.
COLTON OGDEN: Not a container image,
so they can't get through Docker.
NICK WONG: Right.
I don't know if they have
a containerized version.
They might.
That's very possible.
It would make sense for them to do that.
And so you might be able to look up
the Mr. Robot vulnerability container
and maybe pull it from Docker.
That would be a very light way to
do it, lightweight way to do it.
But I happen to know this
one off the top of my head.
And it's a great resource
for just kind of like,
how can I go through and explore
what exactly is going on?
So yeah, that would be a
great way to kind of motivate
what you're actually doing, so
that it's not just like random
playing around in the shell.
COLTON OGDEN: Makes sense.
NICK WONG: Yeah.
COLTON OGDEN:
PresidentOfMars says, great.
Thanks, guys.
Stay peaceful.
What time Monday?
It's going to be at 1:00 PM on
Monday Eastern Standard time.
Just set up the matrix screensaver
after seeing yours is--
NICK WONG: That's awesome.
COLTON OGDEN: And then Fatma
says, I'm serious about YouTube.
Yeah.
We're going to get this on YouTube.
It should be out today, actually.
I try to get the videos up
always within a couple hours
after them being streamed.
I think that was it though.
That was almost 2 and 1/2 hours.
So thank you for staying
a little bit later.
NICK WONG: Thank you.
COLTON OGDEN: What a great energy today.
This was an awesome stream.
Yeah, it's going to be a good weekend.
This was an awesome stream.
Shout-outs to Nick.
I should say, this was CS50 on Twitch.
My name is Colton.
NICK WONG: And my name is Nick.
COLTON OGDEN: And we had a good
stream today on Linux commands.
So next time.
NICK WONG: Thank you guys so much.
And thank you, Colton.
COLTON OGDEN: Docker next time.
NICK WONG: Docker next time.
COLTON OGDEN: I was a passerby.
I was just enjoying the ride.
I'm enjoying the ride,
having a fun time.
I'm very excited for--
I'm very excited for all the
ones that we-- all the ideas
that we've come up with today.
Thanks for all the input in the chat.
So thank you, everybody.
NICK WONG: Thank you, guys.
COLTON OGDEN: I'll see all
of you again very soon.
See you Monday.
