User Tools

Site Tools


blog:spring2016:jgilber6:start

Jason's Blog

Introduction

UNIX/Linux Fundamentals Journal

January, 21st 2016

On this day I cloned/configured hg mercurial in lab46. Also learned how to look at current running processes ala task manager like windows due to my browser freezing. It was important to get the repository up so that I have the ability to clone, share and go back (in theory?). Currently I am not sure if, when or how to remotely get into lab46 though I have an idea of how'd it would work but unsure if its setup to allow. Currently I am sort of dreading getting into what I am assuming is Unix/Linux. I use OSX which is baby-unix I suppose but actually decided against Linux this year when looking at a possible OS change, though I use mostly Windows cause my Macbook is terribly outdated (perfect for a non-resource heavy distro riiight). Also I am guessing from the hint of “the best” text editor we're going to be using vi or vim which I'm interested in due to kind of deciding against it for emacs.

January, 22nd 2016

I was able to SSH in to Lab46 from my Macbook, I am not sure why I assumed it would be any harder than it was.

February 1st, 2016

I begin the vimtutor to begin to use vim. Seemed odd at first but makes sense later. Using ':' to enter commands that are often a couple characters is smart. Being able to delete words, lines, or certain number of words or lines using the hjkl “arrow” keys and combinations of Ctrl and other modifiers or “motions” makes text editing any other way seem slow and seemingly not thought out well.

Also began (actually in class) the scrambling or descrambling of the image, I have an idea of what it I believe it to be. Getting the files open and such was not really a problem. I find myself often typing 'ls' instead of 'dir' in windows though this works out for OSX.

February 8th, 2016

Learned more about how Unix systems work, how the files are protected and enabled for certain things such as reading, writing etc.

Also learned that a directory is really a file that points to where other directories or files are. Learned how to use pipes and stdout stdin to get files and programs to work in conjunction or expand what they could normally do outside of their “interface.”

I have been using vim tutor to learn how to use vim and recently started using emacs as well. honestly I prefer emacs so far though I've only just started. I like using ctrl and alt to do most things. We'll see in time how I feel.

Finished the project with horse, it wasn't terribly hard and as long as you were paying attention it was rather simple to get things to go where you needed. More so the “workflow” you had probably had a bigger difference on how things came about. Mason managed to save and overwrite his files by not paying attention or not remembering. An easy mistake to make but I imagine if the workflow was better we both would not have made that mistake (though I didn't admit it…until now).

I find vim to already make more sense in my opinion than normal text editors but I appreciate the ease and accessibility something like Microsoft Word offers. Certain things obviously like the integration of graphs and the AMAZING reference/bibliography tool really stands out as features I think I'd miss. With that said I do believe…emacs offers a lot of customization in that regard I think being able to use lisp and do certain things I can't remember. I know most of those are add ons that integrate with the main text editor but aren't normally a part of it.

So far Unix has been interesting but I won't lie and say I'm jumping on the Unix bandwagon cause I understand why GUI's really took off. With that said yes there comes the “coolness” of working with in a terminal environment and of course the strong ability to do things you otherwise couldn't do in most operating systems except maybe OS X using bash terminal shell.

Also learned about some basic scripting though we do not go into to much detail but it seems rather simple but powerful. I also learned of the general structure of the file system in terms of bin/lib/etc etc. and why you might find this or that in what directory. Also started the newer project the puzzle block it doesn't seem to difficult but who knows I might just be arrogant. Also learned about the idea of security while knowing its not really “secure” forever, we talked of how a little bit a go things we'd consider not secure at all were at one point “secure.”

I also learned of how to be able to “write” to another computer if they have certain settings enabled or not enabled. Specifically “mesg.” On top of that we learned of “less is more,” I had encountered this before on my Macbook when messing around the directories.

February 22, 2016

This week we learned more about the power of vi or vim. Learning how to input files into it and change them, saving and quitting. Also how to easily change lines, delete lines, number lines and overall manipulate text files with only the keyboard and no mouse or gui. Vim is becoming easier to use of course though I feel emacs and the reliance on ctrl-alt and what not are easier to remember.

Also began and finished over break the pbx1 or Puzzle Box…one, project. This was an interesting “challenge,” and hopefully in quotes I will not regret it. It becomes “easy” once you realize the majority of what needs to be done is mostly reading. Being able to read and understand the documentation and how to use it plus using google when needed. Knowing the syntax and what commands or programs to use and run on which files. Admittedly it is much easier to do certain things in Unix. I can see now why you would want to just take advantage of Unix or Linux for database/server type stuff. Being able to easily “pipe,” and use stdin and stdout to get certain things to interact with other things is fast and relatively easy.

Not using these things the right way can have unfortunate (for my directory) results. Such as the three files that are literally named in hex numbers with spaces. Fortunately if used the right way it can be very fast and easily change things around. Also I suppose in that respect of Unix and Linux, GNU Linux can more readily be used I suppose for larger companies because the lack of a licensing fee than say Windows Server.

This was also the first time using chmod. Chmod allows you to change the permissions of a file directly which is somewhat different or rather somewhat obfuscated in windows. If I recall windows its a blanket you can do this or cannot though you can make directories accessible. I believe otherwise files themselves require either using the gui or another program to lock out from individual users. Using Chmod you needed to change the permissions of a certain file to even be able to “cat” it. Once done however you could do as you please, as long as you correctly changed it to what you needed.

