User Tools

Site Tools


opus:spring2012:jpettie:hpc0part1

hpc0 Keywords

hpc0 Keyword "Screen"

Definition

Screen to me, in unix, is an orgasmic experience of endless possibilities. It is the very meaning of multitasking efficiently and its uses are endlessly approaching greatness, like the graph of 1/x, it never reaches fully to 0, but it will always be getting closer and closer to perfect value and significance. Putting all my admiration aside, screen is used to create a session of many windows within a terminal window. Well, you ask, why is it called “Screen” if it creates a plural cornucopia of windows of great potential. Well, don't be a dummy, keep it simple stupid, think of it as a frame or structural base that you build upon and a very sturdy one if you ask me. So, if you find yourself wanting to multitask your butt off, or you just really want to show off to all your friends, you should get to know your new best friend, “Screen”.

Demonstration

Demonstration of the chosen keyword.

So, are you finally ready to be the future, be the unstoppable, well, you'll be more efficient at the least. Then follow me on this great journey and you shall find the greatness in all things that are “Screen”. Fine, I get it, you are tired of me talking so much. Without further ado I shall now show you the awesome-sauce that is “Screen”…

*Awesome Eye of the Tiger Music comes on in the background*

lab46:~$ screen

Make sure to say “y” or “yes” when installing/setting up screen.

lab46:~$ screen -ls
There is a screen on:
        13985.pts-50.lab46      (02/14/2012 12:17:40 PM)        (Attached)
1 Socket in /var/run/screen/S-jpettie.

hpc0 Keyword: Screen Cont.

Definition

Dude, you totally made the right choice in choosing to continue your knowledge of the Screen universe with me. So, lets get to it, right!?

..Right.

There are things you just must know about screen to really make it shine and once you realize what you are doing, you will be amazed.

Disclaimer: If you are one of those guys who are like, I ain't ever amazed bro, sit back and watch the magic yo, and I ain't yo bro dude.

In this section of the continuum of Screen, we will discuss some useful keystrokes to manipulate Screen to your needs, or is it Screen that is manipulating you? That is the question indeed. What better way to do such a thing than with Hotkeys, lets kick it old school yo.

Hotkeys

Attach to a screen session:

lab46:~$ screen -r

Control Command Hot-key Combinations for Reference (Simple):

  • Control + c: Create new window.
  • Control + a + a: Swap between windows.
  • Control + “: Show all windows running.
  • Control + a + A: Name current window.
  • Control + a + k: Destroy current window.
  • Control + a + n: Change to next window.
  • Control + a + p: Go back a window.
  • Control + a + \: Destroy all windows.
  • Control + a + D: Detach from running Screen.

Disclaimer: If you don't believe me, jerk…, anyway, use:

  • Control + a + ?: Shows list of all commands.

hpc0 Keyword: Screen Split

Definition

So now you understand how to create windows, name windows, swap between windows, even how to kill windows, and you ask, is that it? Maybe you'd even say I guess that is alright, its kinda cool. Well, there is more to this story than you might realize at first sir. Get ready to have your mind blown and your efficiency level skyrocket to over 9000!!!!!!

The story began back when someone decided that should open two terminals because they want to work on two different windows at the same time, and maybe they used win 7 to snap it to either side of their screen, well, I am here to save you from opening too many screens and endless terminals to multitask. It can be done in Screen, and it is time you learn how to do it.

Demonstration

