User Tools

Site Tools


haas:spring2016:common:class_chat

Screen/Irssi Setup Tutorial

One of the resources utilized in class is the IRC channel.

Mixed with some good old UNIX-y capabilities, we can not only take advantage of this great chat technology, but be ever-present in the channel, even if we physically get up and leave (and turn our computer off in the process). As long as the server itself doesn't need a reboot (which does happen from time to time), it works splendidly.

This guide will get you set up with a screened irssi session on Lab46 to the class IRC channel.

To the uninitiated, screen and the concepts it presents can take some acclimation. If this is your first time using screen, or the system has been restarted, please skip ahead to the “Getting Started” section (you only need to “get started” once). The “Regular Usage” section is to be used only when you have an existing screen session.

Regular Usage of your Screen/Irssi session

The big advantage to using screen is that you can have a persistent terminal session, regardless of your physical ability to maintain a connection to the system.

Typically, we've all been exposed to situations where we connect and utilize a resource, then disconnect when we're done. This is necessary because we simply cannot remain logged in constantly.

The abilities 'screen' provides us with allows us to still come and go physically, but logically remain ever present, or persistent, so that we can leave things as they are, without worrying about wrapping up or saving and shutting everything down. Instead, we can leave things running– and here we are, in this specific case, with irssi, so that we can come and go, and so can everyone else, so the conversation is all-inclusive, even if we're not all around at the same time.

To that ends, what follows will be the typical 'screen' usage that you'll want to get used to.

Re-Attaching to your screen session

After some time away, you've returned, and wish to resume your activities in your screen session.

You log in, and are at the Lab46 prompt.

All you need to do to reconnect to your screen session is to:

lab46:~$ screen -r

And voila! You'll be back where you left off.

Detaching from your screen session

When you are ready to depart physically from your current location, you need to detach yourself from your existing screen session, allowing it to remain running, while you tend to other matters; logging out, shutting off the computer, etc.

To detach yourself from your currently running 'screen' session:

- press and hold down the CTRL key - while you hit the 'a' key on your keyboard - release both, then tap the 'd' key

Your terminal should resemble something like the following:

[detached]
lab46:~$ 

You are now in the original session of your terminal as you logged in. You can log out now.

Starting From Scratch

If you've already set this up, you do not need to repeat the steps here.

Step 0. Do we have any screens?

If you're not sure if you need to launch a new screen session, a quick and easy test can be performed:

lab46:~$ screen -ls
No Sockets found in /var/run/screen/S-username.

lab46:~$ 

See the part that says “No Sockets found”? That means you do not have any, so proceed to Step 1.

If you do have an existing screen session (or sessions), the result of “screen -ls” will indicate there are screens (and sockets), so you do not need to proceed to Step 1, but instead just issue a “screen -r” (unless you have multiple screen sessions, which you either did intentionally and therefore should know what to do, or accidentally, and will need to ask for some help in clearing the unnecessary ones out).

Step 1. Starting from scratch

This assumes you have yet to establish your screened irssi session for the semester (or the server has been reboot, so you have to go through these steps again), otherwise, if you've already performed these steps, you can skip these steps and just re-attach to your screen session.

First order of business is to actually log in, and have the Lab46 prompt eagerly awaiting your bidding:

lab46:~$ 

What we need to do now is start ourselves a new screen session:

lab46:~$ screen

When you do this, you will get the initial screen banner information. Just hit enter.

You should now be inside of screen, as is witnessed by the seeing the following:

lab46:~$ 

What?! Isn't that where I started? Yes.. and it is to where you've progressed. If screen is doing its job, you shouldn't notice any difference between an unscreened session and a screened one… if you REALLY wanted to check, you could run a “screen -ls”, and should notice it now claims a screen session, and that it is “Attached”.

Step 2. Connect with irssi

Before we play with screen, let's fire up our IRC client, this nifty command-line program known as 'irssi', and connect to the server and class IRC channel.

Start irssi

So, from within our brand new screen session terminal, do the following:

lab46:~$ irssi

Your terminal should change appearance… the same black background, but probably some blue bars (maybe one at the top and bottom of the terminal)… may or may not have any text there, save for:

[(status)]

hanging out at the very bottom.

Connect to the server

What we want to do now is connect to the IRC server, which can be done by issuing a command from within irrsi, as follows:

[(status)] /server irc

Upon doing this, a bunch of information will appear on the screen. If you read through it, it should indicate you've connected to the IRC server, along with other bits of information that may or may not make any appreciable sense.

Step 3. Join the channel

Almost there! We've just connected to the server, and now must select a channel to join.

Depending on the class, the IRC channel you seek will be different. Here are some examples of class IRC channels that are in use:

  • unix - for the UNIX/Linux Fundamentals class
  • csci - for the various Computer Science classes (asm, cprog, data, discrete, etc.)
  • hpc - for the various HPC classes

Additionally, there is a general channel available for Lab46 help and discussion:

  • lab46

To join a channel (substitute your actual class channel), we'd do the following:

[(status)] /join channelname

Some more activity should take place on your terminal, which should indicate you've successfully joined the channel. The real tell-tale sign will be your irssi prompt:

[#channelname]

Remember, don't actually join the literal “channelname” channel… only those who are lost and not following directions will end up there.

Channels in IRC are prefixed with a #. Now you can type a message and hit enter, and it will show up in the channel. Others in the class are doing the same.

The purpose is to have and maintain a resource for class communications outside of any scheduled class meeting times. This can (and has) come in handy, and also serves as a source for entertainment (you'd be amazed what sometimes happens late at night when some people aren't sleeping).

Now, irssi is a very capable IRC client, and you can do many things with it (as well as screen, but both are beyond the scope of this tutorial). You *can* join multiple channels, it's just a matter of issuing another “/join channelname”– you'll have to learn how to navigate, but such topics are great for strumming up conversation in the class chat.

And hey, now you're effectively done with the setup part of this tutorial.

You can move on to the “regular usage” section.

Step 4: Detaching from your screen session

When you are ready to depart physically from your current location, you need to detach yourself from your existing screen session, allowing it to remain running, while you tend to other matters; logging out, shutting off the computer, etc.

To detach yourself from your currently running 'screen' session:

- press and hold down the CTRL key - while still pressing CTRL, press the 'a' key on your keyboard - release both, then tap the 'd' key

Your terminal should resemble something like the following:

[detached]
lab46:~$ 

You are now in the original session of your terminal as you logged in. You can log out now.

The End

Basically, that's all you do— detach and re-attach.

That's the basic premise behind screen.

As you get used to it, you may want to branch out and explore some of screen's additional features (there are many, and they are cool).

haas/spring2016/common/class_chat.txt · Last modified: 2012/09/02 16:30 by 127.0.0.1