User:AvitalB/prototyping
Prototyping X
Session 1
Unix
Unix is a portable, multitasking, multiuser, time-sharing operating system (OS) originally developed in 1969 by a group of employees at AT&T.
Raspberry Pi
Raspberry Pi is the name of a series of single-board computers made by the Raspberry Pi Foundation, a UK charity that aims to educate people in computing and create easier access to computing education.
Session 2
Session 2 pad
Creating a key
- Key for our user in pi (created in the first session)
- Our ssh key
Output in terminal when creating a key
+---[RSA 2048]----+ |BEo . | |**o + | |=o+ . + | |.=o.. . + | |.ooo.o S | |.oooo+.B + | |. o ..B.B | | .= . | | .ooB+ | +----[SHA256]-----+
Making a secure login for the pi with our key
ls -a gives hidden files
Question: How do we create hidden files?
Git
The software that runs git softwares or companies based on git (GitHub,gitlab or git.xpub.nl)
It’s a way to keep track versions of projects (text, code, websites, images)
A git project will have a parent folder.
Parent folder- might have other folders in it with other files
git init- stating the git program in your folder (makes a git. Folder)
Command to make git track your project:
git status- shows in red what isn’t tracked and in green what is tracked
git add <file name>- starts tracking that file or files
git commit -m <“a comment about what change has been made”>- saves the version in the .git folder
HEAD- like a brunch, the version I am in right now
MASTER- like in Abstract
git diff <file name>- shows the what have change since previous commit
git checkout -- <file name>- deletes the changes that where made and comes back to the last commit
git add -u - will add all the tracked ones
git reset HEAD <name of file> - Undo a commit
git log- shows the commits
Publishing on XPUB GIT
- Create a new repository
- When you create it gives instructions (choose SSH in the toggle)
- pushing= publish to git website
Pushing from git to raspberry pi
- For now raspberry pi will just host our website
- On the git website we see the published file in dashboard
*** sudo let’s you install thing on pi- sudo apt install <software name> ***
*** sudo su- you can be someone else ***
- use HTTPS link (top right)
- Command to clone to pi git clone <HTTPS link> name the new folder
Work flow
- Clone to your computer the folder from GIT (with the ssh url)
- Then you can pull changes from the GIT
- Or push changes back to the GIT
More GIT
You can always revert to a previous commit on git with git log> than you copy the “name” (very long digits and numbers) of the commit. Than you do git checkout <insert name of commit you copied before>
git checkout HEAD> takes you back to the latest commit git checkout MASTER> takes you to the master
git status>shows you what is happening right now in the repository
.DS_store files that Mac makes (we want bot to see them)
cd.. go back to parent directory
ls -al > shows you regular+invisible files
Nano basic text editor (a bit like ne)
Nano .gitignore git will ignore this type of files
Example:
- .DS_store
- tmp/*- will ignore everything in this folder
- *.jpeg- will ignore all jpeg files
git commit -m “gitignore file” .gitignore
-m is a message specific for one file
-a will commit a bundle of all files added
Commit is local
Push makes it public