User Tools

Site Tools


user:afassett:portfolio

Corning Community College

High Computer Performance Fundamentals

Course Portfolio

High Computer Performance Portfolio
High Computer Performance II Portfolio

Projects

Linux/*BSD Desktop Install

Ubuntu-9.10
More coming Soon…

VmServer

Creating Virtual Machines

Automated Drawing

What is need in-order to run
  • xpaint(version 2.74 or greater)
  • xautomation (xte)
  • xwit
  • xserver environment (linux machine with xwindow)

Throughout and for this entire project:

        o Illustrate algorithm and logic decisions in the accomplish of each script
        o Make and have functioning backups of each script, NOT just the final product
        o display the scripts in-line in your wiki documentation
        o adequately document each script to explain what is going on
#!/bin/bash #version1.0
xpaint -24 -size 1024x720 -nomenubar -popped &
sleep 5
pkill xpaint
              + a square in the opposite direction
              + “draw” a square
              + “draw” another square, within the first, which is in a different color
  * Now to make things more interesting
        o draw me a circle approximately in the middle of the screen
        o “fill” the circle with some color
              + on a dual-head system
        o draw me a picture/scene on the screen
        o this picture/scene is subject to your creativity, but it must contain at least:
              + 3 mathematically significant shapes (circles, ellipses, arcs)
              + use some not-made-up-of-purely-90 degree angles (triangle, trapezoid, parallelogram)
              + utilize a minimum of 4 different colors (or shades of color)
              + uses 3 xpaint functions in the composition (fill, gradient, erase, etc.)
        o the picture must have a theme or message or depict something
        o test your composition drawing script on:
              + 2 different screen dimensions
 #!/bin/bash
pkill xpaint #kills any xpain that was already started#
xpaint -nowarn &
xwininfo -root|grep 'geometry'|sed -e 's/+.*$//g'|sed -e 's/^.*-geometry //g'>filea
WIDTH=`cat filea|cut -d 'x' -f1`
HEIGHT=`cat filea|cut -d 'x' -f2`
sleep 3
echo "entering xpaint"
Version=`xwit -all -print| grep -i xpaint | sed -e 's/^.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
echo "Version is: $Version"
pkill xpaint 
dVersion=`echo $Version | sed 's/\.//g'`
Version=$dVersion
if [ $Version -eq 2813 ] 
then
Version="-canvas"
else 
Version="-popped"
fi
xpaint -24 -size ${WIDTH}x${HEIGHT} -nowarn -nomenubar $Version & #"{" lets you know when the variable ends
sleep 3
toolID=`xwit -all -print | grep -i xpaint | sed -e 's/:.*//g'` 
winID=`xwit -all -print | grep -i untitled| sed -e 's/:.*//g'`
focusWin=`xwit -id $winID -focus -raise -move 0 0`
focusTools=`xwit -id $toolID -focus -raise -move 0 0`
echo $toolID
echo $winID
echo "Width is $WIDTH"
echo "Height is $HEIGHT"
sleep 4
xpos=`echo $[($RANDOM % $WIDTH)]`
ypos=`echo $[($RANDOM % $HEIGHT)]`
size=`echo $[($RANDOM % 30)]`
echo $xpos
echo $ypos
echo "done"
shape=`echo $[($RANDOM % 2)]`
echo $shape
 if [ $shape -eq 0 ] #Draw a triangle
            then
	    xte 'mousemove 500 500'
            xte 'mousedown 1'
            xte 'mousemove 600 600'
            xte 'mousemove 500 600'
            xte 'mousemove 500 500'
            xte 'mouseup 1'
            fi
 if [ $shape -eq 1 ] #Draw a Square
            then
            xte 'mousemove  600 500'
            xte 'mousedown 1'
            xte 'mousemove 600 600'
	    xte 'mousemove 500 600'
	    xte 'mousemove 500 500'
	    xte 'mousemove 600 500'
            #xte 'mousermove ${xpos} ${size}'
        xte 'mouseup 1'
        fi
 

sleep 10
pkill xpaint #same as before but this time making sure that I've finished
#xwit  -lower -raise##
References

Cluster Construction

Server installation

Preparing the server and setting it up is most of the work. To start If you want to setup at your house, you will need dyndns and don't worry it's free for what you are setting up (unless you are trying something greater than this) Note this way is also so you can ssh into your home computer. First things first make sure you setup your router to port-forward and has the ability to use dyndns. There are other ways but this wiki is keep simple. Now that your router is setup for dnydns and you have installed an O.S. on your machine you want, make sure you have the router port-forward to it's Ip-address. Making your machine static and the router find your machine's MAC-address is more efficient however not as simple. Now the machine can be called from the internet! however no services are running right now if you want to ssh to the machine make sure ssh is installed some linux o.s don't have the server package installed just the client side. For the server setup use the sources. Now you can make a server for anything however make sure you change the services ports open on your dyndns and your router (possibly the machine as well).

Sources

Playstation Linux

Video Construction Wall

user/afassett/portfolio.txt · Last modified: 2011/05/12 23:38 by afassett