Saturday, May 14, 2011

CIS(theta) 2010-2011 - Eureka, we did it! - Meeting XIV

Aim: 
Completing Step 4!

Attending: 
CIS(theta) 2010-2011: DavidG, RyanH

Absent: 
CIS(theta) 2010-2011: HerbertKJoshG

Reading:
NA

Parallel Python
IPython
Large Integer number crunching Mersenne Primes
http://www.hoise.com/primeur/03/articles/weekly/AE-PR-01-04-37.html
Large Integer number crunching Beal Conjecture
http://www.bealconjecture.com/



InstantCluster Step 4: Software Stack (Completed)
By Jove, I think we've done it! OK, we had a really short meeting today as everyone had to come late due to xtra help and AP exams.... Anyway, we actually got openMPI working last time and didn't even know it! All we had to do was add the IPs to a file called "machines" to get nearly 2700 MFLOPs using 2 cores per node on 3 nodes!

Now, we can scale the cluster up from 3 nodes to all 24 students boxes and get over 20 GFLOPs. The trick was to use the 10.10.*.* IPs and not the 10.5.*.* ones. Maybe we could get the 3 servers in on this too for an additional 3 or more GFLOPs? 

BTW, we figured out how to setup the "machines" file by running ClusterByNight first, thanx Kevin Lynagh! That's also where we got the idea to run openMPI over openSSH. Sorry, but PXE boot just didn't work for us! We should also be able to add the octave/mpitb functionality from pelicanHPC as well, thanx Michael Creel!




We only installed gfortran on one box so we could compile flops.f on that node (lets call it the master node):
mpif77 -o flops flops.f

and copied "flops" to all the worker boxes (and used chmod 755 to make it executable) getting about 2650 MFLOPs on 6 cores over 3 nodes:
mpirun -np 6 --hostfile machines flops

What we messed up last time was making the "machines" file based on the 10.5.*.* static IPs we set up on eth1. When we listed all the 10.10.*.* DHCP IPs used on eth0, all worked fine! So, openMPI just defaults to eth0?

Well, it was almost fine. When the remote processes terminated, the master node hung. I think that's because the 10.5.*.* IPs are listed in the authorized_keys file. Maybe we can just edit that and make them 10.10.*.* too?

Well, that's all for now, enjoy!

Saturday, May 7, 2011

So many hard drives, so little time!


I recently had to replace a number of hard drives. So, I had to reinstall a bunch of student stations. In the process, I thought I'd update how I go about doing all this. Also, the only thing holding me back from using Linux 24x7 on the teacher station is the fact that Virtual TI only runs in Wimpdoze and our online gradebook and attendance system does not work well in Firefox. So, I decided to install WINE on all stations (except the servers) and Chrome on the teacher station:


STUDENT BOX = 
Ubuntu + SAGE + JRE + WINE + VTI 


TEACHER BOX = 
Ubuntu + SAGE + JRE + WINE + VTI 
adding: Flash for YouTube (auto install), ffmpeg for offline screencasting, VLC to view *.mp4s and dvds, chrome for gradebooking, Handbrake to copy dvds, smart notebook for linux


