User:AvitalB/prototyping: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 2: Line 2:
<span style="display: inline; position: relative; font: 80px Futura, Sans-Serif; font-weight: normal; letter-spacing: 40px; color: rgba(0,0,0,0.7); text-shadow:20px 0px rgba(0,0,0,0.6); cursor:progress;">Prototyping</span>  
<span style="display: inline; position: relative; font: 80px Futura, Sans-Serif; font-weight: normal; letter-spacing: 40px; color: rgba(0,0,0,0.7); text-shadow:20px 0px rgba(0,0,0,0.6); cursor:progress;">Prototyping</span>  
</div>
</div>
<br>
 
<br>
 
=Session 1=
=Session 1=
===Unix===
===Unix===
Line 9: Line 9:
===Raspberry Pi===
===Raspberry Pi===
[https://opensource.com/resources/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.
[https://opensource.com/resources/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.
<br>
 
<br>
 
=Session 2=
=Session 2=
Session 2 [https://pad.xpub.nl/p/prototyping-20190930 pad]
Session 2 [https://pad.xpub.nl/p/prototyping-20190930 pad]
===Creating a key===
===Creating a key===
- Key for our user in pi (created in the first session)
* Key for our user in pi (created in the first session)
<br>
* Our ssh key
- Our ssh key


Output in terminal when creating a key
Output in terminal when creating a key
Line 35: Line 34:
Making a secure login for the pi with our key
Making a secure login for the pi with our key


<b>ls -a</b> gives hidden files
'''ls -a''' gives hidden files


Question: How do we create hidden files?
Question: How do we create hidden files?
<h3>Git</h3>
===Git===
The software that runs git softwares or companies based on git (GitHub,gitlab or git.xpub.nl)
The software that runs git softwares or companies based on git (GitHub,gitlab or git.xpub.nl)
<br>
 
It’s a way to keep track versions of projects (text, code, websites, images)
It’s a way to keep track versions of projects (text, code, websites, images)


A git project will have a parent folder.
A git project will have a parent folder.
<br>
 
Parent folder- might have other folders in it with other files
Parent folder- might have other folders in it with other files


Line 58: Line 57:


HEAD- like a brunch, the version I am in right now
HEAD- like a brunch, the version I am in right now
<br>
 
MASTER- like in Abstract
MASTER- like in Abstract


'''git diff <file name>-''' shows the what have change since previous commit
'''git diff <file name>-''' shows the what have change since previous commit
<br>
 
'''git checkout -- <file name>-''' deletes the changes that where made and comes back to the last commit
'''git checkout -- <file name>-''' deletes the changes that where made and comes back to the last commit
<br>
 
'''git add -u -''' will add all the tracked ones
'''git add -u -''' will add all the tracked ones
<br>
 
'''git reset HEAD <name of file> -''' Undo a commit
'''git reset HEAD <name of file> -''' Undo a commit
<br>
 
'''git log-''' shows the commits
'''git log-''' shows the commits
==Publishing on XPUB GIT==
Create a new repository
<br>
When you create it gives instructions (choose SSH in the toggle)
<br>
pushing= publish to git website


==Pushing from git to raspberry pi==
===Publishing on XPUB GIT===
- For now raspberry pi will just host our website  
*Create a new repository
<br>
*When you create it gives instructions (choose SSH in the toggle)
- On the git website we see the published file in dashboard
*pushing= publish to git website
<br>
 
''*** sudo let’s you install thing on pi- sudo apt install <software name> ***
===Pushing from git to raspberry pi===
<br>''
* 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 ***''
''*** sudo su- you can be someone else ***''
<br>
 
use HTTPS link (top right)
*use HTTPS link (top right)
<br>
*Command to clone to pi '''git clone <HTTPS link> name the new folder'''
Command to clone to pi:
<br>
'''git clone <HTTPS link> name the new folder'''


===Work flow===
===Work flow===
Clone to your computer the folder from GIT (with the ssh url)
* Clone to your computer the folder from GIT (with the ssh url)
<br>
* Then you can pull changes from the GIT  
Then you can pull changes from the GIT  
* Or push changes back to the GIT
<br>
[[File:Galaxy.jpeg]]
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


[[File:Galaxy.jpeg]]
'''Push''' makes it public

Revision as of 12:36, 14 October 2019

Prototyping


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

Galaxy.jpeg

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