The commands you'll want to know to split your screen into vertical and horizontal windows as many times as you'd like are as follows:

  • Control + a + S: Split screen into n windows horizontally (where n is how many times you do such a thing, feel free to do this a lot, its fun, trust me.).
  • Control + a + | (Don't get this confused with the letter 'l' or the letter 'i', it is a pipe, or rather a shift '\'): Split screen into n windows vertically
  • Control + a + TAB: Swap focus between the split windows in screen. (Multitask be yours, like magicks yo)
  • Control + a + X: Destroy a window.

And so you can see the magic that will happen, here is an example of what you can expect to create:

               words?                                                                                   jpettie@lab46:~/src$ cd unix
21:35 < Jacob> thats exactly what I was going for, how did you know?                                    jpettie@lab46:~/src/unix$ ls
21:36 < wedge> no, the ultimate aim is for it to be readable and informative, and especially to the     cs1.txt  lab0.txt  lab1.txt
               original author months down the road                                                     jpettie@lab46:~/src/unix$ ls
21:36 < wedge> but, seeing as it is publicly accessible, just know that the intarwebz can also read it  cs1.txt  lab0.txt  lab1.txt
21:39 < Jacob> well, I just wanted to use awesome-sauce                                                 jpettie@lab46:~/src/unix$ ls -all
21:39 < wedge> feel free                                                                                total 12
21:39 < wedge> I think it makes it more enjoyable                                                       drwxr-xr-x 3 jpettie lab46   61 Jan 28 18:57 .
21:40 < Jacob> as long as you enjoy it, I should be doing well                                          drwx------ 6 jpettie lab46   68 Jan 28 18:40 ..
21:41 < wedge> to enjoy and be informed                                                                 drwxr-xr-x 6 jpettie lab46   92 Jan 31 16:52 .svn
21:41 < Jacob> gonna hit the world with matrix level stuff, when I hit splits                           -rw-r--r-- 1 jpettie lab46  705 Jan 28 18:57 cs1.txt
21:41 < wedge> knock knock neo                                                                          -rw-r--r-- 1 jpettie lab46 2489 Jan 25 14:38 lab0.txt
21:43 < wedge> anywho... I'm going to wander... any last requests?                                      -rw-r--r-- 1 jpettie lab46 3327 Jan 28 18:56 lab1.txt
21:43 < Jacob> knock knock , endless screen possibilities                                               jpettie@lab46:~/src/unix$
21:43 < Jacob> um, don't check it until tomorrow at 1?                                                  jpettie@lab46:~/src/unix$
21:43 < Jacob> hahah
21:44 < wedge> 0100 hours?
21:44 < wedge> :)
21:44 < Jacob> just joking
21:44 < Jacob> I'll have a lot done by midnight
21:44 < Jacob> most likely all of it
21:44 < wedge> I'll likely not be looking at it until tomorrow afternoon at the earliest
21:45 < wedge> good night all
21:46 < Jacob> I be good student from now on
21:46 < Jacob> ;p
21:46 < Jacob> good night
21:57 < rmatsch> hey
21:58 < rmatsch> cat utility not working
22:26 < Jacob> how are you using it?
 [22:27] [Jacob(+i)] [4:irc/#unix(+Pnt)]
[#unix]
  0 irc                                                                                                   4 bash
  GNU nano 2.2.4                      File: icprog.c                                                    Sending on   Socket/fallback
                                                                                                        DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
#include <stdio.h>                                                                                      DHCPOFFER from 10.80.3.62
#include <stdlib.h>                                                                                     DHCPREQUEST on eth0 to 255.255.255.255 port 67
#include <stdbool.h>                                                                                    DHCPACK from 10.80.3.62
                                                                                                        bound to 10.80.3.31 -- renewal in 19118 seconds.
int main(int argc, char **argv){                                                                        done.
        int input;                                                                                      INIT: Entering runlevel: 2
        bool check = false;                                                                             Starting enhanced syslogd: rsyslogd.
        unsigned char i;                                                                                Starting OpenBSD Secure Shell server: sshd[   11.401708] NET: Registered protocol family 10
        while (check == false){                                                                         [   11.402227] lo: Disabled Privacy Extensions
                printf("Enter a value (0-4):");                                                         .
                scanf("%d", &input);                                                                    Starting periodic command scheduler: crond.
                if (input > 4 || input < 0){
                        printf("You have entered an incorrect value.\n");                               Debian GNU/Linux 5.0 vm31 hvc0
                        check = false;
                }else{                                                                                  vm31 login: vmserver02:~# ssh root@vm31.student.lab
                        for (i = 0; i < argc; i++){                                                     The authenticity of host 'vm31.student.lab (10.80.3.31)' can't be established.
                                printf("argv[%hhu][%hhu]: %c\n", i, input, *(*(argv+i)+input));         RSA key fingerprint is 39:41:a6:f0:21:67:ac:fc:3b:b6:55:8f:1d:2f:be:c6.
                        }                                                                               Are you sure you want to continue connecting (yes/no)? y
                        check = true;                                                                   Please type 'yes' or 'no': yes
                }                                                                                       Warning: Permanently added 'vm31.student.lab,10.80.3.31' (RSA) to the list of known hosts.
        }                                                                                               root@vm31.student.lab's password:
        return(0);                                                                                      Linux vm31 2.6.26-2-xen-686 #1 SMP Wed Sep 21 09:56:47 UTC 2011 i686
}
                                                                                                        The programs included with the Debian GNU/Linux system are free software;
                                                                                                        the exact distribution terms for each program are described in the
                                                                                                        individual files in /usr/share/doc/*/copyright.

                                                                                                        Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
^G Get Help      ^O WriteOut      ^R Read File     ^Y Prev Page     ^K Cut Text      ^C Cur Pos         permitted by applicable law.
^X Exit          ^J Justify       ^W Where Is      ^V Next Page     ^U UnCut Text    ^T To Spell        vm31:~#
  2 bash                                                                                                  6 bash

hpc0 Keyword: Virtualization

Definition

Virtualization is a way to create something that does not rely directly on the constraints of hardware.

Demonstration

A demonstration of this would be creating virtual machines on a virtual machine server which I have already implemented, but the way to create the virtual machines is as follows:

root@vmserver##:~# xm create -c /xen/conf/vm##.cfg
root@vmserver##:~# xm create /xen/conf/vm##.cfg

hpc0 Keyword: Configuration

Definition

Configuration has come to me in the meaning of changing the way something runs or starts up, depending on a file that is referenced by the service that uses it.

Demonstration

A demonstration of this would be for pvpgn, when I had to edit the .conf files of different services that make a whole of a server for the service of a pvpgn server to work correctly.

hpc0 Keyword: Backups

Definition

In our field, Backups are a very useful technique to create a restore point for a program or database and many other sorts of project files or directories before a big change or developmental process.

Demonstration

A demonstration of this is found at my work on a daily basis where we automate the backup of our mysql database so that if anything were to happen to it, we would be able to implement a restore to precious data.

hpc0 Keyword: Installation

Definition

Installation in my words would be the creation of a working copy of a program onto your computer from a downloaded source found online.

Demonstration

An example of this would be using Aptitude to install mysql.

vm31:~$ aptitude install mysql

hpc0 Keyword: Documentation

Definition

Documentation to me is a read me file or even a forget me file, pun intended. It is the bread and butter of working on someone else's code if they have comments inside their code explaining something about each part or how to run the program correctly.

Demonstration

Here is an example of documenting with comments in c code.

//This is an example comment line
/* This is an example of a multiple line comment
    Heres some more info
    and finally
*/

hpc0 Objective

hpc0 Objective

Demonstrate problem solving capabilities.

Definition

I believe what this objective can be defined as is a process that has been honed in on by the practice of completing projects of different levels of difficulty and expected outcomes.

Method

To show I have accomplished this objective, my method will include an example of a project where I have applied the practice of problem solving.

Measurement

Here is an example of a project I have completed by solving problems recently. The problems I encountered included bad mirror links in the cfg file of the xm virtual machine I was trying to create along with changes to the xm conf files before executing the creation of the virtual machine.

root@vmserver02:~# xm create -c /xen/conf/vm31.cfg
root@vmserver02:~# xm create /xen/conf/vm31.cfg
lab46:~$ ssh root@vm31.student.lab

Analysis

I believe I did well in performing this task and showing that I could solve the problems that I encountered along the way in completing the project. I definitely think that there is room for improvement in all things we do, but especially in problem solving. I have a philosophy that you have to experience a problem, or make a mistake to truly learn how to correct it and not repeat it in the future. I believe if I used a different project as an example with more detail going into how I approached and fixed the problems I came across, the measurement would be a more effective tool to show my skills. I believe it would be an efficient change to employ and I intend to do so in future opus Objective documentations. The course objective pretty much covers all it means to cover and should not be altered in any way, it is what it says, and problem solving is something people have to do every day in their lives no matter the field or task at hand.

opus/spring2012/jpettie/hpc0part1.txt · Last modified: 2012/03/02 22:30 by jpettie