Linux/VI Cheat Sheet for Lampbusters.com
- Use an SSH (Secure Shell Client) to connect to lampbusters.com (our web server)
- Use Putty, an encrypted SSH (secure Shell) client
- Click on the "start" button
- Go to "Programs"
- Go to "Putty"
- Go to "Putty" and click on it
- In the window that opens...
- For host type lampbusters.com (depending on your setup)
- OR: Go to my internet page and
scroll down under "Web page resources" and find the link to download
putty. When you go to the putty (TM) site, click on downloads, and choose
the top one (putty.exe) and download it. All you have to do is save a
shortcut on your desktop to it, or you can run it off a USB drive by:
- Double click on "my Computer"
- Double click on the "Removable Drive E:" icon
- Double Click on the "putty.exe icon"
- Follow the above directions
- EVERYTHING FROM HERE ON DOWN IS THE SAME FOR ALL METHODS
- login: the username you created with me
- password: Type your password here (note, NOTHING shows on screen when you
type, also, you only get 1 minute to log on to the machine before it
disconnects, and 3 bad tries locks you out for 2 minutes)
- I have a menu that I created for my students. Choose the appropriate number for what you want to do (Look at HTML errors, log into mysql, or, usually, "goto shell" )
- If you chose "go to shell" a command prompt shows up, [username@fujitsuclass ~]
- ******Type cd public_html and hit "enter" (this changes you into your
directory, VERY important, make SURE you do this, use pwd "enter"
to make sure what
directory you are working in to avoid errors)
- Type ls (for "list stuff") You should see your files listed.
- To change Passwrd! just type passwd and hit enter at the prompt.
- To edit a file, we'll use vi a powerful text editor, but a bit tricky
to learn at first. So you type
- vi filename.html (obviously, don't call it FILENAME, just put YOUR filename there)
- This will open an existing file, or create a new one if it's not there
- IMPORTANT vi has two modes, command and edit, and you need to make sure you are in the right mode
- if you type "i" for insert, you enter edit mode, and the [esc] key will put you back into command mode
- EDIT MODE(by typing i or a)
- You can use the arrow keys to move around (and page up and down)
- The backspace key works to delete characters
- If you copy something, then right click the mouse button, it will paste where the cursor is presently located
- COMMAND MODE (by hitting the [esc] key)
- :w (saves file :w filename to save to a particular name)
- :wq (save and quit)
- :q! (quit without saving)
- dd (deletes a line, 5dd deletes the line you are on, and 4 below it)
- yy (copies a line, 5yy copies 5 lines)
- p (pastes a line at the cursor)
- /searchword (searchs for "searchword")
Copying your template file
- You can at the command line (bash-3.0$) just do the following:
cp template.html newfilename.html (Again, use the name you want, not
- After you have connected to lampbusters.com and logged in and done the cd public_html
- then type vi filename.html
- (If you want to use your template, go vi template.html and then
:w newfilename.html and hit :q to exit vi, then vi newfilename.html
- MAIN STEPS
- Type "i" for insert mode, and start typing
- Hit [esc] then :w
- Then click the "refresh/reload" button on your web browser to view your changes
- Then use the taskbar to switch back to putty
- Type "i" for insert mode, start typing
- Rinse, repeat, enjoy. ;)
- Some Vi Help links located at the bottom of the page
- For some of the validation tags you need to copy, check out the Basic XHTML link.
- TO SEE YOUR WORK: Your web addres is
(where username is YOUR
username)and if your filename isn't index.html, you need to type that
after the last / (such as http://www.lampbusters.com/username/resume.html)
- ADVICE: Have your web page file open in Putty and the
same page displayed in
your web browers, make changes, then save,
switch to your browser and hit "reload". A very powerful way to learn HTML, as
you can see the results on a real web site immediately.
- Remember, to use pictures, you must use a ftp program such as Filezilla(helpfile) (file transfer protocol) to move them
into the right directory.