SERVER BOX = 
Ubuntu + JDK + openSSH + vsFTP (looking into setting up a SAGE server)
sudo su gedit /etc/network/interfaces = 
**********
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.5.254.247 = guardian, 144 = caprica
gateway 10.5.0.254
netmask 255.255.0.0
network 10.5.0.0
broadcast (optional?)
dns (optional?)
**********
/system/preferences/network connections (optional)
/system/preferences/network proxy = 10.0.0.125
more on jdk, openssh (to allow sshing in as root to upload to ftp server, don't forget to passwd root) and vsftp (for anonymous ftp, don't forget to create /home/ftp but don't chmod 700 /home/ftp, keep ftp server and ssh server on 2 different boxes):
http://shadowfaxrant.blogspot.com/2011/01/then-god-mage-midterm-week-and-saw-that.html
http://shadowfaxrant.blogspot.com/2010/06/so-many-linux-distros-so-little-time.html



Now, the way I install the Teacher stations is still based on the Student stations, but the Servers are no longer based on the Teacher stations, they are independent beasts! Since, I do not need to be rebooting from Wimpdoze to Ubuntu and back 50 times a day any more, I won't need a Server station to be a backup Linux based Teacher box. So ... I'm free at last, thank God Almighty, I'm free at last (from Wimpdoze)!



Step 1) Live CD (32bit Ubuntu Desktop 10.04 LTS Maverick Meerkat)
Boot Ubuntu CD, click install, answer on screen questions and run install. Make sure to make Student Stations boot without a passwd (unlike Teacher Stations and Servers) since the user passwd is also the root passwd and I'm not giving that out! Also, make the box name and the userid the same so box name shows on top right of screen after boot up: 
-students = alpha beta gamma delta, epsilon eta zeta theta
-students = iota kappa lambda mu, nu omicron iks pi 
-students = rho sigma tao upsilon, phi psi chi omega
-teacher = shadowfax
-server1 = guardian (jdk, ssh, ftp)
-server2 = caprica (not used at present, may become apache + SAGE server)



Step 2) Partitions
When asked to prepare partitions, do so as follows:
    /dev/sda1    fat32    42GB   (resize, but no other changes, leave wimpdoze partition alone)
    /dev/sda2    swap   256MB (change to swap)
    /dev/sda3    ext3     41GB   (change to ext3 + format + / partition)



Step 3) Ethernet
-when the install process is done, reboot and remove the CD
-once the PC reboots and you get to the desktop, right click the vertical arrow icon on the top right and edit the Ethernet interfaces
    eth0 set to auto DHCP (proxy and passwd needed for internet on school LAN)
    eth1: ip = 10.5.129.x (private Linux LAN)
            mask = 255.255.0.0
            gw = 10.5.0.254
            dns = 10.1.1.19
-test intranet connections with nautilus/ftp to 10.5.254.247
-internet connections will be tested later (via proxy and passwd) when downloading *.bin, *.lzma and *.deb files (we have internet access on the Linux LAN passwd protected by requiring a proxy server login)



Step 4) System Preferences and System Administration
-system/preferences/monitors (set to highest resolution)
-system/preferences/screensaver (set to 2 hours)
-system/preferences/networkproxy (enable proxy server IP)
-system/administration/printers (set network printer HP Laser Jet 4250 at 10.10.254.212)
-right click desktop and select /change background to set your background and click visual effects for compiz



Step 5) SAGE
-install SAGE *.lzma by copying it to /usr/local as root. 
-extract SAGE *.lzma and rename dir as sage.
-add path "/usr/local/sage:" to /etc/environment




Step 6) JRE
Install jre1.6.0_23 as a Firefox plugin for 3D graphics in SAGE
-system/preferences/networkproxy (login to proxy)
-use firefox to download latest jre *.bin file from http://www.java.com to /usr/lib/firefox-addons/plugins
-open a terminal and 
    cd /usr/lib/firefox-addons/plugins
    chmod 755 *.bin
    ./j*.bin
-then
    cd ~/.mozilla
    mkdir plugins
    cd plugins
    ln -s /usr/lib/firefox-addons/plugins/jre1.6.0_23/lib/i386/libnpjp2.so
-test firefox with "about:plugins" as the url to see that jre was plugged in!



