Computer Science @ PENN

java 1.5 api | java 1.4.2 api | slashdot | webmail | wikipedia
upenn.edu | directories | portal | van pelt library
seas.upenn.edu | engineering library
computer graphics & game dev (SIGGRAPH) | dining philosophers (DP) | science & tech wing (STWING) | women in cs (WICS)
CETS Answers |

CIS399 Spring 2009
Homework

FINAL PROJECT : Cutting the red wire instead of the blue one. Due day of final exam slot (5/12 12PM)
  • Create a new virtual machine (do NOT make a partition for dual booting, this must be done in a VM)**** (See Notes below)
  • Install Gentoo *BY HAND* from http://bouncer.gentoo.org/fetch/gentoo-2008.0-minimal/x86/
    • You MUST use a minimal install CD, not a LIVE CD
    • You must compile your kernel by hand. Do Not use genkernel
    • Consult http://www.gentoo.org/doc/en/handbook/
    • Once Gentoo is installed install enough packages to have a full Gnome-desktop available on normal bootup (including Firefox, Open Office and GDM).
  • Be prepared to demo your VM during our final exam time slot****** (See notes below)
  • NOTES
    You have two options for this assignment. You MUST chose one of the two.
    • 1) Make your virtual disk size 4.5GB. It must be small enough to fit on a DVD. If you do not have a machine to bring to the final exam slot to demo you *must* choose this option. You may also do option 2 for bonus points (and the learning experience!)
    • 2) Once you have gentoo installed you must install and have all three of the following working:
      • * 2a) A working apache server serving a hello world page on port 12345
      • * 2b) Apache must be capable of serving perl pages, you should have a sample perl script which can be displayed via your apache server.
      • * 2c) The enlightenment window manager DR17 (not 16) must be installed, working and demo-able (and selectable from GDM). This must be compiled from source (do not use prepackaged binaries or ebuilds. You must checkout from svn by hand). See enlightenment.org for instructions. This may seem like a weird task but its purpose is to expose you to some of the less well packaged software and how it is installed. There are many many ways to install E (as its referred to by its users) and exploring them and trying to get it to all work together is very instructive.
      Both options are non-trivial and should add roughly the same amount of complexity to the project.
Homework 8 - Configuring a Kernel Due 4/06/09

In this assignment you will configure your own kernel from scratch instead of relying on the default Ubuntu configuration. To do this, follow the building instructions from last week but skip step 3. When you run make menuconfig you will start with the default configuration. You should go through every menu at least once and try to understand which options should be enabled. Your system probably won't boot with the default options.

Hints:

  • If your kernel doesn't boot, you can select a different kernel by pressing the escape key when GRUB prompts you to at the beginning of the boot process.
  • Rerunning the make-kpkg command will rebuild anything affected by a change you make in the menu and generate new kernel packages for you to install. You'll probably have to go through a few iterations of this process to get something that works. Note, dpkg will complain that you're reinstalling something that's already installed, tell it to continue anyways.
  • If you don't understand what an option means Google and Wikipedia are your friend. If you can't find an answer there, post a question to the class mailing list.
  • Take a lession from Linus Torvalds and start early.

You should submit the .config file from your kernel source directory and a dump from the dmesg command to show your kernel boots properly. Please rename these to pennkey.config and pennkey.dmesg in your submission.

Homework 7 - Building a Kernel Due 3/30/09

Assignment posted here

Homework 6 - Xorg Due 3/23/09

  • Make a backup of the xorg.conf file (/etc/X11/xorg.conf)
  • Delete /etc/X11/xorg.conf
  • Switch to a virtual terminal (control-alt-f1 or virtualbox-key-f1)
  • Create a new /etc/X11/xorg.conf by hand by following the man page / internet tutorials
  • Test your xorg.conf by running "xinit -- :0 (or xinit -- :1)" from the f1-virtual terminal
  • If it breaks, check the log at /var/log/Xorg.#.log (# is 0 or 1)
  • Continue to test until your config works properly.
  • Do NOT use any auto-configuration utilities
  • You must specify a server layout, keyboard, mouse, video device and screen to get full credit.
  • Please email your new xorg.conf file to cis399ux@eniac as submission for this homework.
  • Bonus! If you can install a version of Xorg that supports it, get Xorg and HAL working such that you can hotplug your keyboard or mouse and have recognize the new devices without restarting. This is not an extraordinarily well documented procedure but search hard enough and the information is out there. For bonus points submit the additional configuration you needed to get HAL to work along with a short description of what you had to do to get it to work.
  • If you start x and you get a gray screen with a white box this is good! In the white box type "gnome-session". It should boot into a normal gnome environment. If it does then you're good to go.

Homework 5 Due 3/16

Perl Scripting Assignment (Due with 5 bonus points by 3/9/09, otherwise due 3/16)

