Blog

Semester exam

Email your answers to bill@hpa.edu

Terminal:
demonstrate at least 6 terminal commands, with screenshots or pasted terminal dialogs of each

Scratch:
Complete the Flappy Bird App, with some of your own modifications, email finished app to bill@hpa.edu

html:
Create a basic html page using a text editor and save a screenshot of both the code and how it looks in a browser

0 comments

Summary: Rpi and web pages

Why we do what we do:
Team-
It is important that you understand the steps you have been taking over the past few classes. This review might help:
1. We installed Raspberry Pi, a linux computer with an HDMI display
2. We enabled ssh, making it possible to control the Rpi from terminal on our macs
3. We installed a VNC (virtual network computer) application that enabled us to see the screen on the Rpi remotely
4. We activated the wireless network, so we could use this anywhere
5. We installed netatalk, so we could reach the computer as a shared computer from our macs, including folders
6. We installed apache2, the web server program
7. We modified the "root document folder" on apache2 to be in a new www folder in our home directory: /home/pi/www
8. We tested our web server by dropping in images and text documents
9. We learned how web browsers look for index.html first, and if they don't find it, they can often find a listing of files
10. We used the html editor simulator on code.org and www.w3schools.com to make a simple html page
11. We copied this code into a document using sudo nano /home/pi/www/mytestpage.html
12. We altered the html page on the simulator, and copied that over, noting the format

At this point, we are ready to proceed with the rest of the html tutorial online.
We can follow this if you like with the tutorials on javascript and python, so if you finish one, just move on to the next one.
We will have a semester assessment (some like the term "exam") in class in a few weeks, not in the gym, so make sure you understand not only what we have done here, but the other big modules we covered. We will construct a review program soon.
Let me know how I can help.
aloha
b

0 comments

HTML web page creation

HTML skills list (skeelsz list):
  1. Create basic web page
    1. include html, body, head, title, p tags
    2. upload to server in www directory
    3. index.html vs. index2.html
  2. Text attributes
    1. bold, italic, underline, strikeout, emphasis, strong, small
    2. h1, h2, h3, paragraph, li
  3. Create links
    1. external link in the form <a href = "http://www.physics.hpa.edu">physics server</a>
    2. internal link in the form <a href = "/images/kittycats/">hideous creatures</a>
    3. internal directory links: <a href = "../images/kittycats/">hideous creatures</a>
  4. Image handling
    1. basic image format: <img src="falling_kitties" width="300" height="175" alt="poor kitty" />
    2. external images: <img src="http://www.omgmycat.com/images/falling_kitties" width="300" height="175" alt="poor kitty" />
  5. Advanced URL links
    1. http://www.tofukitty.com/
    2. ftp://www.tofukitty.com
    3. afp://physics.hpa.edu/
    4. mailto:kittydoctor@sadcats.com
  6. HTML5 goodies: basics and layout
    1. <!DOCTYPE html> declaration
    2. <html lang="language-code"> or <html lang=en-US">
    3. <meta charset="utf-8" />
    4. h1-h6
    5. <header>
    6. <header role="banner">
    7. <nav> <ul> and <ol>
    8. <main role="main">
    9. <article>
    10. <section>
    11. <aside role="complementary">
    12. <footer>
    13. <div>
    14. <div class="sidebar">
    15. comments: <!--blah--->
  7. HTML5: text operations
    1. <small>
    2. <strong> instead of <b>
    3. <em> instead of <i>
    4. <figure> and <figcaption>
    5. <cite>
    6. <blockquote>
    7. <time>
    8. <sub> and <sup>
    9. <code>
    10. <mark>
    11. line break <br>

0 comments

How to make VNC load on startup

To download use the following commands:

wget http://www.penguintutor.com/otherfiles/tightvncserver-init.txt 
sudo mv tightvncserver-init.txt /etc/init.d/tightvncserver 

You may need to change the variable on line 16. It is currently set to pi which is the default username on the Raspberry Pi Debian image. Set this to whatever username you want to login to TightVNC as. Do not put root as the user.