Step 7) WINE + GAMES
-disable games: sudo chmod 700 /usr/games/*
-install WINE from http://packages.ubuntu.com using dpkg
-add WINE app folders to Desktop from ftp as needed



Step 8) XTRA APPS
-install optional software like VLC, handbrake, SmartBoard, Chrome and games via aptitude+proxy or synaptic or http://packages.ubuntu.com or author sites
-on the servers, sudo chmod 700 /home/* to secure saved files. Careful, we need to undo that for the ftp files: sudo chmod 755 /home/ftp or noone will be able to use anonymous ftp!
-on the servers, install openssh and vsftp (use vsftp.conf from pastebin.com) via dpkg. 
-on the servers, install the jdk in /usr/local and add the directory containing java, javac, javadoc and appletviewer (/usr/local/jdk1.6.0_23/bin) to /etc/environment as per instructions from http://java.sun.com
-here's the installation instructions for jdk from http://www.oracle.com/technetwork/java/javase/install-linux-self-extracting-138783.html

JDK Self-Extracting Binary Installation for Linux (32-bit)


JDK Documentation

System Requirements

System Configurations




Installation Instructions

This procedure installs the Java Development Kit (JDK) for 32-bit Linux, using a self-extracting binary file. The JDK download includes the Java SE Runtime Environment (JRE) – you do not have to download the JRE separately.
For RPM-based Linux distributions, like Red Hat or SuSE, refer to the RPM installation instructions.
The name of the downloaded file has the following format:

jdk-6u
            
-linux-i586.bin
          

jdk-6u18-linux-i586.bin
To install, download this file and use the following instructions.
1. Download and check the download file size. 
You can download to any directory that you can write to.
This bundle can be installed by anyone (not only root users), in any location that the user can write to. However, only the root user can displace the system version of the Java platform supplied by Linux.
2. Make sure that execute permissions are set
Run this command:
chmod a+x jdk-6u -linux-i586.bin
3. Change directory to the location where you would like the files to be installed.
The next step installs the JDK into the current directory.
4. Run the self-extracting binary.
Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with " ./" (necessary if " ." is not in the PATH environment variable):
% ./jdk-6u -linux-i586.bin
The binary code license is displayed, and you are prompted to agree to its terms.
The JDK files are installed in a directory called jdk1.6.0_ in the current directory. Follow this link to see its directory structure. The JDK documentation is a separate download.
5. Delete the bin file if you want to save disk space.


6. If you want to use Java within the browser, setup the plugin using the instructions in Manual Plugin Installation for Linux.


Note about Root Access: Installing the software automatically creates a directory called jdk1.6.0_ . Note that if you choose to install the JDK into a system-wide location such as /usr/local, you must first become root to gain the necessary permissions. If you do not have root access, simply install the Java SE Runtime Environment into your home directory, or a subdirectory that you have permission to write to. Note about Overwriting Files: If you install the software in a directory that contains a subdirectory named jdk1.6.0_ , the new software overwrites files of the same name in that jdk1.6.0_ directory. Please be careful to rename the old directory if it contains files you would like to keep.
Note about System Preferences: By default, the installation script configures the system such that the backing store for system preferences is created inside the JDK's installation directory. If the JDK is installed on a network-mounted drive, it and the system preferences can be exported for sharing with Java runtime environments on other machines.


See the Preferences API documentation for more information about preferences in the Java platform.


Manual Installation and Registration of Java Plugin for Linux


JDK Documentation
When you install the Java platform, the Java plugin file is included as part of that install. If you want to use Java within Firefox, you need to manually create a symbolic link from the plugin file in the release to one of the locations that Firefox expects. To make the plugin available to all users, create the link inside of the Firefox application's directory, in the plugins subdirectory. Alternatively, you can create the symbolic link in your home directory, in ~/.mozilla/plugins. In the remainder of this document, the text, " Firefox plugins directory ", implies either of these locations.
This release provides the Next-Generation Java plugin. If you have been using the classic plugin, see the Notes for further information.
The plugin file for Linux is located here:

/lib/i386/libnpjp2.so
          
If you are using a 32-bit Firefox, you should use the 32-bit Java Plugin (from the lib/i386 directory). To determine which version of Firefox you are running, launch the application, and select the menu item Help -> About Mozilla Firefox. At the bottom of the window is a version string line that contains either "Linux i686" (32-bit) or "Linux x86_64" (64-bit).
To install the Java Plugin follow these steps:
1. Exit Firefox.
2. Uninstall any previous installations of Java Plugin.
Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one.
Remove the symbolic links (or move them to another directory) to javaplugin-oji.so and libnpjp2.so from the Firefox plugins directory.
3. Create a symbolic link to the Java Plugin in the Firefox plugins directory.
Create a symbolic link to the Java Plugin libnpjp2.so file in the Firefox plugins directory:
cd
/plugins
    ln -s
/lib/i386/libnpjp2.so 
4. Start the Firefox browser .
Type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.
Notes
  • The classic plugin file was located here:
    /plugin/i386/javaplugin-oji.so
        
    This file should no longer be used and all symbolic links to it removed.
  • See Browsers Supported by Next-Generation Java Plugin for information about browser support in the new Java Plugin.



Of course, after my AP exams we had to play BZFlag via WINE and watch LOTR on an extra wide SmartBoard with a short throw projector and speakers!


This how we played BZFlag:
*********************************************
wine   starts windows emulator
bzfs   starts bzflag server (default is ffa)
-fb   = flags on buildings
-sb   = spawns on buildings
+r   = richochet on
-ms 6   = max shots is 6
+f GM{10}  = add 10 GM flags
-j  = jump
-h  = random builing height
-t  = teleport
-density 5 = 5% building density on map
-world cool.bzw = use cool.bzw map
*********************************************
(ffa with selected map)
wine bzfs -fb -sb +r -ms 6 +f GM{10} -j -h -density 5 -world CHOICE.bzw


(ffa with random map)
wine bzfs -fb -sb +r -ms 6 +f GM{10} -j -h -t -density 5


(ctf with random map)
wine bzfs -fb -sb +r -ms 6 +f GM{10} -j -h -t -density 5 -cr


(ctf with selected map)
wine bzfs -fb -sb +r -ms 6 +f GM{10} -j -h -density 5 -c -world ctf.bzw


(rabbit options with editted map)
wine bzfs -fb -sb +r -ms 6 +f good{10} -j -h -density 5 -rabbit killer -world rabbit.bzw
wine bzfs -fb -sb +r -ms 6 +f good{10} -j -h -density 5 -rabbit score -world rabbit.bzw
wine bzfs -fb -sb +r -ms 6 +f good{10} -j -h -density 5 -rabbit random -world rabbit.bzw


HTH, good luck with your Linux boxes!


Learning with Technology, 

Sunday, May 1, 2011

SmartBoard on Linux? They said it could not be done!

I finally broke down and ran Linux on my SmartBoard in every class for the the past couple of weeks!
(1) bluetooth Tablet (Wacom Graphire 6x8 with capacitive surface)
(2) wireless Mic (Radio Shack 75Mhz Lapel Mic)
(3) pen app (xournal)
(4) SAGE (keyboard intensive CAS)
(5) http://screencast-o-matic.com/ (online service)

First, I got my old setup (as listed above) working with the Smart Airliner Slate. Actually, its a bluetooth remote mouse from Wacom called the Graphire 6x8. Its the kind of tablet whereby you don't see what you're writing on the tablet itself (please see my donorschoose project). You get used to craning your neck and watching the PC Monitor or the PC Projection Screen or the SmartBoard clear accross the room to see what you've written.... 

Anyway, I've used the Graphire for years to write my Smartnotes on the fly in class and to make live Screen-casts of my classes. Its a nice little tablet with a 10" diagonal writing area. Also, it has a capacitive surface so I can hover the magnetic pen over the tablet without writing so that the students can see me highlight something on the screen as I circle over it. So, my YouTube Recording Studio works fine. BTW, xournal is a nice java *.jar app so its cross-platform. It can save to *.pdf and has nice paper backgrounds such as graph paper. It also recognizes geometric figures, so if I draw a circle or triangle, xounal redraws it for me nice and neat! I use xournal because of these features and because installing Smart Notebook takes for ever. Why install Smart Notebook if I only use it as a pan app?

However, one hiccup was that the bluetooth mouse sensutivity is way too high even when I set it to the lowest possible setting, so you have to write really, really slowly.... Another little SNAFU is that the SmartBoard will go to sleep at times. The surface will stop reacting to the pen (the green light goes red). This may be due to the fact that I have a very long USB line (extended via ethernet) from my Teacher station in the back of the room to the SmartBoard in the front? I find that the only way to counter act this problem is to start using the regular keyboard and mouse for a few minutes and then the SmartBoard starts to function normally. One time I had to logout of my Linux user account and log back in!

(1) SmartBoard 885ix (xtra wide 78" resistive surface SmartBoard)
(2) wireless Mic (Radio Shack 75Mhz Lapel Mic) 
(3) pen app (Smart NotebBook for Linux)
(4) virtual TI (TI-83/89 emulator) + WINE
(5) http://screencast-o-matic.com/ (online service)

Next, we enter the world of true SmartBoarding! So, I installed WINE to run Virtual TI right on the SmarBoard! Also, xournal did not work well from the SmartBoard. Every time I started a blank page, the pen would draw a line from the top left hand corner of the screen to the pen! It was time to install Smart NoteBook for Linux.

Otherwise, the wireless mic worked fine as it is platform independent (connects to sound card input). Also, screencast-o-matic worked fine once I added JRE to FireFox. BTW, be careful to use the same audio input/output as you do in Wimpdoze if you are running Ubuntu on a dualboot box and said box is running your SmartBoard in Wimpdoze too!

So, my STUDENT Linux Boxes have Ubuntu 10.04 Desktop plus SAGE (and JRE for 3D graphs in SAGE) + WINE + VTI. Don't forget, I downgraded all my Ubuntu boxes to 32bit so as to make JRE and Flash installation in FireFox easier. 

My TEACHER Linux Boxes also have VLC + Handbrake, WINE + VTI, Smart NoteBook, xournal as well as Flash for Firefox. We recently had our AP exams in Calculus and Computer Science. So, we are using WINE to play vintage StarCraft in APCS class and VLC to watch The Lord of the Rings Trilogy in AP Calculius! I had to a add libdvdcss2 from http://packages.medibuntu.org/ to get VLC to play my DVDs, however. Note that the teacher boxes include all the functionality of the student boxes so I can model what the students need to do in their work. I added VLC to watch videos such as my MP4s and screen-casts on YouTube. I added Handbrake so I can convert my own DVDs to MP4s for YouTube. I have made DVDs from old VHS tapes on my DVDR for YouTube Wednesday documentaries. I've also taken DVR recordings off my cable box and burned them as DVDs for this purpose. I added VTI so the students could follow my using a Graphing Calculator right on the SmartBoard. I mostly use VTI ROMs for TI-83+ and TI-89.

My SERVER Linux Boxes also have JDK, openSSH and vsFTP for APCS. I'm also looking into adding a local SAGE server for Computer Math but we'll leave that for another day. Note that the server boxes have all the functionality of the teacher boxes as I sometimes use the server as a demo machine via a video switch. In this mode, I use the SmartBoard as a glorified video projector as the resistive surface is not connected to the second box. This setup allows me to have one box running Wimpdoze and another running Linux all day without having to reboot. However, I'm needing to use a Wimpdoze box less and less....

BTW, I recently became a Twit on Twitter just so I can Tweet! Take a look at some of my recent tweets:

Joy is after and libdvdread4 libdvdcss2
Happiness is running a vintage server over over during AP Week!  
 
Happiness=setting up a BZFLAG server using BZFS via WINE on my Ubuntu Maverick Meercat 10.04 LTS 32bit Desktop Edition Athlon dual-core!

Yes, I know all things ! But, I celebrated related app! yesterday by downloading a

So, as penance, today I downloaded the app to my droid!  

 
@ This is the best tweet from Sunday night! I wrote it this way in class, obama@whitehouse.gov:-$ chmod 755 /bin/laden

 
Good luck to my young APCS paduans taking their AP now!

Finally, notice the new PayPal Donation tab at the top right of this blog! Please support this blog: give early, give often!

Well, that's all for today. I hope you found it informative! What do ya think? 
Teaching with Technology,