User Tools

Site Tools


opus:spring2012:jdavis34:part1

Part 1

Land of the Lost

Entry 1: January 26, 2012

Began working on all three classes word definitions and some of the projects, such as the install of Ubuntu to a desktop system.

  • Learned a bit about aptitude and some uses for it. IE: sudo aptitude, aptitude update, aptitude upgrade.
  • Was useful in that we did not set up the correct path for our install from the server, it was using the generic one from the hosted site and we needed to change it.
  • Not particularly sure on the difference of what update and upgrade did, just that it was explained as that is normally what a system does when it looks for updates and upgrades to them.
  • Accomplishing all of the work between the three classes seems rather time consuming and somewhat repedative between some of the work required for them, such as the submitted files required etc.
  • svn add *.* where * is the file and the extension.
  • svn commit -m “*.*”

Entry 2: February 4, 2012

             root
              |
            home
              |
           jdavis34
              |
   ___________________________
  |      |      |      |      |
 bin    src   data    lab2    lab1
         |
     ___________
    |    |      |
 cprog  unix   submit

Entry 3: February 28, 2012

After a long extensive process I caught up on the 1 assignment I missed cause I was deathly ill over the weekend, and CSx04 which for some reason did not submit the first time I did it. Now I believe it is time to get working more on the Opus and try to see if I can find a work around for the Android tablet and certain keys not functioning correctly with remote log in for lab 46. Probably maybe going to work on a experiment as well.

Spent some time playing with and tweak Vi editor so when coding it is more comfortable to use. jdavis34@lab46:~/src/cprog$ vim ~/.vimrc

1 syn on
2 set nu
3 set ruler
4 set title
5 set cul
6 hi CursorLine term=underline cterm=underline gui=underline
7 set insertmode

WTB more cool things to do with VI

Entry 4: February 29, 2012

aptitude install cmake

aptitude install build-essential

aptitude install mysql

aptitude install mysql-server

cd /usr/src – to change the current directory to /usr/src directory

wget http://download.berlios.de/pvpgn/pvpgn-1.8.5.tar.gz

wget http://download.berlios.de/pvpgn/pvpgn-support-1.2.tar.gz

tar xfz pvpgn-1.8.5.tar.gz

tar xfz pvpgn-support-1.2.tar.gz

to start /usr/local/sbin/bnetd

To stop: sudo killall bnetd

To restart: sudo killall -HUP bnetd

To force quit: sudo killall -KILL bnetd

Keywords

cprog Keywords

Standard I/O (STDIO, STDOUT, STDERR)

Definition
FILE *stdin

stdin is associated with a user's standard input stream. usually a keyboard.

FILE *stdout

stdin is associated with an output stream used for normal program output. usually a display terminal.

FILE *stderr

stdin is associated with an output stream used for error messages. often a display terminal.

Demonstration

Demonstration of the chosen keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
  int x;
    printf( "please type your age: \n");
    scanf( "%d", &x ); 
    printf( "Is your age, %d \n");
    return(0);
}

Header Files

Definition

