Friday, September 7, 2007
Second Lecture OPS435
OPS435C
Frank C Russo
Directory Structures, in Linux its not much different from many other systems if you want to understand this its easy to remember because its similar to your family structure, parents, grand parents, to your children and grand children
Databases contain information which is located in different directories this is where the directory structure comes from, this starts from root,
Typed cat dir.sir…showed a detailed directory
An example of linux directory structure it starts at the very top with root and under root you can subdirectory and files, and each of these can have their own subdirectories and files, when you address a file or subdirectory you have to tell the system where the data is located, there are two different ways, one is called relative and the other is absolute, absolute addressing from root always, relative starts from where you are Current Working Directory, if you need to use a command you can mix the two, part in realitive part in absolute, there are many instances you must have it in one or the other, if you addressing the /etc/passwd, you can do in relative but it takes to much time be efficient, and since you know where it is you can use absolute addressing to get to this file, any thing that the program creates should be in relative, because if you create a program you don’t know the other persons directory structure this makes all the data go in the right place correctly. You must know when to use what. In our assignments it will become clear, lets make sure how each one works, this is a review we must understand how to access databases,
For instance you want to change the directory from where ever you are to go to your home directory what command do you use? Cd command with no arguments takes you back to directory, if you add a ~ (tild) it takes you home or $HOME it’s the same thing, the shortest command to use is cd, with three simple commands you can navigate to structure,
How would you know what dir you in pwd, the files to list ls
Lets assume your current directory is steve how would you change your directory to steves parent which is usr, type cd .., cd ../.. (grand parent directory) in our case would be root,
Think current address is steve
Relative ..
Absolute /usr
What is the A and R address for math
Relative from usr program/math
Absolute /usr/steve/programs/math
The shell automatically starts from the current directory
Subdirectory data from steve, up one then across
Relative ../john/data
Absolute /usr/john/data
Remember that the command line is case sensitive, with 99% we are going to use we are going to use data from the database, so you have to address data from the database, KNOW REALITIVE AND ABSOLUTE, quiz one will have a lot of both….make sure to review.
Linux system directories, in the Linux strcture there are number of directories these are what they are and what their used for
/bin = holds binary executables
/boot – holds the Linux Kernel
/etc – contais configuration files
/home – the default home directory for users ($HOME)
/lib – contains library files
/mnt – contains mounted drives (can mount structures to other ones or as a part of your own)
/root – the root user’s home directory
/tmp – contains temporary files
/var – contains files that change
/ all encompassing root directory
/root belongs to the user root
These are all in each Linux system
Examples :
Cd brings us to your home with a ~ tild is the exact same thing
~john - brings you to johns home
~/john - brings you to ur home directory to a subdirectory john
The Shell automatically replaces the tild when it does the interpretation of the command to what ever the home directory is, it will replace the variable name with the content which is your own home directory
When you execute any commands the requirements of a command most will require an input of some sort, by the user or system itself, if you do an who, the input to this command is provided by the system itself, it provides an output, theirs an STNINP then STNOUT ….where does STNOUT go it goes to the screen by default STNOUT goes to the screen, unless you direct it somewhere else, STNINP where does it come from…the keyboard
Type
Cat file
Where does STDIN come from…it comes from the file, you have told the command to get the STDINP from the file and STDOUT put comes from the screen,
Cat …with no arguments
It waits for input (keyboard by default), it comes from input Ctrl-D takes you to the next line.
STDIN STDOUT & STDERR
Where does STDERR go to by default…on the screen, so you can see it.
Those are the three things we need to understand.
Special Characters the shell interrupt all special characters
< - Redirect STDIN this is also known a file descriptor, there are three file descriptor
0< STDIN whether you put the zero or not it knows
1> 0 Redirect STDOUT
2> STDERR
Knowing this what would happened if you redirect a file a into c, if you follow the cat command will read the contents of a then go to b then it will produce a STDERR then the STDOUT it will go into the file c you will not see the STDERR and if you execute it you only see the STDERR
Cat a b > c
Error!
Cat a b 2> c
You will see the contents of file a and the error b will go into c and you will find the error in c
What happens if we want to send both,
Cat a b > c 2>&1
Theirs two different way to redirect both STDOUT and STDERR this formation works in every system in every shell, this is standard, 2> redirect STDERR &1 to the same place to STDOUT was redirected, nothing appears on the screen, and if you cat the c file you see both.
Rmdir –r – remove that directory recursively all of them
Permissions, ls –l
Read
Write
Execute
Ls –l
O G N
- RWX RWX RWX
- - File
D – directory
Owner Group Name
Ls –l tells you what group you are in….
For a file you can read, the contents of a directory you can see directories, a directory does not contain files or subdirectory, it contains the names of the files of the subdirectories, when you reading the contents of a directory you are reading the names of the file and subdirectory, so if you have read permission, you can use LS for a directory for a file it would be CAT,
To write into a file you need write permission, when do you need to write into a directory, if you create a new file, you are adding a name to the directory, you are modifying the contents of the file, if you delete a file you are taking the name out for those you need write permission for the directory,
X execute it allows you to execute a file, better be a program or a script, how about a directory can you execute a directory, the X has a different meaning to a directory then from a file, what is this meaning for the X for a directory you are allowed to get into the directory the X is a the key to get into the room, think a closed door, if you do not have a key to open the door you cannot read the file.
X – pass through permission, allows you to go through it
Cat / home /joe /dir /f1
X x x x r -minimum permission for the command to be successful
.
Cp / home /joe /a ., /b
X x x r x w - u need to read to source and write to destination
If it doesn’t exist (b) you need to write permission in the home directory
Cp / home /joe /a? .. /b
X x xr r x w
The moment you put a ? is will read the contents of more then one file so the directory joe must have read permissions in order to read and match the files.
Tips: Look at every directory ONE at a time, any time you are using file name expansions character ? * [] you are asking the shell to match, so the shell has to have read permission to read the contents of directory.
We are going to be using vi so go through vi stuff.
Copy command you must have a minimum of two arguments
Cp a b c d
Copying it into a directory, more then one file you have to copy it into a directory
-I - Interactive, it asks you for each file
The move command mv, same as the copy command
Handout
When the shell interprets it interprets every line and goes through 9 steps each and every time, these are the nine steps the shell goes through….
Know the 9 steps
1. Token Spitting: When the shell looks at the command line breaks it up to each individual word and looks at each one, one at a time…happens with every command line
2. Alias Substitution: Known by many different name, in Linux you can create new commands in Linux you can have a regular command even Ls and give it another alias, when the shell looks at the command it checks to see if it’s a real command or a alias command…greater detail in later Lectures.
3. Tilde Subsitution – Looks for the tild its going to replace it with your home directory
4. Command Subsitution – Greater detail later, you can have one command inside another and into another one, like the algebra you look from the inside out, same thing happends with this process the shell takes a look at the special characters and tells it command substitution,
When we introduce special char jot them down, when you have a command inside backquotes this is command substitution, the shell must execute it first, replace the command with STDOUT of the command, another one is dallor parenthesis is the same thing
‘ banana’
$(banana)
5. Parameter Expansion: The special character for shell variable expansion how does the shell know it’s a variable name and not text…with the dollar sign $var when it replaces the variable name with the contents its done in #5
6. Wildcard Expansion: What character is it looking for examples * ? [] those are the three characters its looking for in this step, when it encounters them it will go to the directory and replace them with the files that it has matched
7. Quote Processing: What characters are quoting characters their single double and the other is a backslash
‘’ (single quote) – in Linux anything inside this does not have any special meaning, no special characters what you see is what you get.
“” (double quote) – same as single quotes with three exception, there are three characters that retain their special meaning in double quote which are $ ‘ \ dollar sign, single quote, and backslash
Try something
a = 1 2 3
To read this echo $a and it will echo the contents 123
Echo “$a” view 123
Echo ‘$a’ view $a
The meaning \ its called a single character quote. Backslash the character following me is not a special character,
Echo \$a view $a - the shell will not interrupt $ as a special character because of the \ (backslash)
\\$a view \123 …. \ makes it so \ is not special following everything executes itself
8. I/O Redirections : STDOUT STDIN STERR, it will do the redirection when found, but when the shell….do this
Sort f1 > f1 - when you do this command before the command is execute the moment it encounters its going to clear the contents of the file then you are sorting Nothing and you redirect nothing into f1. This step is done BEFORE its execute
9. Execution: Command is execute : most of the time the kernel execute the command the only time it doesn’t if those commands are part of the shell a number of commands are apart of the shell, when the shell is in the memory what ever is in the memory you don’t need it to bring into memory then to shell, those get execute in the shell, theirs a list of the command they are 20% of the commands 70% is executed into the kernel.
How does the Kernel know where to find the command, the shell goes to path variable searches through all the directories and searches where the utility is located, execute this command and this is where to find it, the kernel copies the command to the database to the memory goes to the memory then goes back to memory then it goes back to shell and then asks the user what they want to do again.
Second Lecture DCN386
DCN386
Next Question,
What is analog transmission and how does it work? (5 mark essay question)
In the history of communications, two important technologies their was analog at the beginning then their was digital, for week 6 you have to figure out why digital is good and analog is not, in fact analog transmission in Canada is non-existent, its making a come back through fibre-optic technologies, it uses analog.
What does the word analog mean?
Analogous it means that something is the same as, but not identical, visualize is two objects such as two different color markers red and blue, they are analogous, we are going to reinvent the telephone go back 120 years and reinvent the telephone, when people use analog transmission that means they are sending information through a phone company service,
What do you need to invent a telephone?
We need a power source, we need a circuit, we have a power source and a complete circuit of electricity will flow down the circuit,
Drawing of a circular wire with flowing electricity, its 60 ohms per-second, now were going to send the power through the circuit, but we want to modify the wave and change it in such a way to reflect the sounds you make when you talk into the phone, you voice which is a wave of sound is being transmitted through the receiver, how do we do this it is very simple, we are going to have a tiny container, in the container we are going to put a magical compound, a semi-conducting compound Carbon, which is a semi-conducting compound, in between the carbon we are going to put a membrane of some sort, carbon has a magical trick when it is compress it conducts electricity better, membrane is a wire and the sound will be analogous to the sounds that you make, we now have invented a telephone, the theory is as simple as that, at the other end of the circuit, there is a speaker as this goes round it vibrates the cord and you can listen to the sound on the other end.
What does this have to do with datacom….nothing at all, but for the longest period of time in Canada, all computers needed to make sound….modems made the sound for the computer, modems would take data, and change a beautiful even pattern to represent a 1 or 0 bit, that is all modems do, now we are going to invent modems,
If he gave us ten bucks and went to a garage sale u can buy enough equipment to make one,
Modem processes two different sounds 1’s and 0’s the receiving modem knows the differences in the sounds and will re-create 1’s and 0’s and process the information.
Ever see a old fashion volt metre? It is basically a little box connect to a circuit to both sides it swings it will be negative or positive, find one of the devices take it apart and put the arrow thing into a shoe box, you attach the voltmeter to the serial port to your personal computer, the same that you stuck your port into, to talk to another computer…..how does the computer send it out to the box….analog or digital?….digital of course, even when data is being send over the serial port, drawn 0100001, carry an ASCII chart with you, show your ASCII chart to everyone!, that binary was an A key theirs a special interrupt called INT14 and it will send the process through the cable in a series of pulses, in pulses some are positive and some are negative, back to our arrow, are little arrow goes up and down when transmitting data, we invented a modem with a wire attached to a bell at the other side, when the pulses go through the wire it will hit the bell on the other side and it will make thebell Ding Dong representing 1 0 1 0 1 0, all you have to do is invent a device on the other end to read the 10101’s and re-creates to make the sounds, modems create sounds, the sounds are interrupted by other modems…digital data that is re-created….modems……remember the noise when you got the number wrong, and the operator was in ur modem….i tripped out to that lol YO THEIRS A VOICE IN MY MODEM….picked up the phone…couldn’t connect to battle.net
The first modem was the Bell 102 , Miracle new technology, first modem beautiful thing it ran at 300bps, how many characters could it send in a minute? Before we talk about how this works we are going to talk about
Analog telephones, for years telephone engineers studied people normal conversational sounds, they realized human beings can make very low sounds, some people have high voice, but for ordinary conversation it was discovered if you have a frequency range…what does that mean….low and high waves, the lower the frequency the further you can send the signal, the higher the shorter the distance you can send it without being amplified.
200hz and 3400hz is a standard range sound can travel at a distance, your LAN phone filters out everything 4000hz, hertz, Who was the inventor Dead German Guy, created the cycles per second which are hertz.
How can you prove that the lower the frequency the further the higher the shorter?
He drew a wave with a whale under it, can a whale can swim 100 kilo at 100 hrs because it has very low frequency, if you have a sparrow if you immerse him into the sea water the sparrow will not be able to swim because it has a high frequency sound, when you talk all sound you see it in that range…
Modems learned how to make sound between this range, and they operated in the telephone network, modems work by a simple process, first when they talk to other modems they both send down a carrier wave, this is a very fixed amplitude ,fixed frequency, it will be modified to represent 1’s and 0’s how many ways can you modify a wave, how many can you do this,
How many ways can you change it?
You can change its amplitude, you can increase or decrease the voltage which is basically called its amplitude, another way you can change it is some instance in time radically changes the frequency this is called frequency change,
If it wanted to change the amplitude it would have to have different amplitude levels, theirs an increase of voltage to send bits, all modems have used frequency and amplitude , modern modems use phase change,
We have to understand amplitude, frequency and phase changing,
We went back to the 200hz 3400hz restrictions sound can travel on a telephone line we sent down 300hz, because it went down 300hz it achieved 300bps, modems like computers, their has been pressure on the line, just on computer manufacture and producing its products, the pressure has been to make modems faster, that has been the challenge for the 45-50 years, given the primitive technology how could you double the speed,
Why is it called a bell modem, when he was a kid and datacom was being invented no one made modem except bell, when you order a analog for data, a bell modem came, so how do we get from 300 to 600 bits for second, simple you send the a carrier wave 600hz, u have 600hz, and 1200hz, the oldest modem went to 56000bps how is this possible that has a maximum carrier wave of 3400hz max,
How is this possible?
With our primitive concept of only two different changes, someone wanted to develop a 24000bps came up with a place to send 2 bits every time the carrier wave was changed, 24000bps modem (drawn) inside the modem their was a buffer, a memory stick very small, the modems receiving is not sending them immediately, 01000010 (represents b). In the modems memory the modem it is going to analyze the character and break it into two bit pieces, now two bits can only be arranged four different ways, which means our new technology modem is going to need four different ways, its going to analyze the frequency it knows what the carrier frequency is, it is going have the ability to send it depending the two bits see how easy it is we are going to keep to 1200 hertz, every time we change it we are going to send two bits which is 24000bits per-second, now we need a 48000bps modem, this actually happen someone increased the frequency to 16000hz and send 3 bits, if you have 3 bits how many frequencies would you need, f8 we would need eight different frequency, carrier wave 16000 hertz every time we send it represents 3 bits, we got ourselves up to 48000 bits per-second, now we need a 9600 bits per-second we are going to send 3bits increase the frequency 48000 hertz send 4 bits , if you have four bits how many different ways can you send the data, this is where technology hit to the wall, 16 frequencies traveling down the line became very difficult, not understandable through the transmission, their was a new way, modern70% of the poor people in the world are using modem, and that technology has a limit, quadrature amplitude multitude, QAM for short, it applied a very unique method for modifying carrier method, uses two completely different attempts simultaneously they do phase changing, (know -amplitude frequency and phase changing,,) a normal wave through a line and what if the information went half round stopped and went around again, it would be very unique or it could do a change at 180 you can tell the difference, or it can do a change 280, or now not change at all, we have four different phase changes so we simply make up a rule, look at the 8 bits of the modem and analyze each 4 bits, for the first four bits from the right we are going to do a phase change for 90 degrees and we are going to do a phase change to 90 degrees to increase, and we are going to 90 degrees and leave the amplitude alone, we are going to do a phase change 180 we have four different phase changes with two different amplitudes, giving him, we have the ability 4 bits using QAM, this gives us max of 96000’s bps, QAM is used by the way using to fibre-optics,
What was the best modem ever invented?
56kb was not a true modem….Explain Why?
The last great true modem was the V34 modem a pure modem it was the modem that pushed to the limit of the carrier wave, the CW was 3400 hertz, but it could send every time it changed a CW, how many bits does it need to change the carrier wave, 256 different way’s to change the carrier wave, go into and type V34 specification the last true modem, how intelligent was it, it was very intelligent, once connect 3400 maximum, if the smart little V34 modem was getting a lot of errors it would send the a signal to the other modem and cut down the CW 2400, 1600, 1000…..Errors, 50% datacom studies 50% of the deal is the detection and handling of data errors, 50% is involved how does it detect errors….
The Bank Machine, what if you asked for $100 and their was a few bit errors, computers can not tolerate 1 bit, this is a catastrophe, just one bit.
BREAK
What’s Question 3,
What is digital technology and how does it work? Essay!
What does it mean to digitize something?
When you digitize you are turning something into a number.
The technology we are going to talk about its going to be a binary number, all it is, is turning information into numbers, before 1980, phone companies around the world started replacing analog technology with digital technology, 1980 Bell Canada Banner 100% Digital, in their backbone network its 100% percent digital, the phone from your hose to the bell office is analog, we are be talking about digital for the rest of the course for the next 13 weeks
A simple question…
When you talk on your telephone and it does to the Bell office it turns ur voice into numbers
How does it do this, some device turns ur voice into number, from your house theirs a telephone cable that goes under ground to the closest Bell telephone office connected to a computer a special process computer, it directs your phone call, and turn you voice into boring binary numbers how are you going ti invent digital technology, at the end of the line, think voltmeter it is going to listen to the sounds and the volt meter will pass info to a microchip, its only about $15 bucks, technology is deceptively simple, here what the phone companies did before 1980, they started looking at this at the 1940’s and not complete until the 80’s,
Story of Shannon, knew mathematics, turned his mind on this question, if you want to send digital representation on human voice how many bits per second will it take to represent a human voice, Shannon law was very simple , drawing of a sound wave, long wave, the volts meter will take sample readings, 0.1 Volt 0.2 Volt, 5 Volts, all are sample and each time its getting a number their number Decimal Numbers, the volt metre passes the values to micro chip and it is converted to an 8bit binary number, it becomes a next sample 2.0 volts. How can u represent minuet, the first bit of an 8 bit sample represents –negative or +plus value, these numbers get transmitted through a series of pulses through copper wire, the trick Shannon realized, how many sample per second should you take, so that the voice at the other end sound legible, the Sample Rate, what was it that he came up with, remember the sample wave 4000hertz, the sample rate should be twice the maximum rate 8000 samples per second each sample results in an 8 bit value which means data is travelling down the line, each sample is 8 bits, their for when talking you are talking to someone it is 64000bps, precision is vital in digital technology, this is how it works the tricky part, we are not going to far about today, digital technology is not simple as pulses there is many ways but we will look at 6 ways from this course,
stressing telephone companies around the world, in the middle (Company to you is seen as digital to analog….analog to digital is seen as you to the phone company)
The physical circuit between phone companies T1 circuit…..what does that mean what is a T1….it is a standard in North America called Multiplexing …means putting numerous signals up on 1 wire, very simple, next week, in Canada each T1 circuit can handle 24 simultaneous voice conversation, 24x64,000bps (digital signals)
The really important issue, by week 6 he wants a nice statement to this questions….
Why digital is good and why is analog is not?
Why did the world go digital?
Why do signal diminish?….all electronic signals diminish all signals, because this happens in fibre-optics all signals suffer from the same fact of nature they must come to an end, this is attenuation, which is unavailable, only way to combat this is to send you wire to 0 degrees Calvin, attenuation happens, now ask yourself how can you talk to your girlfriend in Vancouver every 15 cables bell has installed is Amplified, taking a diminishing signal and creates new signals, the trouble with this technique, but we want computer to send data to Vancouver which is a different problem, attenuation is avoidable, but there are several things we call them Noise, the worse culprit is fluorescent light, we place one of these lights to phone line they give of electro magnetic field and when placed near a phone line you get crackles on the line, now when someone is on the phone and you hear crackles a computer cant tell if its happening, here is the worse part amplifiers don’t know the difference either so an amplify the signal will amplify the crack and fluorescent is one way, solar flares introducing the crackles, bit errors worse thing in the universe next to windows,
Digital signals are getting attenuation which happens to digital signal, we are going to run a digital line through the fluorescent line and get crackles, but here is the answer
Why digital good?
When digital technology is introduced, phone companies did not install plain simple amplifiers, they used Repeaters, a repeaters is very different then a amplifiers it looks at the pulse can see if its decayed and makes a brand new decayed pulse Positive or Negative and if it doesn’t know what it is it will filter it out, efficient, making you signal clean and free!
Why 56kbps Not a true modem?
If your ISP still have analog transmission between the isp and the closest bell office the 56kb will not go over something……if your isp puts in a digital service such as a t1 circuit between the isp and the bell office and you install a V90 modem 56000bps at ur house and you put it on a analog line, ur isp is a digital service, analog to digital the technology for doing this is inpercise, analog digital conversion introduces problems, not a perfect technology yet, when you turn on ur V90 modem it realizes its on an analog circuit the modem degrades it self and become a V34 36000bps, when you turn on the other modem and it sees its on a digital it will continue to run at maximum 56000bps it will send 56000bps and you modem at you end will go 28000s, now if you wanted it both ways you have to phone bell telephone and disconnect the circuit and reconnect a digital home service, which will mean it will have to install a new cable and you willge ta service to ISDN, its over priced and will solve your modem problem.
How do you get ready for week 6 you go on google words like
Analog Transmission – Compliment QAM how
Digital Transmission
Digital Good Analog Bad
Thursday, September 6, 2007
First Lecture DCN386
Test on week 6 another test on week 10, a lot of lab marks in the cisco room, configure and take out of a router, data communication is career, mainframe computers start from big to small personal computer, the story of a purchasing through cash register, if you buy something a message is sent to the main computer of the company so it says that you have purchased the item. Banks to mainframe computers to lottery ticket machines all these are examples of DTE DATA TERMINAL EQUIPMENT, Sending data is through the NIC card, another way for this is a MODEM 70% of the world use modems, multiplexors MUX for short, there is a collective term for these devices they are called DCE Data Communication Equipment, these are sepretate devices made by different people, How do they connect together they use Standards, last semester for the cables and wireless we called them the communication medium, an example of this would be copper wire, fiber optics, wireless
Can you send data through a vacuume?
Rules for any DTE to DCE we call the rules interfaces, theirs are hundreds of interfaces and we will only learn a couple, again this is standardized, think in terms of data communication protocols, we are going to learnining detailed understanding of the protocols what they do and how does it work?
What is token ring?
It is a older technology, Developed by IBM first but not only LAN technology, complex hard to install, its obsolete now, Zerox brilliant that invented a ton of stuff like mice, windows, taken by Microsoft and apple, the most important thing they created was an Ethernet Network Interface Card, companies have Ethernet, they couldn’t intercommunicate with each other because u couldn’t intercommunicate until standards took over, the group that standardized Local Area Network identify four standards orgnization and tell me them, the first standard organization is the IEEE, started a project in 1980 the 802 family of standards and have been working for LAN ever since, first thing they did was create a standard protocol 802.2, they modified slightly Ethernet 802.3 and token 802.5, wireless 802.11.
IEEE student member,
Another standard group ITU this is a telecommunications union, get countries network to internet with each other, they have standards for everything, TIA-586A or B created provide contractors with a standard way to build networks, we will be talking about later in this course. IETF never invented a standard but a lot of protocols were made by this ogroup, this job is to listen to comments, you may write memos, HYPER TEXT a way of linking sites, www….changed the world, he set his idea on paper and it was tested by IETF and changed the world. Go to the website and look for the request for comments RFC.
First Lecture OPS435
Linux and Unix
We will be able to write scripts and programs in any Linux Shell, to understand how shell scripts and how they work we will be looking at the basics of the shell, oc and grep to search in databases.
The
Kron shell reference - isbn 0-916151-72-7
VI Reference Card, SSC Inc., ISBN: 1-57831-0 05-9
and the bash shell are very similar if you know one you know the other.
We are expected to go through the slides know and understand what it is about because it will be on the quizzes and the test.
A little bit a of Review of what we know about Linux and Unix,
What happens when you start the computer, everything is does it is told, basically you do, minute instructions on what to do before the computer could do anything, when you turn it on the volatile memory contains nothing,
How does the computer know what to do when you turn it on?
It’s a combination of hardware and software, when you turn it on it has to check the everything within the system. The BIOS the program that loads everything into the computer, BIOS is a program it’s a chip which contains the program which is always their, when you turn it on it starts telling the hardware things to do, when it finishes doing that the BIOS passes control to another program, the very first sector of the very first cylinder of the first drive the Master Boot Record, it has 3 sections the first 2bytes are the signature, other wise when the system looks at the MBR it looks at the sector to see if its that data, and the signature will identify this, the other section, 4 max primary partitions, 16 bytes information is provided to the partition, which is 4x16 is 64 bytes which is referred to the partition table, those 64 bytes tell exactly how the database is partitions, how big where to start and all that, 446 is the third and its 512 all together, the last part is the program that tells the computer what to do, this makes use of some data where the loader is located, otherwise where the operating system is actually located, after it is done it will pass control to the boot loader,
Program Partition
Bootloader
After you initiate the bootlaoder it boots into the operating system, its below the spindles, another thing we should know, the processor can only execute instructions from the memory you can never have data go directly to the processor, memory to processor first, once we start booting the operating system otherwise known as the kernel in Linux, once it is loaded in memory then it goes into the processor, then the processor starts running the operating system, once it starts running, theirs a particular utility the first utility initiates all the other utilities, this is called the INIT every command that is dropped into memory to be in the processor there is a PID number and the first one is obviously PID01, this utility will load all utilities you need, print, telnet, everything loaded by the INIT utilities, one of that that is loaded by INIT is called the Getty, any time you see to tty you are referring to terminals, the
Getty utility - almost like a radar that scans all the terminals all the time , it is looking for if anyone is trying to use the terminal, system, as soon as it detects this it allows them to type in,
ex: user name and password you hit the return immediately
At that point the getty utility will pass control to another utility, called the
Logon utility - this utility does the checking you are who you say you are and you have an account on the system this will check into /etc/passwd which contains all the user names and check the password in /etc/shadow.
After the login it goes to the shell, now the shell is brought into the memory which is given a pid number and it starts running, once it starts running, that when you see the cursor on the screen when it produces the cursor on the screen it is ready to do what you want it to do, and the shell will actually take your command and before it runs it, it will interpret you command, (kernel executes the commands), the shell is learn the C language, the language were learning the Shell, you don’t need to know the Kernel, the language we need to know is the Shell language and what it does is it interprets what you type into the terminal and what the kernel understands its an interpreter, once of the advantages of the shell, it automatically interrupts anything you put in, it will interpret a line when it went in, you can actually read what the programmer wrote, the shell does the interpretation itself, it very important to understand the fact that when you execute a program or any command from the terminal the shell will interpret anything you write, the shell interprets EVERY COMMAND before its executed, it is looking for special characters and has a meaning, when you look at a command you should be able to interpret the commands in exactly the same way on how the shell interprets it. How to program and special characters and how exactly it interprets and some other features. Once it starts running, the shell will go through NINE steps, for every command it goes through NINE steps in a sequence and in each step looking for something specific, when its finished with the NINE steps it will then execute the command and will tell the kernel, this is the interpreted version of the command and the kernel will actually execute the command.
Here is an example of interpretation….
Ls a
This is what is typed in the command line, what is passed in the kernel looks like the exact same thing, because their was no special characters that the shell had to interpret,
Ls a??
The shell takes a look at the command, and it will search to match any files and will find 3 characters that must start with an A, We assumed it found ABC and a23, what is the interpreted version of this command, it will replace the >?< token with BC 23 this is the actual command that is passed=
Ls ABC A23
Copied into the memory then given a pid then executed and run by the processor, the kernel goes and looks for these two files and list the names, SHELL all interpretation.
He lying a little bit because the shell does actually run commands, but they are part of the shell and in memory and can be executed directly, but most of the commands must go through memory and go the kernel to execute.
Shell understands & interprets
Special characters we know about,
• ? --
• ---it says to shell zero or more of any character 0 >
• [ ….] -- 1-3or5square bracket one character, list of character inside the bracket > *?, < loose their special meaning. ! is not.
Understand the ? * ! []
More Examples:
Sort ?[!0-9,a-z]?[A-z]*
We are going to sort a number of files, and the number of files are going to match in that particular directory, it will be finding four or more characters.
First character is the name of any character
Second cannot be a number comma or a lower case letters
Third can be anything
Fourth it can be any letter to capital to lower case A LETTER
Fifth
^ this called file name expansion which the shell does all the time
All capitals are first then small, you can say 1-9 and not 9-1 goes through sequential sequence.
Variables to store data, global or shell variables that are assigned to every user, you are assigned those variables immediately, all shell variables have capital letters, that is one type of variable, another variable it a locally created variable, one u create.
BASH is the name of the shell you are using, and you look at the etc password file and locate the account on their the last item of the line you will see what shell if assigned to you, in matrix the BASH shell is the default shell that is assigned to all users, BASH=/bin/bash is exactly where it is located, var = variable .
What is the path variable used for, the kernel doesn’t know where the utility on the database it is relying on the shell where it is to execute and where it is located on the database it will go and search this particular variable for where its located, it goes into the PATH=/home/unx122/bin: colon is delimiter between directories, it will pass the directory name to the command. The PATH uses it to search where the command where it is located.
You prompt is located in PS1 this is what it looks like, tty =terminal, terminal logged is pts/4 and pts is via the communication network. If its tty/4 then its direct.
See the commands its going to be echo $variable, the $ says the following text is a name of a variable, the text following the dollar sign is the name of the variable when the shell looks atr this what it will do to interpret this it will go an replace the name of the variable with the contents of the variable, the shell interprets the command and comes up with a difference command.
The shell interprets $SHELL to $/bin/bash replacing the name of the variable with the contents of the variable.
You have to have the current directory in ur path or u cant run the program.
/etc/profile
Cal with no arguments tells you current month calander
If not sure use MAN cal [ ]option
The cat command comes from an old English word called concatenate means to join together
First Lecture DAT702
DAT702 First Lecture
September 4, 2007
D group
INT213 we end up to a bit of a webpage to a database a webpage talking to databases and will connect to mysql, you will need to have.
We need a hard drive which is about 4gig of space
Mysql is on the internal machine Password mysql
We are going to get in to activities; Bin is the directory, in which we will be using all the time,
Mysql> \T doppy96.txt
All this is done so after every key stroke is logged
Two data bases u don’t touch info-schema and mysql, do not touch this.
Tell my sql what database to use, after we have created the database Harvey, you will have to type use harvey
Int – interger
Decimal
Varchar
We typed create table allan(mary int, sam varchar(30));
Oracale is case sensitive
Two fields Mary Int Sam is VarChar
Describe allan; which describes what we have just created
We close the log file by /t
Into the command prompt to load the database and browsed to the bin file this is to make or load backup files
Mysql – hlocalhost – uroot – pfrank banana > backupname.sqbac <---load
Mysqldump – hlocalhost – uroot – pfrank banana
DAT702 Second Lecture
Lab01
This is the concept of using MySql
Databases are series of data and quote “connected”. The easiest ways to visualize this is imagine three tables with headings of student, grades, courses, and there is a fields under each heading, student number is a unique, the stunum is the primary key unique and exist only once in the table, every thing below this primary key there is one record, you are one line and in one table only... WHY? Because if you want to update you want to update one table only, in order to build the school he has to build courses, theirs a primary key Code, grades is another field , stunnum primary key is linked to a foreign key Stunum in grades table, this saves you from being an idiot, what the link is saying you cannot put a student number in a foreign key constraint their must be a record in the students number this stops you from making stupid errors, the same thing goes for courses it will not put a code unless the record is in their. When creating a table and you connect it and you do not click Enforce the line does not do anything,
Don’t put spaces in you field names.
The most dangerous thing in a data base is an empty field.
SQLYOG
First Lecture WIN310
WIN310 Fist Lecture
AD spending more time.
Today we will be covering IP addressing and subnetting, when we talk about tcp/ip we are talking about protocol that has been around for maybe 30 years and is the default protocol of the big network the web, we use the tcp/ip protocol this allows us to access resources and is on every platform, this is the same to where you are in the work….this is a standard. We are going to learn how tcp/ip works, we are going to learn the addressing scheme, every computer sending data throughout the network must have a unique id, it’s a unique address think you bloods DNA, if two computers have the same ip address and they are on the same network or subnet both computers will be down, think standards IEEE.
What is tcp/ip addressing?
This is a convention address of 32 bits, about 4 billion addresses, we are running out of address and are soon going to switch to IPV6. To subnet into 4 octets , each octet has a range of 8 bits in each octet coming to 32 bits. A part of the subnet will be assigned to the network address and the other to the post address, the network address is your area code, and the post address is the other number, Network and Host, 32 bits basically is infact today’s protocols that we use, but we will be moving to IPV6 very soon, IPV4 32, IPV6 128 bits its alphanumeric, its E128, the two protocols are compatible, and it is relative and very imperative, essential to have both protocols, imagine the millions of DNS servers and Host Servers, it needs to be upgraded to go to the versions, the two are compatible,
The 32 bits are divided into 5 different classes
Ip Classes: R N H
A - (N)(H)(H)(H) 1-126 126 16777216
B – (N)(N)(H)(H) 128-191 16384 65534
C – (N)(N)(N)(H) 192-223 2097152 254
D – Multi Cast Purposes 224-239
E – Is Experimental 240-255
Network Address C
Host Address A
127 is a class but is reserved for diagnostic purposes, basically a loop back.
Will not accept 224
Ask yourself why we have these class…identifies the network and its content, we said earilier that 32 bits the portion is Network the other is the Host Address,
Each number corresponds to a size, DO SUBNETTING ~MATH~
125.1.1.7
01111101.00000001.00000001.00000111
To get this the programmers have taken the highest octet and
8.8.8.8
This is what they have done to come up how many networks for the subnet they have taken the first bit of the octet and marked it with zero for class A
If we have 7 bits we have 2^7-2 = 126bits
If we have 14 bits we have 2^14 -2 =16384
If we have 21 bits we have 2^21-2 = 2097152
1111111._._._
A 0111111._._._
B 10111111._._._
C 11011111._._._
Every IP address must have the Subnet Mask is the piece that isolates the network from the host, there are three different masks
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0
10.0.0.08
190.0.0.016
199.0.0.024
The bits are masked from the address ex: 8 bits are masked from the 10.0.0.0 address.
You can borrow from the hosts you will be able to subnet,
24.0.0.08
255.0.0.0
24.11111111.11111111.11111111