User Tools

Site Tools


blog:spring2016:kdarling:journal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blog:spring2016:kdarling:journal [2016/01/18 21:05] – external edit 127.0.0.1blog:spring2016:kdarling:journal [2016/03/17 15:22] (current) – [January-Feb, ALL, 2016] kdarling
Line 1: Line 1:
  
 ======Systems Programming Journal====== ======Systems Programming Journal======
-====MONTH DayYEAR====+====January-FebALL, 2016====
  
-This is a sample format for a dated entry. Please substitute the actual date for "Month Day, Year", and duplicate the level 4 heading to make additional entries.+For the entire month of Januarywe covered the idea of using the manual pages efficiently by using more includes and understanding the unistd.h include.
  
-As an aid, feel free to use the following questions to help you generate content for your entries:+Other cool new features that we have learned by using the Linux Manual pages on C and other cool C functions was the stat struct and I believe the group struct.
  
-  * What action or concept of significance, as related to the coursedid you experience on this date? +The stat struct contains many useful functions such as it helped in the chmod project in setting file permissions.  
-  * Why was this significant? +In order to setup the stat struct and obtain all it's membersan allocation must take place in order for it to properly work. To do so simply state,
-  * What concepts are you dealing with that may not make perfect sense? +
-  * What challenges are you facing with respect to the course?+
  
 +struct stat *name = (struct stat*) malloc(sizeof(struct stat));
  
 +WALLA! You have obtained all of stat's secret's including the st_mode which helps set file permissions, for example
 +
 +name -> st_mode = 0777;
 +
 +int chmod(FILE_NAME(I used argv[1], name -> st_mode); 
 +
 +BAM! Permissions have been set.
 +
 +Inside group it gets a little... Strange.
 +
 +Using name's st_gid, we can set that to groups, another struct so malloc up bois.
 +
 +groups = getgrgid(name -> st_gid); Then now you have access to usernames and unsecured passwords that someone hasn't taken care of, scary stuff.
 +
 +Overall we have covered
 +
 +cat.c
 +ls.c
 +who.c
 +and our very own chmod.c for those who did it and attempted it. Other cool features will be listed later inside the blog.
 +
 +====March, 2016====
 +Currently in March, we have playing more with primes and utilizing primefork, primethread, and currently we are playing with different types of network interfaces.
 +
 +PrimeFork.c
 +
 +Contain(s) 
 +Primebrutefork.c
 +Primesqrtfork.c
 +
 +Primebrute utilizes our brute force method of accessing each individual number from 2 to the max number specified for that range.
 +
 +Primesqrt utilizes our square root approach and lowers the number it has to search for in order to determine if it's prime.
 +
 +The fork uses a process of quite literally multiplying the program itself but then the program has a check statement to make sure that the program multiplied is either the true parent or a child/forked process.
 +
 +
 +
 +PrimeThread
 +Contain(s)
 +Primebrutethread.c
 +Primesqrtthread.c
 +
 +Primebrutethread again uses the brute force method but instead of multiplying the process and causing a ton of memory over head, instead we actually just enact a small void statement that loops until it's finished.
 +
 +Like our friend fork, the thread divides up the number by using the threads given to it but like I said, it doesn't multiply the program. Instead of cloning the program, it runs a small statement that the pthread asks for.
 +
 +Basically Thread -> void statement to run.
 +
 +The Primebrutethread does our traditional brute force method but with divided numbers and smaller memory allocation.
 +
 +Primesqrthread.c does the same thing as the Primesqrtfork.c but with less memory overhead.
 +
 +
 +Sockets
 +Next we have been playing with sockets and created two network like programs.
 +
 +The first is timeserv.c that when you use your client/telnet into the timeserv port that's reserved, it will tell you the time and disconnect you from the server.
 +
 +The second is ipaddr which returns to the user different network interfaces and the ip associated with them.
blog/spring2016/kdarling/journal.1453151141.txt.gz · Last modified: 2016/02/11 15:59 (external edit)