With the Puzzle Box 1 I often had a bad habit of using stdin and stdout incorrectly or rather getting unexpected results. The majority of problems stemmed from not remembering what appended and what simply stuck it all in. This ended up in a couple of unexpected empty files where I thought I had done something wrong. I had done something wrong but the wrong that I had done was not the wrong had thought I had done. I eventually just made backups and more closely read the documentation and the difference of «, », <, >, so as to not make the same mistake again, and again.

We've really been going hard in the paint on vi and vim but I do hope we eventually get to emacs or rather maybe look more into the different customizations or scripts that can be run from vim or emacs. This is probably what I most want to know about simply because it seems pretty interesting and conveniently to have Lisp ability. I've seen where one half of the screen is coding, one half split into two has Lisp scripting and then unit testing below happening in real time.

We also have spoken in class somewhat about the mystique and wonder of the black screen and the history of terminal screens. The green on black and how it holds a certain quality in the general populaces mind what it is you're doing. I recently found a website called HackerTyper. This website replicates the non-sensical “fast typing” with things happening on screen that is depicted as “hacking” or “coding” or just “browsing the internet,” (Internet Explorer with a keyboard?). So I suppose if you are really craving attention you could just throw this up and start mashing keys and people will think you are doing something really important or maybe illegal cause green text on black screen, plus its technically “code” syntax (spooky).

March 7th, 2016

March 14th, 2016

We learned about scripting and ran and wrote some simple scripts. The scripts generally acted a lot like code but scripting is a interpreted language so it tends to be some what different in a lot of ways.

One of the scripts involved a simple game that could take input and did output. Also making the script smaller or more efficient. The syntax is different from a lot of languages and in comparison to say…Python seems rather archaic but does its job. The advantage I suppose being on a Unix/Linux system is that you can pipe/stdin/out right from the console or terminal.

We also had a project to do that involved changing .whatever files or rather the hidden files that are in the home users directory. Making the changes should suit you and as such I didn't change much. I ended up changing Vim to be a bit more friendly to coding. I also changed the 'fwvm' or window manager that is seemingly the default on Linux or comes bundled with the GNU Linux. I am missing buttons now so I am not sure what I did. However I did change my cursor and it opens up three terminals separated as they should be instead of two. I also made some minor changes so I can use 'aliases' instead of constantly typing out things like home directory or my unix project directory.

March 21st, 2016

We learned to use bash scripting a bit more. Learned about expressions and how they work differently depending on context.

Completed the Udr0 project. Learned to use DD to skip and count bytes to extract from a file. Accidently forgot to use skip to skip parts and ended up with a mess for a while. Eventually completed it however I believe I forgot a part because of how the image came out. I also wasn't aware of using the table of contents to extract. I ended up using Nano and Ctrl+W to search for “toc” which then led to the parts being shown. From there I used the hex and binary numbers to calculate where to get what and how big the skip and count should be.

I sort of had gotten stuck at one part but I realized I wasn't skipping anything because I forgot about it. I basically spent 30 minutes just pondering. Afterwards I eventually got it “flowing” and it wasn't as bad as I had thought but the finished product left…a piece out due to me forgetting about the other parts.

April 4th, 2016

I learned more about scripting and using expressions. Using different expressions while using file tools such as grep or wc you can perform more exacting commands to specifically get certain things you require. Periods, carets, square brackets and some others allow you to for example specify what to look for, how many, at the start or end and how many times. Combined with the other tools available and using some sick pipes you can combine them to perform magical things.

We also learned more about hex editing and how to read the numbers. Specifically also how to read them the “right” or I suppose “left” way. Displayed for our easy reading they're actually read by the computer right to left. If each hex is a byte then it means you need to read it “backwards” to get the true value otherwise you end up usually with huge numbers and more importantly logically wrong numbers. At least from the computers perspective.

April 11th, 2016

So we learned how to use expressions more. Importantly we learned that you can string expressions with pipes and get long very exacting things going on. It requires some thinking and work, almost like scripting. We also started the new project. It involves entering the binary values or rather the more readable form of them of file permissions on a unix system. Based in rwx with dashes and possible 4th bit. Split into three groups, I imagine by the end most of this will be memorized to where you can just spout off the number combinations pretty easily. There is also a time limit on when you can do it so you actually have to…you know do it before the day it is due.

April 18th, 2016

So we started using expressions more. The current project relies on a script that display information using many tools and pipes to get specific parts of it and aligning it in a way we like. It also uses a lot of expressions and basically requires building a “formula” to get what you want. On top of that my blog is displaying stuff that I am not sure its suppose to.

April 22nd, 2016

I finished gfo0, once I started getting it going it was actually…“fun”. Unfortunately I sort of ran out of time and as such it has problems. With that said it actually turned out better than I had thought once I started understanding what 'awk' can do. More so there like a lot of things are so many different ways to do the same thing. I didn't fully understand how I would implement a way to increase 'awk's print so I ended up with a pretty basic and elementary way of printing things.

This was probably the first time I really understood the power of 'pipes' and mostly scripting/bash scripting. It makes Python look a lot more attractive in certain ways in the way that its a interpreted language.

blog/spring2016/jgilber6/start.txt · Last modified: 2016/01/21 18:32 by jgilber6