A header file is a file containing C declarations, You request the use of a header file in your program by including it, with the C preprocessing directive `#include'.

Demonstration

There are a large number of headers listed bellow is a few

/*
 * Sample code block
 */
#include <stdio.h>
#include <math.h>
#include <signal.h>
#include <stddef.h>
#include <complex.h>
int main()
{
    return(0);
}

arithmetic (equations, operators)

Definition

Operator Description

+ Adds two operands

- Subtracts second operand from the first

* Multiply both operands

/ Divide numerator by denumerator

% Modulus Operator and remainder of after an integer division

++ Increment operator, increases integer value by one

– Decrement operator, decreases integer value by one

Demonstration

Binary arithmetic operators are +, -, *, /, and %.

         int a = 25;
         int b = 5;
         int c;
 
         c = a + b;
         printf( "a + b = %dn", c );
 
         c = a - b;
         printf( "a - b = %dn", c );
 
 
         printf( "a * b = %dn", a * b );
 
         c = a / b;
         printf( "a / b = %dn", c );
 
         c = 100 % 3;
         printf( "a % b = %dn", c );

logic and operators (and, or, not, xor)

Definition

“==” Checks if the value of two operands is equal or not, if yes then condition becomes true.

“!=” Checks if the value of two operands is equal or not, if values are not equal then condition becomes true.

“>” Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.

“<” Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.

“>=” Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.

“⇐” Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.

“&&” Logical AND operator. If both the operands are non zero then then condition becomes true.

“||” Logical OR Operator. If any of the two operands is non zero then then condition becomes true.

“!” Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.

Demonstration

Demonstration of the chosen keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!
lab46:~/src$ 

Variables

man3 printf Are allocated blocks of storage in memory that we can associate with a name, such as “pirce”, “age”, “year”, etc.

Name Type Range

int Numeric - Integer -32 768 to 32 767

short Numeric - Integer -32 768 to 32 767

long Numeric - Integer -2 147 483 648 to 2 147 483 647

float Numeric - Real 1.2 X 10-38 to 3.4 X 1038

double Numeric - Real 2.2 X 10-308 to 1.8 X 10308

char Character All ASCII characters

Examples of variables can be but not limited to:

int x %d
short x %d
long x %d
char x %c
float x %f
double x %lf

Sizeof

The sizeof operator gets the size of its operand.

This initializes X to the size of c, resulting in a integer of the type size_t:

size_t X = sizeof(c);

String

In computing, a C string is a character sequence terminated with a null character

In the following, the string literal “hello world” is printed.

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
 
printf("hello world");
}

Repetition/Iteration Structures For

The variable initialization allows you to either declare a variable and give it a value or give a value to an already existing variable. Second, the condition tells the program that while the conditional expression is true the loop should continue to repeat itself.

FOR - for loops are the most useful type. The syntax for a for loop is

for ( variable initialization; condition; variable update ) {
  Code to execute while the condition is true
}

cprog Objective (added)

demonstrate structured and object-oriented problem solving concepts

By the end of this semester show the ability to demonstrate the use of logic and structure in program writing.

Method

The method of this could be variously described, but a easy effective means would be to ask a student to create a set of instructions that:

1. creates a program

2. Initializes the program

3. contains a logical sense to obtain a desired result, IE: if someone wanted to multiply 2 numbers and get a result.

Measurement

To asses how a students effectiveness was in creating this first:

1. Does the program compile without errors.

2. Does the program ask for input for the 2 variables to be multiplied.

3. Does the program give the correct desired answer for this function it is to serve.

4. Lastly the code in which it is written, was it initialized properly, does it only prompt the user for one occurring event, Does it ask the user to input a variable to end, does it continuously loop and not close itself without the user having to exit the program, there is a large list in structuring the means to a achieved goal and many ways to reach it, but in the end was it the most efficient.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do? So far have created a few usable logical programs, simple but usable.
  • Room for improvement? ALOT
  • Could the measurement process be enhanced to be more effective?
  • Do you think this enhancement would be efficient to employ?
  • Could the course objective be altered to be more applicable? How would you alter it?

hpc0 Keywords

Aptitude

Identification of chosen keyword (unless you update the section heading above).

Definition

Aptitude is a menu-driven, text-based front-end to the Advanced Packaging Tool or APT system. Many of the common package management functions, such as installation, removal, and upgrade, are performed in Aptitude with single-key commands.

Demonstration

start Aptitude as a normal user with the following command at a terminal prompt

lab46:~$ sudo aptitude
lab46:~$ aptitude update
lab46:~$ aptitude upgrade 

para-virtualization

Definition

Is a virtualization that presents a software interface to virtual machines.

full-virtualization

Definition

virtualization technique that provides a virtual machine enviorment that is a complete simulation of the underlying hardware. It requires that every aspect of the hardware be reflected on other virtual machines, including the full instruction set, input/output operations, interrupts, memory access, and whatever other tools that are used by the software that runs on the bare machine.

Xen

Definition

A virtual machine monitor that allows multiple multiple operating systems to execute on the same hardware.

PvPGn

Definition

This is a server emulation software, that emulates blizzard battle.net online gaming services.

Demonstration

In the process of setting up a server so more will come for this part of this one..

Virtual Server

Definition

Virtual Server, is a server to which intended virtual machines will be hosted and or migrated off of.

Demonstration

this example is the server that had been created in class.

lab46:~$ ssh root@vmserver02.student.lab

Virtual Machine

Definition

A machine on a server set up to run particular processes predefined by the user but not limited to just these, or not limited to only existing inside of a virtual machine. The benefit to this is the ease of portability depending on software used in porting it to other systems without reconfiguration, and possibly while it is still running.

Demonstration

Again this example is the virtual machine within the server created in the previous word.

lab46:~$ ssh root@vm34.student.lab

Configuration

Definition

Defining a script that is set to run on the start up of a software or service that determines particular variables that effect the working environment in relation to end user settings desired in a particular circumstance.

Demonstration

such files as working with the pvpgn server we are setting up are:

*.conf

hpc0 Objective(needed)

hpc0 Objective

State the course objective

Definition

In your own words, define what that objective entails.

Method

State the method you will use for measuring successful academic/intellectual achievement of this objective.

Measurement

Follow your method and obtain a measurement. Document the results here.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do?
  • Is there room for improvement?
  • Could the measurement process be enhanced to be more effective?
  • Do you think this enhancement would be efficient to employ?
  • Could the course objective be altered to be more applicable? How would you alter it?

unix Keywords

Local host

Definition

“Localhost” refers to the local computer that a program is running on

Demonstration

Remote host

Definition

Remote Host is the host in which you remote into, IE not the actual machine you are on but the remote one where the application or operating system exists.

Demonstration

Home directory

Definition

The home directory is, the directory where the users home resides, essentially the root directory to the user but not really the root.

Demonstration

Current working directory

Definition

Is the directory that you are currently working in, and or where you are in relation to the root.

Demonstration

Regular file

Definition

They show up in ls -l without a specific character in the mode field. Called regular files, to distinguish them from special file types.

Demonstration
lab46:~/src/unix$ ls -l
total 4
-rw-r--r-- 1 jdavis34 lab46 1 Jan 26 12:14 something

Directory

Definition

Most common special file. In a directory listing ls -l, they will show up with a d in the beginning.

Demonstration
lab46:~$ ls -l
total 8
-rw------- 1 jdavis34 lab46 1100 Oct 15 14:03 #pico29112#
lrwxrwxrwx 1 jdavis34 lab46   18 Feb 10  2011 Maildir -> /var/mail/jdavis34
drwxr-xr-x 2 jdavis34 lab46    6 Sep  4 21:21 bin
lrwxrwxrwx 1 jdavis34 lab46   28 Aug 30 17:02 data -> /usr/local/etc/data/jdavis34
drwx---r-x 4 jdavis34 lab46 4096 Apr 27  2011 public_html
drwxr-xr-x 6 jdavis34 lab46   68 Jan 26 11:07 src
drwxr-xr-x 4 jdavis34 lab46   28 Jan 26 09:44 src.bak

GUI

Graphical User Interface- programs used by devices in order to provide human interface with the computer. I (I.E. keyboard,screen,mouse,trackball

tar/gzip

Definition

TAR

Tar is a very commonly used archiving format on Linux systems. The advantage with tar is that it consumes very little time and CPU to compress files, but the compression isn’t very much either. Tar is probably the Linux/UNIX version of zip – quick and dirty.

TAR.GZ

This format is my weapon of choice for most compression. It gives very good compression while not utilizing too much of the CPU while it is compressing the data.

Demonstration
  • TAR
    • compress a directory:
# tar -cvf archive_name.tar directory_to_compress
  • extract the archive:
# tar -xvf archive_name.tar.gz
  • Gzip
    • compress a directory:
# gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] 
  • extract the archive:
# gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] 

unix Objective

structure of UNIX systems

familiarity with the structure of UNIX systems

Definition

The ability to show that one understands and can demonstrate successfully navigating within a Unix based system via command line.

Method

To do this have several lists of directories to create, including sub directories and files to be placed within these directories, all off the users home directory.

Measurement

make a few directories off of your user, some inside of others etc etc until you have around like 15 random directories and put some files in some. Once this is done move to a particular directory and from here navigate to other directories without using a absolute path, have some text file displaying without absolute path etc etc.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do? Pretty easy for the most part so long as people have familiarity with command line and navigation etc
  • Is there room for improvement? Always room for improvement such as using quotes, wild-cards, tabbing shortcuts etc.
  • Could the measurement process be enhanced to be more effective? If there was a specific set of files, with particular routes to be taken and specific characters used within names that might cause complexity.
  • Do you think this enhancement would be efficient to employ? Yea I also think its apart of the first few lessons and continues throughout the course so far, so as long as someone keeps up on their work they should be good.

Experiments

Experiment "IF or not IF"

Question

What is the use of \n and to what effect does it have if in a simple program designed to print “hello world” if:

1. it exists.

2. it does not.

Resources

created a simple program that says “hello world”

1.

#include <stdio.h>
 
void main()
{
  if(printf("Hello World\n"))
}

2.

#include <stdio.h>
 
void main()
{
  if(printf("Hello World"))
}

Hypothesis

Based on what I know the function of /n is, to tell the program next line, I think it either will not compile, or it will not display “hello world” on its own line creating a new line after execution. State your rationale.

Experiment

As listed in resources I created 2 programs to test one with one without, and plan to run both and record the results.

Data

1.

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!
lab46:~/src$ 

2.

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!lab46:~/src$ 

Analysis

Based on the data collected:

  • was your hypothesis correct? Yes and no, I was not sure if it would compile and it did, but as I suspected if it did, it would print the text without breaking to a new line.
  • was your hypothesis not applicable? yes
  • is there more going on than you originally thought? Not really due to this test was kinda simple, in understanding context of code and its importance to output.

Conclusions

Based on the data collected, It is obvious the use, and results of having /n in program syntax, where as if it does not exist what will happen.

WSUS Server No Active directory

Question

Is It possible to have a domain-less, no active directory server OS that is capable of updating windows client machines, via client redirected to server.

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on everything I have read and come accross this is a viable method of deployment and for particular scenarios more recommended. Though a little more complicated in deploying, the ease of use without a central server to have to log into is more applicable to smaller client based enviorments.

State your rationale.

Experiment

Based on my findings, I plan to do the required aspects of fulfilling desired outcome.

-Edit/create registry entries corresponding with directing windows to the server for updates rather than Microsoft.
-Create a valid certificate, allowing for the client to validate itself to the servers SSL.

Data

Currently I am stuck at getting the actual client machine to stop looking for its updates via Microsoft. I have disabled, re-enabled, wuauclt.exe /detectnow. All over required aspects, apparently I missed something so further testing on this is required, but hopefully the desired outcome is true.

Analysis

Based on the data collected:

  • was your hypothesis correct? pending (UPDATE) So far it is working but the server/client relationship is denied, as I expected, I may need to create some sort of certificate for self certifying access.
  • was your hypothesis not applicable?
  • is there more going on than you originally thought? Yes and No, its hard to say, yes because its not working currently, and no because its probably a matter of something being over looked.
  • what shortcomings might there be in your experiment? Its not giving a desired result reguardless of information that says it will.
  • what shortcomings might there be in your data? Some data might lack content of something crucial.
  • NOTE One of the registry entries had spaces in the name which was causing it to return with a null entry upon installing.

Conclusions

Conclusion so far is that this is a valid means of creating a windows update server outside of using active directory, but there is still more work needed.

For a continue up I have successfully got my WSUS server to work. It not only works in the domain environment, but i was able to successfully get clients non-existing in the domain to be redirected to the server for updating. The registry I had made was all correct except for one variable had spaces in the name, which was causing a <NULL> problem. Once that was done all I had to do was figure out what was causing the actual verification errors. I can write and explain it so easily its somewhat embarrassing how much time it took to finish, all I had to do was create a self signing certificate on the server to deploy to end users.

Experiment 3

Question

What happens when a “int” is multiplied by a “float” and the output is “float”.

Resources

With what I have gathered and from some of the small projects I have yet to submit I have gathered enough to be able to write and perform this on my own.

Hypothesis

Based on what I have seen when playing with the two var types I either expect it to return the answer that it should be, or the answer will be effected by the fact the two vars are of not the same type.

State your rationale. 1.5 x 2 = 3 1 x 3 = 3 this case 1.5 = float 2 = int and 3 = float or int, so it should work in that it has the ability to output a decimal number still.

Experiment

Going to set up a scenario as follows:

#include <stdio.h> float mult ( int x, int y ); main() {

float x;
int y;
printf( "Please input two numbers to be multiplied: " );
scanf( "%f", &x );
scanf( "%d", &y );
printf( "The product of your two numbers is %f\n", mult( x, y ) );
getchar(); 

} float mult (float x, int y) {

return x * y;

}

I keep having trouble when placing the code statements before and after this small section, and I can't quite see what is doing it, but experiment one is tied into this one when I do it. I don't think I have a unclosed code tag above?

Data

Well nothing of what I had expected happened.

Analysis

Based on the data collected: I had got an error of conflicting types for 'mult', and previous declaration of 'mult' was here.

  • was your hypothesis correct? No, I guess I have to get to understand variables more than I had thought.
  • was your hypothesis not applicable? It would not even compile.
  • is there more going on than you originally thought? Yes and no, I thought since it made logical sense 1.5×2 is 3 that it would be able to execute.

Conclusions

Learning new languages can be annoying when trying to overcome the way we have already been wired to learn.

opus/spring2012/jdavis34/part1.txt · Last modified: 2012/03/06 16:04 by jdavis34