Change the file so it is owned by root (not strictly neccessary, but is the standard ownership for init files
sudo chown root:root /etc/init.d/tightvncserver

Make the file executable by running
sudo chmod 755 /etc/init.d/tightvncserver

Add the script to the default runlevels with the command
sudo update-rc.d tightvncserver defaults

TightVNC will now start at startup. I'd recommend you reboot at this point to make sure it's working, but you can just stop and start if you don't want to reboot.
You can manually start and stop it using
sudo /etc/init.d/tightvncserver start
and
sudo /etc/init.d/tightvncserver stop

Note that this is designed for running only one instance of TightVNC on the computer. If you want to be able to start and stop specific instances of TightVNC then you will need to tweak the startup script appropriately.

0 comments

rPI next steps

  1. nmap
    1. sudo apt-get install nmap
    2. run nmap on physics.hpa.edu
  2. tcpdump
    1. sudo apt-get install tcpdump
    2. tcpdump -i eth0
other installs:

sudo apt-get install mtr

sudo apt-get install netcat

sudo apt-get install iperf

sudo apt-get install nethogs

sudo apt-get install iptraf

fun links
Supercomputer with Pi: (thanks to George Donev)
https://www.pwnieexpress.com/raspberry-pwn-pentesting-release-raspberry-pi/

0 comments

Raspberry Pi fun!

Raspberry Pi task checklist:

  1. install pi from noobs
    1. connect HDMI, keyboard and mouse
    2. insert SD card
    3. connect power
    4. select Raspian install, click install
    5. once install is finished, in raspi-config, choose third line (startup options)
    6. select login to gui automatically
    7. tab to save, restart
    8. login with pi/raspberry
  2. ssh into from local mac
    1. check your IP address from terminal using ifconfig
    2. from another machine, ping the address of your Rπ box
    3. note the response time
    4. ssh into the unit with: ssh pi@10.14.254.x or whatever your IP address is from ifconfig
    5. use the normal password
    6. test your connection with who, last and man
    7. man ps
    8. note ps ax (no flags) and other options
  3. apt-get update
    1. from either your ssh connection (terminal) or the LX terminal, run sudo apt-get update
    2. sudo shutdown -r now
  4. install tightvnc server
    1. sudo apt-get install tightvncserver
    2. run: tightvncserver
    3. create control and view passwords
    4. start VNC server from terminal: tightvncserver
    5. client can be iTeleport or free installer at tightvnc.com
    6. Download file "tvnjviewer-2.zip"
    7. port is probably 5901
    8. must run tightvncserver after restart to enable (see me if you want to automate this)
  5. Install wireless network
    1. make sure wireless unit is plugged into USB port
    2. use utility (upper left) to select wireless network
    3. sudo apt-get install wavemon
    4. run: wavemon
    5. pretty pictures...
  6. install netatalk
    1. sudo apt-get install netatalk
    2. after install, restart
    3. verify that you can login to your rPI using appletalk (command-K)
  7. install apache2 web server
    1. sudo apt-get install apache2 -y
    2. after install, restart
    3. test your web server at http://127.0.0.1
    4. test your webserver at http://10.14.254.x
  8. create home web directory
    1. open terminal
    2. sudo mkdir /home/pi/www
    3. sudo chmod 777 /home/pi/www
    4. sudo mv /var/www /var/www-backup
    5. sudo ln -s /home/pi/www /var/www
    6. sudo reboot
    7. test your web server now, it should show a folder listing
  9. create a sample page
    1. on your mac desktop, use command-shift-3 to take a picture of the desktop
    2. login to your rPI using command-k and the IP address
    3. login is pi, password is raspberry
    4. drop the screenshot file into the www directory
    5. refresh the web page, check to see if you can open the file
  10. scp index.html from /var/www/
    1. ssh into the unit from your mac
    2. using the scp commands, copy the index.html page from the web directory of your Rπ box:
    3. scp pi@10.14.88.x:/var/www-backup/index.html /Users/yourname/Desktop
    4. open the index.html page with textwrangler, note the html structure
    5. change a few words, then drag the changed file onto the safari icon to view your changes
    6. drop the file into the www directory, see if the listing changes
  11. folders and directories
    1. create a folder in www called test
    2. on your browser, navigate to test http://10.14.254.x/test/
    3. see if the directory listing returns
    4. index.html is the default page, if it is not there, the server returns a directory listing
  12. copy jpg into www, change index.html into index2.html
    1. using the mounted directory on your mac, insert a jpg file
    2. change the name of index.html to index2.html
    3. view the site in a browser-what changed?
    4. open the index2.html file and the jpg file in a browser
  13. demonstrate directory listing
    1. add a few more items to your directory
    2. check to see if the directory is listed

0 comments

HTML modules

0 comments

Unix modules

Team,
Here is a review of where we are so far:
  • fsck -yf file system check
  • cd change directory
  • ls list
  • pwd print working directory
  • ssh secure shell
  • say say something
  • mkdir make a directory
  • less look into it (also use more)
  • who who you are
  • last who last logged in
  • ctrl-z halt

First thing today, log in to Jody or Kai's machine as victim or herobrine and say a message with your name in it.

Module 2: wild cards, man pages, deleting files
This is how wild cards work:
Instead of typing out herobrine, you could type
h*
just make sure that nothing else matches the h part.
Another example:
These files are in a folder called test:
malcolm mary tom
if you type
rm m*
it will delete mary and malcolm
if you type
rm mal*
it will delete only malcom
if you type
rm *
it will remove everything.
You can also use this to delete certain types of files (jpg, txt, mp4)
rm *.jpg
will remove every jpg file in the folder

Now you try it:
  1. open terminal
  2. navigate to your desktop (remember, it is called Desktop)
  3. create a folder using mkdir called test
  4. navigate into that folder
  5. create three text files using sudo nano, the first will be called malcolm, then mary, then tom
  6. read each one using less or more
  7. take a screenshot of this folder from the gui (graphical user interface), command-3 takes a screen shot, command-4 is a screenshot of only what you select.
  8. copy this screenshot into your weblog, so you can remember how you did this
  9. remove one file at a time using the rm command, take more screenshots
Ok, at this point, you can navigate around, login to remote computers, create and delete text files.
What's next?
Internet...
Module 3: Internet
Your computer needs 4 things to be able to get onto the internet:
IP address, example 10.14.8.4
Subnet mask, example 255.255.0.0
Gateway/router, example 10.14.0.1
Domain name server (DNS), example 10.9.250.13

Here's what each one does:
IP address:
All traffic on the internet or local area network (LAN) is in the form of packets of information, like mail envelopes with a letter inside. Each letter you mail has two important things: the address you want it to go to, and the message inside the envelope.
TCP/IP is the format of these, which stands for Transmission control protocol and internet protocol.
The TCP part is the message, and the IP part is the envelope, with an IP address on it.
Check the IP address of your machine:
From the GUI: open system preferences, network
From the terminal: type ifconfig

Subnet mask:
Imagine you want to stay in one of two large 254 room hotels. One has long hallways, and very few floors, the other has many floors, but short hallways.
If you want to sleep, you don't want many people walking down the hall in front of your room. You want many floors with fewer rooms per floors.
This is what subnet masking does on a network. Each of the four segments can hold 254 addresses.
At home, you probably have a network that looks like this:
IP: 192.168.1.49
mask: 255.255.255.0
router: 192.168.1.1
dns: 192.168.1.1

This means that the last zero can hold up to 254 addresses (from 192.168.1.1 to 192.168.1.254)
HPA has this sort of mask:
255.255.0.0
which means that
10.14.0.0
is the elab, which can have 254 x 254 addresses
It makes for a quieter network, also providing some security as others cannot see you easily.

Router/gateway:
This is the gateway for all of your traffic, usually the access point at your home. The technical difference between these words is that a router routes traffic between two networks of the same type (like ethernet), while a gateway is between different types of networks (like a cable modem or DSL gateway)

Domain name server:
This is the computer on your network or outside that translates names into numbers, like a digital phone book.
Try this in terminal:
nslookup physics.hpa.edu
  1. when you get the address, write it down
  2. open a browser
  3. go to physics.hpa.edu
  4. now go to the numbers you wrote down.
  5. Try this with another name, either on campus or off
Ping and traceroute:
Imagine you want to find out if a machine is responding (you can block this by using "stealth mode")
In terminal ping one of the IP addresses in your class
ping an address out on the internet
what is the difference?

now try this:
traceroute www.apple.com

It should give you a trace of the path your connection took.
Try this with other addresses on and off campus.

NSLOOKUP:
Say you want to find out the name of something, or the IP address from the name.
try this:
nslookup
(you will get a funny > sign)
type:
server 10.9.250.13
type:
physics.hpa.edu
what do you get?
where is this machine?
Try again using 8.8.8.8 as the server

The best use of this is to find out what OTHER people might call a machine.
We have several DNS servers on campus, the main one is at 10.9.250.13
Others to try:
4.4.4.4
8.8.8.8
10.14.1.2

you can get out by typing
exit
or control-z (halt)

Next: Ethernet cables, wireless networks, cybersecurity

0 comments

Minecraft clock assignment

0 comments

Semester exam template practice

Semester exam template
Please copy and paste this template into an email message to bill@hpa.edu.

  1. what is your favorite color?

  1. what is your pet’s name?

  1. where were you born?

  1. copy and paste a screenshot from your wireless scanner, showing local networks

  1. copy and paste the text from a terminal session, after running ps

Email this message to bill@hpa.edu

0 comments

MAMP module

Team,
This week, we move from microcomputers like the Raspberry Pi to full scale web servers using apache, like in the Pi.
Our platform is called MAMP:
Macintosh (a type of apple)
Apache (a web server)
MySQL (a database program)
PHP (a database to web portal program)

We'll begin with MAMP setup on your laptops.
Find the following two folders in your Applications folder on the hard drive:
MAMP
MAMP PRO
Open the one called MAMP PRO and open the MAMP PRO application.
This should start the web server.
If you don't have admin access, see your instructor
There are two important folders you need to know about, in the MAMP folder:
htdocs (where your web documents are stored)
cgi-bin (where your scripts will be stored)
We will be learning how to use cgi scripts, which are programs that link web pages to data, like forms, online shopping and so on.
Our text for this is cgi101, which can be found online here:
http://www.cgi101.com
Or you can download the text here:
http://physics.hpa.edu/physics/act/pdf/cgi101_ebook.pdf

Here are our steps:
  1. Open the MAMP Pro folder
  2. Start MAMP pro, and make sure to check the button "Start Apache and MySQL on system startup"
  3. Test your server by going to http://10.14.8.x:8888 what do you see?
  4. Create a basic index.html page and load it into the htdocs folder. Test.
  5. Test your cgi script folder by going to http://10.14.8.x:8888/cgi-bin/printenv
  6. Open the cgi101 text book
  7. Find the Programs section (after the table of contents)
  8. Look for the hello world script, click on it
  9. Try both the script link and the live test link
  10. Copy the hello world script into textwrangler (this is your first look at the computer language PERL)
  11. Save as "first.cgi" on your desktop
  12. Move this file over to the cgi-bin folder on your computer
  13. Test out your new cgi by going to htp://10.14.8.x:8888/cgi-bin/first.cgi
  14. Move on to other scripts in the text (second.cgi, third.cgi...), reading the text then testing each one
  15. Make a copy of each on your weblog

0 comments

HTML Skills list

HTML skills list (skeelsz list):
  1. Create basic web page
    1. include html, body, head, title, p tags
    2. upload to server in www directory
    3. index.html vs. index2.html
  2. Text attributes
    1. bold, italic, underline, strikeout, emphasis, strong, small
    2. h1, h2, h3, paragraph, li
  3. Create links
    1. external link in the form <a href = "http://www.physics.hpa.edu">physics server</a>
    2. internal link in the form <a href = "/images/kittycats/">hideous creatures</a>
    3. internal directory links: <a href = "../images/kittycats/">hideous creatures</a>
  4. Image handling
    1. basic image format: <img src="falling_kitties" width="300" height="175" alt="poor kitty" />
    2. external images: <img src="http://www.omgmycat.com/images/falling_kitties" width="300" height="175" alt="poor kitty" />
  5. Advanced URL links
    1. http://www.tofukitty.com/
    2. ftp://www.tofukitty.com
    3. afp://physics.hpa.edu/
    4. mailto:kittydoctor@sadcats.com
  6. HTML5 goodies: basics and layout
    1. <!DOCTYPE html> declaration
    2. <html lang="language-code"> or <html lang=en-US">
    3. <meta charset="utf-8" />
    4. h1-h6
    5. <header>
    6. <header role="banner">
    7. <nav> <ul> and <ol>
    8. <main role="main">
    9. <article>
    10. <section>
    11. <aside role="complementary">
    12. <footer>
    13. <div>
    14. <div class="sidebar">
    15. comments: <!--blah--->
  7. HTML5: text operations
    1. <small>
    2. <strong> instead of <b>
    3. <em> instead of <i>
    4. <figure> and <figcaption>
    5. <cite>
    6. <blockquote>
    7. <time>
    8. <sub> and <sup>
    9. <code>
    10. <mark>
    11. line break <br>
  8. CSS basics

0 comments

raspberry pi checklist

Raspberry Pi task checklist:

  1. install pi from noobs
    1. connect HDMI, keyboard and mouse
    2. insert SD card
    3. connect power
    4. select Raspian install, click install
    5. once install is finished, in raspi-config, choose third line (startup options)
    6. select login to gui automatically
    7. tab to save, restart
    8. login with pi/raspberry
  2. configure IP address with /etc/network/interfaces
    1. open terminal app (LX terminal)
    2. cd to /etc/network
    3. ls to verify you are in the right place
    4. sudo nano interfaces
    5. change dhcp to static on the first interface (eth0), which is the ethernet
    6. insert the following lines below static:
      1. address 10.14.88.x (your teacher will give you your number)
      2. netmask 255.255.0.0
      3. gateway 10.14.0.1
    7. control-o to overwrite
    8. return
    9. control x to exit
    10. return
    11. sudo shutdown -r now
  3. ssh into from local mac
    1. from another machine, ping the address of your Rπ box
    2. note the response time
    3. ssh into the unit with: ssh pi@10.14.88.x
    4. use the normal password
    5. test your connection with who, last and man
    6. man ps
    7. note ps ax (no flags) and other options
  4. apt-get update
    1. from either your ssh connection (terminal) or the LX terminal, run sudo apt-get update
    2. sudo shutdown -r now
  5. install apache2
    1. sudo apt-get install apache2 -y
    2. after install, restart
    3. navigate to the apache configuration files in /etc/apache2/sites-enabled/
    4. sudo nano 000-default
    5. change the lines /var/www to /home/pi/www (both times)
    6. restart
  6. install netatalk
    1. sudo apt-get install netatalk
    2. after install, restart
  7. scp index.html from /var/www/
    1. ssh into the unit from your mac
    2. using the scp commands, copy the index.html page from the web directory of your Rπ box:
    3. scp pi@10.14.88.x:/var/www/index.html /Users/yourname/Desktop
    4. open the index.html page with textwrangler, note the html structure
    5. change a few words, then drag the changed file onto the safari icon to view your changes
  8. mkdir www in /home/pi/
    1. ssh into the unit and navigate to /home/pi:
    2. cd /home/pi
    3. mkdir www
  9. chmod 777 www
    1. still in the /home/pi directory, change mod:
    2. chmod 777 www
    3. this will enable you to add pages to your apache web server
  10. scp new index.html into /home/pi/www
    1. copy your new index.html file into the /home/pi/www directory:
    2. scp /Users/admin/Desktop/index.html pi@10.14.88.x:/home/pi/www/
    3. test using your browser: http://10.14.88.x
  11. mount using afp://x.y.z.a
    1. on your mac, hit command-k and login to your Rπ box
    2. check to see if your index.html file is in the www folder
  12. copy jpg into www, change index.html into index2.html
    1. using the mounted directory on your mac, insert a jpg file
    2. change the name of index.html to index2.html
    3. view the site in a browser-what changed?
    4. open the index2.html file and the jpg file in a browser
  13. demonstrate directory listing
    1. add a few more items to your directory
    2. check to see if the directory is listed
  14. go on to html5 task list

0 comments

Programming notes

code.org videos:
http://code.org/educate/videos

Lua programming manual:
http://www.lua.org/pil/contents.html

Lua lecture notes:
http://www.dcc.ufrj.br/~fabiom/lua/

Binary notes:
2^4 = 16
hexadecimal means 16
0-9, a-f

Data types:
integer
string
array
boolean

Operators:
arithmetic
arithmetic assignment
comparative
logic

Flow:

0 comments

Networking skill sets

Team,
Below is a list of goals and achievements for our networking unit. As soon as you complete each of these, you may move on to the next one. Each of these will be scored accordingly:

Cat 5 cable: 30 points
Create the cable: 10
Link works: 10
Speed at least 1000 mb/s: 10
Extra credit for over 1000 mb/s: 5

Airport base station setup: 75 points
Nuke/reset the base station: 10
Configure for named wireless access using only 5 gHz: 10
Restrict access to certain MAC address: 10
Inbound port map to web, ssh and afp wired: 30
Set to fixed WAN address: 10
Extra credit: timed access enabled: 5

Linksys WRT54GL router setup: 100 points (optional)
Reset the base station: 10
Configure for fixed WAN connection: 10
Configure for NON DHCP LAN connection: 10
Configure internal client port mapping: web, ssh, afp: 30
Configure wireless access with invisible network: 10
Restrict access to wireless network: 10
Demonstrate content control: 10
Extra credit: non-standard port mapping: 10

Advanced topics: DD-WRT, MicroTik routers (if interested)
DD-WRT setup: Extra credit: 40 points
MicroTik setup: Extra credit: 40 points

Wireless scanning: visible networks: 40 points
Demonstrate traditional Apple network search: 10
Demonstrate advanced Apple network search: 10
Demonstrate CLI network search: 10
Demonstrate wifi scanner utilities: 10

Wireless scanning: invisible networks/tunnels: 40 points
Demonstrate the use of Kismac to find invisible network: 20
Demonstrate the use of Kismac to find a tunnel: 20

Herobrine Hunt: variable points
Locate all wireless access points, including MAC address, vendor, AP/tunnel configuration, and channel/frequency: 10 points each AP

0 comments

redstone extra credit

Download file "Puzzle Door Challenge.rtfd.zip"

Download file "Puzzle Door Challenge.pdf"

0 comments