interfacelift.com is a very cool website where people upload awesome wallpapers sorted by resolution and type. You've decided you want to add these to your own home desktop rotation (a bash script for another day to change wallpapers periodically) and always have the latest wallpapers from this website. So whats the best way to always have the latest wallpapers? Why to write a perl script to get them for you and put that in cron!

You're assignment is to write a perl script which will download the interface lift RSS file (http://interfacelift.com/wallpaper_beta/rss/) and download all of the images that you don't already have from it. (You can download images to the current directory and assume "having" an image means its in the current directory already). This script will be graded similar to the bash script, 50% correctness 50% on how well you take advantage of the language. Some tips:

  • Consider planning out how you're going to do this in english ahead of time. Do you need WWW::Mechanize or not?
  • Note that there is a pattern to the image download URLs. Something like this:
    http://interfacelift.com/wallpaper_beta/dl/id_name_resolution.jpg
  • Perl also supports backticks (`) for running external commands
  • man wget
  • Perl has a huge list of modules, some even do RSS parsing! One which may be useful in particular is XML::RSS::Parser
  • search.cpan.org is a big database of perl modules
  • cpan the program can be used to download things from cpan and install them automagically for you
  • You only have to download one resolution. You can chose any resolution that would be appropriate for your screen.
  • Assuming you have the description from the rss feed in a variable called $description the following two commands can get the name and resolution of the image out:
         $img = $description;
         $img =~ s/.*src=\".*\/(.*?)\.jpg".*/$1/s;
         $res = $description;
         $res =~ m/ (\d*x\d*)/;
         $res = $1;
    
Homework 4 - Becomming a scripting guru Due: 3/2/09

This week's homework is to become an amateur scripter in both Bash and Perl. You will submit two different scripts, one in Bash one in Perl.

Bash Scripting Assignment

You are testing out a new shell (similar to bash) that supports all the normal commands and piping. (No redirection). Your task is to write a bash script which will run several commands in bash and in this new shell (call it 'mysh'). When we run your script as "bash bashhw" it should run several commands that use piping and output whether "/bin/bash" and a shell (which is in the current directory and executable) called "mysh" output the same things for your commands. 50% of your grade will be whether or not your script outputs the correct PASS/FAIL for each command you test and 50% on your style and the bash constructs you used. Some things to look into to perform this task:

  • Bash arrays (for storing the commands you want to test)
  • Bash array size notation (${#arrayname[@]})
  • the 'diff' command
  • Bash for loops
  • For testing, since you don't have a copy of mysh you can fake one with bash by creating a symbolic link called mysh.
    ln -s /bin/bash mysh
    

When submitting your homework please call the file "bashhw". Files with a ".sh" extension are removed by the SEAS spam filters.

Homework 3 - Shell-isms, Piping and Redirection (Due 2/16/09) Similar to lastweek we'll use the commands that were mentioned in lecture. When submitting this homework you must submit typescript and not bash_history. Again man any commands you don't know. (email to cis399ux@eniac)
Write commands which do the following:
  • List all files in your home directory that begin with a "."
  • List all files in /etc that end in ".conf"
  • List the last 5 files, alphabetically, in "/"
  • Start and stop any daemon
  • run the command "last"
  • man grep
  • (on eniac) create a new file "partialLast" which contains, in randomized order, the names of the last 6 users who have logged in. (6 DIFFERENT users. See man uniq)
  • Output the file "/etc/resolv.conf" with line numbers to ~/newresolv.conf. (See man cat)
  • Practice using piping and redirection on your own. Come up with 3 other somewhat useful examples of commands you can write using piping and redirection
Homework 2 - Filesystem and Emacs (Due 2/9/09) Similar to lastweek we'll use the commands that were mentioned in lecture. In addition to using the list of commands below try the following tasks. When submitting this homework you must submit typescript and not bash_history. Again man any commands you don't know.
  • ln -s
  • chmod
  • chown
  • cat /proc/partitions
  • cat
  • echo
  • mount (try a cdrom)
  • df
  • du
  • emacs
  • nano
  • Try making a symlink to a symlink, and deleting the one inbetween
  • Remove execute permissions on a subfolder and try and cd into it
  • Remove read permissions on a folder and cd into it. Then ls.
Homework 1 - Getting Started with Linux (Due 2/2/09)
  • Get yourself started by downloading Ubuntu 8.10 Desktop Edition Live CD and VirtualBox and install Ubuntu.
  • Once you have Ubuntu Running, open up a terminal (command prompt) and use it to do things. You must use all of the following commands. Before you begin working type in the command "script". Once you are done and feel comfortable with the commands (use man for the commands you don't understand) type "exit". Then open firefox and send an email to cis399ux@seas.upenn.edu with the "typescript" file generated by the script command. If you cannot get script to work you can work normally and email the ".bash_history" file instead.
    • cd
    • ls (including -l -a and -h)
    • cp
    • pwd
    • mv
    • rm
    • mkdir
    • touch
Homework 0 - XKCD

Valid HTML 4.01 Transitional