An Introduction to Re-introducing Ourselves to Computers

In this session we will get intimate with our own computers and write poetry with their logic. This workshop is an introduction to writing folder poetry, and navigating the command line interface using a language called Bash.

Coding isn’t something that just happens behind your screen. It can be a holistic practice surrounding the computer, the programmer, the relationship they have with each other, and the environments they create together.

This workshop assumes no coding experience and simultaneously takes the position that everyone who interacts with computers in some way is already a programmer.  

THE MAP IS THE TERRITORY

Agenda

  • Sharing our reflections and sketches of speculative liberatory learning environments
  • Melanie Introduction
  • Writing folder poetry and the garden of forking paths

This image has an empty alt attribute; its file name is folder-collage-b.png

Mac Terminal: 

  • We’ll use Iterm or the default Mac Terminal
  • To open, press CMD + SPACE & search for iterm or terminal (it’ll also be in your applications folder
  • We will use bash instead of zsh if you are new to terminal. To switch from zsh to bash, enter the following line in your terminal:
chsh -s /bin/bash
  • Let’s see who we are? type the bellow command and press enter. we’ll do that for all of these following code blocks eventually
whoami
  • let’s check the weather just because…
curl wttr.in

For Windows Terminal

  • Follow these steps: https://stackoverflow.com/questions/42606837/how-do-i-use-bash-on-windows-from-the-visual-studio-code-integrated-terminal
  • How to copy and paste a line in Git bash?
    • Ctrl + Shift + C / V

Download the Garden of Forking Paths

  • Download and unzip the Garden of Forking Paths
  • by default this will probably land in your Downloads folder
    • you should see a folder called ‘garden-of-forking-paths’
    • move this folder into your ‘home’ folder that we will open using terminal
  • Locate your ‘home’ folder. This where we will work from and store files in class, not on the Desktop
    • On macs with finder open, go to settings -> sidebar -> check the box next to the house icon + your username
  • ☺︎
    • Open Iterm (a terminal app) by pressing CMD + Space to pull up the search bar. Then type Iterm
      • Enter this command to open finder in your home folder (Macs):
      • open .

Helpful Terms

⚠️Folder Poetry Best Practices⚠️

  • all-lowercase-filenames-and-folder-names
  • No spaces
    • Use dashes or underscores. for example: my_file.txt or my-file.txt

Bash commands

Setup + Tips!

Text Editor:

  • Let’s edit our bash configuration file now that we made it so that we can open files in VScode from the terminal
code ~/.bash_profile

For Windows: code ~/.bashrc
  • once you see your bash profile open in vs code, paste the below code. these are our custom settings that set us up for writing beautiful powerful folder poetry.
  • CMD + S saves the file in vs code. it will ask you for your password
  • then quit and reopen terminal to see if your changes were made! 🍋🍋🍋
# the below line changes your command prompt
# your command prompt is the first thing you see every time you open terminal and what appears before each of your commands. Change the emoji to yyoouurrrr emoji 
export PS1="🍋 \w\n$ "


# handy aliases
alias d='cd ~/Desktop'
alias sp='source ~/.bash_profile'
alias bp='code ~/.bash_profile'
alias c='clear'
# shows hidden files
alias lh="ls -AF"

alias ty='for i in {1..5000}; do printf "  👋 🙌 THANK YOU 🙌 👋   "; done;'
alias swim='for i in {1..5000}; do printf "  swimmingly 🪸 🪼 🪸 🐬 🪸 💦 💧 💧 💧    "; done;'
alias heart='for i in {1..5000}; do printf "  ⚘ ⚔️ 💧 🫀 🩸    "; done;'


# tree codes

alias oldtree="find . -not -path '*/\.*' -print | sed -e 's;[^/]*/;|;g;s;|; |;g'"
alias treefile="find . -not -path '*/\.*' | xargs  -I {} bash -c 'f={}; echo \$f | sed -e \"s;[^/]*/;|;g;s;|; |;g\"; if [[ \$f == *.txt ]]; then echo; cat \$f; echo; echo; fi'"



treeFunction(){

# Function to Sequence Printed Files
# For 'each' file ending in .txt that is found in the current terminal directory
# 'do' 
#	print each using the 'cat' command
# 	then using the 'sleep' command,
# 	wait a variable number of seconds
#	before printing the next file.

#	args:
#	$1 = the directory to use for 'find'
#	$2 = the number of seconds used for sleep

	for each in $(find $1 -name "*.txt")
	do
		echo 
		dirname $each | sed -e "s,[^/]*/, | ,g"
		echo $each | sed -e "s,[^/]*/, | ,g"
		echo
		cat $each
		echo
		sleep $2
	done
}

#	args:
#	. = current working directory
#	2 =	number of seconds for 'sleep'

alias treepoem="treeFunction . 2" 

  • Then we’ll install Homebrew, software for macs that helps with installing open source software
  • copy paste the below and press enter. you will see a lot of text and be asked to enter your password. you will be asked to enter y/n. enter y!
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • then we’ll use homebrew to install a software called “tree” that will help us visualize our poetry in tree like structures
brew install tree

This image has an empty alt attribute; its file name is 11-1.png

☽☼ Homework Due Next Week

Folder Poems

Create a Folder Poem Using only terminal and (optionally) a text editor using your sketch for a speculative liberatory learning environment as a jumping off point for it’s design.

  • Suggestion: What folder poem would you make for someone specific that you care about to leave on their /Desktop?
  • What would your favorite prose poem look like as a folder poem?
  • Your poem can be narrative driven, prose driven, aesthetic driven, or interactive!

To share your poems:

  1. Take screenshot of your tree’d out folder poem and upload to the class project sharing form
  2. Upload the top folder of your poem to the sharing form
  3. If you sketched out your poem design on paper first, upload your sketch too!

create screenshots of your poem in the way that makes most sense for your poem. The tree command in terminal can be nice for showing an overhead view of your poem, a place to take screenshots. If your poem is very expansive, highlight the parts that are most meaningful to you in screenshots.

Read:

More Guiding Resources

Homework is a gift to yourself, and often to each other, not to me so please take and leave what serves you

~~~~misc items below~~~~

  • To change the admin permissions on the configuration file for our bash profile (the settings file for our bash environment) this makes it so vs code wont ask you for your pw every time you edit your bash profile
sudo chown -R <your username here> ~/.bash_profile

To test which shell we’re using, copy this line into your terminal.

From Wikipedia on Shells, “In computing, a shell is a user interface for access to an operating system‘s services. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer’s role and particular operation.”

echo $0

we should see the terminal return: -bash, let me know if you see zsh instead

Let’s check the weather in our local locations!

Paste the following line in your terminal to check the weather

curl wttr.in

This image has an empty alt attribute; its file name is Screenshot-2020-06-23-18.25.29.png