d. thiebaut, computer science, smith college...• install a lamp stack • install wordpress •...

22
D. Thiebaut, Computer Science, Smith College

Upload: others

Post on 12-Sep-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Page 2: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

mith College

Computer Science

Dominique Thiébaut [email protected]

Raspberry PiUnit 8: Super User

CSC270—Spring 2020

Page 3: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Showcased Projects

https://create.arduino.cc/projecthub/ahmedismail3115/arduino-based-amazon-echo-using-1sheeld-84fa6f?ref=platform&ref_id=424_trending___&offset=91

Page 4: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Raspberry Pi Cloud

https://betanews.com/2020/04/16/raspberry-pi-edge-server/

• TuringPi.com

• Mini-cloud

• <$200

• i2c bus

• 1Gbps Ethernet connection

• eMMC memory on board + SD card drive

Page 5: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

How memory bandwidth is killing AMD's 32-core Threadripper performance

https://www.pcworld.com/article/3298859/how-memory-bandwidth-is-killing-amds-32-core-threadripper-performance.html

Page 6: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Explore on Your Own

• Arduino Project Hub: https://create.arduino.cc/projecthub/projects/tags/fun?page=2

• Raspberry Pi Projects: https://itsfoss.com/raspberry-pi-projects/

Page 7: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Linux Administration

Page 8: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Outline• Create new user

• Customize environment

• Install packages

• Install a LAMP stack

• Install WordPress

• Checking the Logs

Page 9: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Unit 9

Outline• Create new user

• Customize environment

• Install packages

• Install a LAMP stack

• Install WordPress

• Checking the Logs

Unit 8

Page 10: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

• Open Source

• Many "Distros"DebianFedoraUbuntu Red Hat Suse

GNU Packages

Linux

LinuxKernel

Libraries

GUIX11 Gnome KDE

Page 11: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

What the kernel does

• Manages memory

• Manages processes

• Provides device drivers

• Enforces security and services system calls

Page 12: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Linux Administration

Linus Torvalds

https://www.linuxjournal.com/content/25-years-later-interview-linus-torvalds

 "All the details [of Linux] have changed—the hardware is very different, the problems we have are very different, and my role is very different. But the whole 'make it better a n d h a v e i n t e r e s t i n g challenges' is all the same."

Page 13: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Linux Administration

https://www.linuxjournal.com/content/25-years-later-interview-linus-torvalds

• Linux kernel

• Android

• Chrome OS

• OSX (almost)

Page 14: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Linux Administration

https://www.linuxjournal.com/content/25-years-later-interview-linus-torvalds

• Linux Market Share (2018)

• Laptops: 2.1%, MS 87%, OSX 10%

• Servers: 96.5%,MS 1.8%,FreeBSD 1.72%

Page 15: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

pi root

https://larry.ancile.com/2016/12/15/larrys-favorite-things-day-8-super-users/

Pi

Linux Users

Page 16: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

pi

• pi: default user name when installing Raspbian

• raspberry: default user password for pi

• Can run programs, create/edit files in /home/pi directory

• Cannot install apps, cannot edit files in other users's home, cannot edit/view system files

• But, pi is allowed to use "sudo" command!

Page 17: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

• root is the account of the super-user

• root can

• install apps (apt-get)

• look at all files from all users

• create/edit/delete system files

• mess up the system

• "Some" users can temporarily become root with sudo

• pi and root have different home directories

super-user

Page 18: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

ls -a

whoami

groups

sudo su

hostname

last

w

ping

https://www.raspberrypi.org/documentation/linux/usage/commands.md

UsefulAdministration

Bash-Commands

Page 19: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Create Yourself!

http://www.ruthschreiber.com/artwork/untitled-the-female-side-of-god/

Page 20: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Create Yourself!

• What is a Linux User?

• Home directory

• Privileges

• whoami

• sudoers group

Page 21: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

CustomizingYour Environmentcd

ls -aless .bashrc

emacs -nw .bashrc source .bashrc

# DT's customizations PS1="\[\e[35m\]\u@\[\e[m\]\[\e[31m\]\h\[\e[m\]\[\e[36m\]\w\[\e[m\]\\ $ " alias emacs='emacs -nw' alias ll='ls -l' alias h='history'

Page 22: D. Thiebaut, Computer Science, Smith College...• Install a LAMP stack • Install WordPress • Checking the Logs Unit 8 D. Thiebaut, Computer Science, Smith College • Open Source

D. Thiebaut, Computer Science, Smith College

Installing Packages