Ubuntu-Classroom: Basic Compiling

September 4, 2006

Presenting the Classroom’s third class, Basic Compiling. One of the great benefits of Linux and Free and Open Source Software, in general, is the ability to compile software. This opens up new possibilities on how the software will be installed and perform on different systems (but that’s for a more advanced topic). This class introduces novice users on two of the safer and more recommended ways of compiling software.

Summary: This class on Basic Compiling covers two of the preferred methods of compiling. The first is using the famous trio of commands: “./configure”, “make”, and “checkinstall”, the last command being a substitute of “make install”. While “make install” is the more famous command, “checkinstall” is more recommended because it creates a package that could be easily kept, reinstalled, and removed. Using this three commands, a user can compile most of the source code available. The second method is compiling and building packages using APT (Advanced Packaging Tool). This method is even more recommended since it downloads the necessary dependencies (files, libraries and programs needed by a particular package/program) of the package that the user is trying to build. This method also allows users of one Linux distribution to use the source code of another compatible distribution to compile packages. The world of compiling packages is far wider and more complicated (but definitely more exciting) than this, but these two methods are enough to set new users on that path.


Note: This is the edited and formatted text of my IRC log of the Ubuntu Classroom session held last September 2, 2006 18:00 UTC and September 3, 2006 04:00 UTC on the topic “Basic Compiling”. I have only edited the text in order to present it in an easily readable format. The contents are exactly the same (except in some instances where a small portion had to be relocated in order to place it in the proper context). The contents of the text are not mine but are just the output of the IRC client’s logging feature. Thus the contents belong to the instructor who gave them.

Instructors:

  • gnomefreak – installing using checkinstall
  • nalioth – compiling using apt

Compiling using configure, make, checkinstall

Hello thank you all for coming to this class on Basic Compiling. nalioth and myself [gnomefreak] will be today’s instructors. We will start off with a brief lecture, than off to compiling an app. The app we will be compiling today is GNU hello.

Let’s talk a little about compiling first. Here are some things you will need to know before we start. It’s a good idea to be familiar with the terminal and basic commands like “cd” and “tar” and “apt-get” commands. You can find more information for the tar command and its uses on the man page. Type “man tar” in terminal to read the man page. You will also need to have all supported repos enabled, (not for today’s example but other apps you choose to compile). Today i will be giving you most of the commands you will need to compile GNU hello. Not all apps are this easy to compile. I choose GNU hello because its easy and short to compile. There are also different ways to compile an app. I will only be going over one way to do it. nalioth will be going over another way to compile an app.

You will need to tools installed before we start. Install build-essential and checkinstall (“sudo apt-get install build-essential checkinstall“). You don’t need checkinstall but i use it instead of make install because it will create a .deb file for the app you are compiling, (not always the case but most of the time). here is a link to read up on checkinstall: https://help.ubuntu.com/community/CheckInstall

Lets do it! Please download the tar from http://ftp.gnu.org/gnu/hello/ to your home directory (this is where we will be working from today). The file you want is the very last one that reads “hello-2.1.1.tar.gz 09-Jun-2002 02:33 380k“. Once download is complete you will want to untar it. I use “tar -xvzf hello-2.1.1.tar.gz“. without the ” [quotes]. It will than scroll output on you screen. Those are files its unpacking from the tar. When that’s done you want to “cd” into the newly created folder. “cd hello[Tab]“. [Tab] means to use the Tab key to complete the folder name. Once inside that directory it is a good idea to read over the INSTALL and README files. they are in this folder. For today’s example its not needed (but always a good idea). Now run “./configure –help” today we will be doing a basic compile so its not needed to read it. If you want to change the “default program settings” you would use some of the options listed in the –help page. The command ./configure –help is just so you see the options you are able to use. for today we are just gonna use ./configure. Now please type “./configure” as we will be using default settings.. If everything was done as i have explained it should end without errors. Next we want to run “make“. this is going to read the make file of the app. make on this app shouldn’t take longer than a minute.

Now here is where you either want to run “sudo make install” or “sudo checkinstall“. I prefer checkinstall so we will do it that way for today. Once you run “sudo checkinstall” it will ask you a few questions. The first question is something like “what would you like to name it” You can choose a name or just hit [Enter] without choosing one.

nalioth: checkinstall is the preferred method for Ubuntu. checkinstall produces debs that you can keep for later use, and are custom made for your particular machine. If your source code is miswritten [poorly/wrongly written], and the program doesn’t work, using checkinstall to create a deb will allow easy removal of your freshly compiled program. If you use “make install“, you’ll end up with pieces of your program all over the system (which makes it difficult to remove if things go bad)

When it gets done you will see that checkinstall installed a .deb that it made for you and gives instructions on how to remove it if you wanted to remove the app. Also shows you where it was installed. Now type “cd” when its done. When back in home directory you should be able to type “hello” at the prompt and it should run.

Congrats everyone on your first compiling of a program. Don’t forget this was an easy example, please don’t expect all apps to compile this easy without errors. Thank you for coming to today’s class.


Compiling using APT

OK, many of you are aware of apt-get, but are you aware that apt-get can compile packages for you? If you will all type “less /etc/apt/sources.list” in your consoles/terminals, you’ll see your sources.list. If you look at your sources.list, you’ll see lines beginning with ‘deb-src’. Those are the repositories that contain source code for all your packages. some of you may have those lines commented out (with an # in front of them). Now you may type “q” to leave “less” and if your deb-src lines were commented out, please take a moment to remove the # from the beginnings of those lines (you may leave the # in front of the lines with ‘backports’ in them, as backports are sometimes squirrelly)

OK, for those of you who uncommented your sources.list, please update your apt-get. OK, now the first thing to do to get apt-get to compile your program of choice is to type “sudo apt-get build-dep $PKG”. This will install any necessary dependencies to build the program. If you wish, you may type “sudo apt-get build-dep aee” [Enter] at this time. OK, now we can type “sudo apt-get -b source aee” [Enter]. What the above command does is: tells apt-get to download and build a deb from a source package. When all the activity is finished, you’ll have a deb in the current directory. Unlike checkinstall, using apt-get to build pkgs [packages] creates “official” debs that can be shared. checkinstall created packages are not ‘official’ and may not work well if shared with others.

The reason I’ve covered using apt-get to build pkgs [packages] is that using debian binaries in Ubuntu will break Ubuntu, but using apt-get to build from debian deb-src repositories is perfectly fine. So if you just have to have something that only debian offers, you can use apt-get to safely build a pkg from debian’s source repos

.

Questions and Answers

  • Q. is it normal that the first question I was asked in checkinstall was about the package documentation directory?
    A1. OK, in using checkinstall, choosing the default answers is fine. The ‘package documentation directory’ is something that is used by checkinstall, and can be deleted after the checkinstall process is finished.
    A2. Yes, it was different for me because i ran it again and it only asks the first question once.
  • Q. so unlike checkinstall, apt-get -b doesn’t install the package automatically?
    A. No, it just creates a pkg. After apt-get creates it, you may click on it and gdebi will install it for you or you may use dpkg from the command line. sudo dpkg -i file.deb [Editor's Note: Kubuntu users would have to right-click on the package and select "Kubuntu Package Menu" then "Install Package"]
  • Q. Did others notice that update-notifier offers an update for hello?
    A. The reason is: the version of hello you guys downloaded is inferior in version number to the one in the Ubuntu repos.
  • Q. if we build from source a package that’s found in the repositories, what will happen if an update was made available for it? What would we do? Can we safely upgrade to that new version in the repositories? or do we have to recompile?
    A. If its installed you will get updates The package is installed it should be able to be upgraded normally.
  • Q. I wonder why no one asks why you have to do “./configure” rather than just “configure”
    A1. The configure file is a script so you run it with ./
    A2. That basically is a difference in how bash handles the PATH. Windows cmd.exe always search “.” before anything in PATH. It [BASH] never even looks in “.” until you add . to the PATH variable. Some people do this “export PATH=.:$PATH”
  • Q. What does “sudo apt-get build-dep” actually do? I know that “sudo apt-get -b source” is the one that actually builds/compiles the package.
    A. sudo apt-get build-dep kvirc (for an example) would go through your apt database and install all the necessary packages to build kvirc from source. these might include kde development libs, development tools you may not have installed, widget libraries, etc
  • Q. Where does the source code for the package get downloaded to?
    A. It downloads to the current directory

Review: This is probably the shortest of the three classes so far, and the class was only prolonged (perhaps to the agony of the other students) by questions from your truly. Class participation is also noticeably lower compared to the previous classes. Is it because of a lack of advertisement? An inconvenient time (although there were more active participants in previous classes on with same time schedule)? I presumed that the topic would have attracted some attention, based on the amount of “how do I compile this?” questions in the forums and IRC. Well, whoever wasn’t there missed out the chance to ask questions and learn a lot. The instructors can only present what they have prepared. Additional ideas and information would only be brought out through questions from the students. Anyway, for those who missed the class, this transcript is for you. But next time, try to be there. (^_^)


Ubuntu-Classroom: Command Line Basics

August 22, 2006

The second session of the Ubuntu Classroom was held just a few days ago. This time the topic was on the basic use of the command line. The Command Line Interface (CLI) or command line, for short, is one of the most powerful tools in Linux, for which it is both famous and notorious. It is fast, exact, and efficient. But like anything else, it needs a bit of patience and effort to master. But the rewards and benefits are definitely worth it. Of course, the path of the command line may not be for everyone, but it still pays to know your basics.

Summary: Only the very basic commands were covered in both classes, although a few intermediate tips and tricks were also introduced. The first class focused more on the practical applications of the command line, explaining what the basic commands do and how to use aliases, piping, and redirection. The second class dealt more with the concepts of files and directories, and how to use commands to navigate through and manipulate them.

I just combined both transcripts under one post, since they were shorter compared to the first class. I placed a Review of this class and a Summary of Commands Used at the bottom.


Note: This is the edited and formatted text of my IRC log of the Ubuntu Classroom session held last August 19, 2006 18:00 UTC and August 20, 2006 10:00 UTC on the topic “Command Line Basics”. I have only edited the text in order to present it in an easily readable format. The contents are exactly the same (except in some instances where a small portion had to be relocated in order to place it in the proper context). The contents of the text are not mine but are just the output of the IRC client’s logging feature. Thus the contents belong to the instructor who gave them.


Command Line Basics (Take 1)
Aug 19, 2006 18:00 UTC
Instructor: jrib

Introduction

Hi everyone, welcome to the second class held by the Ubuntu New User’s Network. I’m jrib and I will be teaching today’s class on Basic Command Line usage. Hybrid wasn’t able to join us for this session, but he’ll be teaching the other session tomorrow I believe. Before we start with some basic commands, I am going to assume that everyone is using a terminal emulator like gnome-terminal or konsole running in your GUI. And I’ll also assume you are using the BASH shell, which should be the case unless you have changed it.

Okay, I want to start by introducing some of the more basic commands that you will be using most often when you are using the terminal. So everyone can open up their terminal now. On GNOME this is accomplished by going to Applications > Accessories > Terminal. [Editor's Note: In KDE, this would be in K Menu > System > Konsole (Terminal Program)]

You should now have a prompt that ends with a ‘$’, followed by a cursor. To run a command, you just type it on that line, and press enter. I’ll usually try to surround commands with single quotes ” to distinguish them from the rest of the text. You shouldn’t type those in your terminal, just what is inside. [Editor's Note: commands will also be in bold-face for readability]

Basic Commands

Our first command is going to tell us where we are now. So everyone can type ‘pwd‘ now. pwd should return something like /home/user_name. ‘pwd‘ tells us that our current working directory is /home/jasonr. This is the directory that you are in now. Sometimes you will want to change your current working directory. That is where the ‘cd‘ command enters the picture. To use ‘cd‘, you’ll have to understand the difference between absolute and relative paths. Absolute paths start at / and build from there. So, for example /home/jasonr/images/ubuntu.jpg is an absolute path. But if I am already in /home/jasonr, then I can refer to that same file as images/ubuntu.jpg. So relative paths, build on the current working directory. Notice that I can ‘cd /‘ to change my working directory to / and /home/jasonr/images/ubuntu.jpg is still the same, but images/ubuntu.jpg would now refer to /images/ubuntu.jpg which doesn’t exist on my system! There are also a few ’special’ characters you can use: ‘~‘ refers to your home directory which is usually /home/user_name, ‘.‘ refers to your current directory, and ‘..‘ refers to the parent directory, the directory above your current one. Okay, we’ll do some examples on navigating around your system in a bit. Lets say you were working in /, you would do ‘cd /‘ to get there. Then you can run ‘pwd‘ and verify that you are indeed in /. To get back to your home directory, you can type ‘cd ~‘. As a special shortcut you could also do just ‘cd‘ without any arguments by the way. Directories are separated by / in paths as you have seen. Now to the parent directory, you can type ‘cd ..‘. Now try ‘pwd’ and you should see that you are in /home. Also, one last thing that is nice to know is that ‘cd -‘ brings you back to the last directory you were in.

At some point you will also want to know what files are inside the directory you are in now. For that you can use ‘ls‘. Now everyone can type ls and you should see the files in your current directory. ‘ls‘ can also take pathnames as arguments, so you could do for example ‘ls ~‘, ‘ls /‘, and ‘ls ../../etc‘. You can try those now and see the results. I assume you are in your home directory now which is /home/username. In that case, that last one should be list the files in /home/username/../../etc which is the same as /etc.

Now lets introduce how you can create directories and files with the command line. Everyone can do ‘cd‘ now to get back to your home directory. Then to create a new directory you use the ‘mkdir‘ command followed by the pathname to the directory. So everyone can try ‘mkdir ubuntuclassroom‘. This is the same as ‘mkdir ~/ubuntuclassroom‘, ‘mkdir /home/user_name/ubuntuclassroom‘. These are a few of the different ways you could refer to the same place. Does everyone see why? Okay, now lets go into the directory we just created: ‘cd ubuntuclassroom‘. That name is kind of long though, so you may not want to type it all out. Instead you can start to type ‘cd ubuntucl‘ and then press your [Tab] button. As long as there aren’t any similar directories in your home directory, the shell should complete the rest of the name for you and you can press enter (a lot like IRC names in many IRC clients).

Alright, now we can create a few files. We can create blank files using the ‘touch‘ command. And it takes multiple files as arguments. So we can create 5 files name for the letters in the alphabet like so: ‘touch a b c d e‘. And you can type ‘ls‘ now to see that we have 5 new files there. Now lets talk about hidden files really quickly. Any file that begins with a ‘.‘ will be hidden from you, really it is just to keep your screen uncluttered with unimportant files. Let’s make a file called ‘.f’. All of you know, to do this, we would do ‘touch .f‘. Now try ‘ls‘ again. The file isn’t listed! There is a special “switch” for ‘ls‘ though that lets us see hidden files. Try typing ‘ls -a‘ and you should see the .f in the list of files. The -a is called a switch and it is an option for the ls command. You can think of a “switch” to mean the same as an “option”. Many switches have short forms and long forms. Short forms have one dash, ‘-‘, followed by a letter, while long forms are usually two dashes, ‘‘, followed by a word. ‘ls -a‘ and ‘ls –all‘ are the same. So how did I know I needed -a to show hidden files? This is where man pages enter the picture. The “man” command will display the manual for a command. So you can show the ‘ls‘ manual with ‘man ls‘. You can navigate this page with PageUp and PageDown, or the arrow keys if your prefer to go line by line. A nice thing to know is that you can search for terms by doing: /searchterm [Enter].

Okay, I’ll quickly introduce cp, mv, and rm now. cp is used to copy and the basic syntax is ‘cp file1 file2… directory‘ or just ‘cp file1 file2‘ to copy file1 to file2. Note that when I say file1 I really mean pathname1 since you can do something like ‘cp /usr/bin/cat ~/dog‘. you can do ‘cp a myNewA‘ in our ~/ubuntuclassroom directory for a simple example of copying a single file. At this time, let me mention that linux is case sensitive. This means ‘a’ is not the same as ‘A’. Trying to cp something won’t work. mv is similar to cp except that you are moving instead of copying and rm is our command to “remove” or delete a file. Lets get rid of the b file, with ‘rm b‘. It’s important to note that b doesn’t get thrown in the trash like when you delete in GNOME or KDE. After you hit enter, b is basically gone forever. I think it is smart to use ‘rm -i file‘ instead of just ‘rm file‘. Let’s try deleting c and see what happens: rm -i c. You’ll notice this time that BASH is nice enough to make sure we really mean it.

Aliases

So what are aliases? Aliases let you give really long commands a shorter name. Some of you may have some set, others may not have any. That’s ok, we’ll learn how to create them. The syntax for creating an alias is just like the alias output looked. Lets all alias rm to rm -i. The command for this would be: alias rm=’rm -i‘. After doing that you can type ‘alias‘ and see that it took effect. Now when you type ‘rm d’ in our ubuntuclassroom folder, it should again prompt you even though you didn’t write rm -i. However, these aliases won’t stay after you close your terminal and open it again (you can test this out now if you want) To make them stay, we have to put them in a special file that bash will read when it starts. This file is ~/.bashrc. We can take a look at it with a command named ‘less‘. less will open things and put them on pages. So ‘less ~/.bashrc‘. You can go down and see all of the things that are going on and if you still have the default one, you will see a section on aliases. That is where you could add your own. If you haven’t seen similar files before, the lines that start with # are usually comments and are ignored by bash. The rest are commands that bash reads. One of the comments you will see is:


# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.

And that means that if you prefer, you can just put all of your aliases in ~/.bash_aliases and ~/.bashrc will see that and read them from there. I promised you we would implement an ‘rm -i‘ alias, so now lets all hit the “q” button to get out of less and we will use a terminal text editor called nano to create and implement our ‘rm -i‘ alias. Everyone can do ‘nano ~/.bash_aliases‘. Then type in our command from before: alias rm=’rm -i‘. On the bottom you will see that ^O will write the file, or “save” it. That means press Ctrl-O. And then of course Ctrl-X to exit. Everyone can type ‘cat ~/.bash_aliases‘ now and cat will output the contents of the file right onto the terminal. If all went well you should see that your alias is there. Now you could close your terminal and open it again for the alias to take effect. Or as a shortcut you can tell bash to just run all of the commands inside the ~/.bash_aliases file. The command for that would be: source ~/.bash_aliases. A shortcut for that is: . ~/.bash_aliases. Let me just point out that the default file has the code that makes ~/.bash_aliases work in ~/.bashrc is commented out. I’ll leave it as an exercise for everyone to uncomment the three lines that let your source ~/.bash_aliases. Those look like:


if [ -f ~/.bash_aliases ];

then . ~/.bash_aliases
fi

Piping and Redirection

Ok, now I’ll cover piping and redirection very quickly because it is one of the best features. Lets say you didn’t know what command you used to copy files. The ‘apropos‘ command lets you search a programs description. So lets try ‘apropos copy‘. You probably say a lot of stuff and some of it may have even scrolled off the screen. You can use our pager called ‘less‘ to turn it into pages though, try: ‘apropos copy | less‘. The | symbol lets you take the output from one command and pipe it to the input of another command. This is ’standard output’ and ’standard input’. There is also ’standard error’ where programs like to print errors to (this ends up in your screen just like standard out). But piping only pipes standard out. you could also search the output for a certain word. The command for this is ‘grep‘. So lets try ‘apropos copy | grep file‘. That should narrow down the results a bit more, and if they are still too long we can still do ‘apropos copy | grep file | less‘.

And for the last topic, I’ll show you how to save the output to a file. So lets try ‘apropos copy > ~/howToCopy‘. You’ll notice that there won’t be any output. But try ‘cat ~/howToCopy’ and you’ll see the contents of the file. To append to the bottom of a file you can use >>.

Okay, I think that’s all we have time for today.

Questions and Answers

  • Q. I’m just SSH-ed into my box, is that a problem?
    A. As long as you are using bash it should be ok. I just want to make sure you can have a terminal open at the same time as you read what I say
  • Q. Why can’t you “cd file.jpg” ?
    A. You can use cd to change your directory to any other directory. Directories are similar to physical folders with files in them. There is no reason you couldn’t have a directory named “file.jpg” with more files inside of it. But if file.jpg is in fact a jpeg file then you won’t be able to cd to it
  • Q. Why do we see the files ‘.’ and ‘..’ when we do ls -a?
    A. See in every directory the files ‘.’ and ‘..’ will be created. That is how the “special” characters I mentioned earlier ‘.’, and ‘..’ work. ‘.’ is actually a symbolic link to the same directory it is in. And ‘..’ is a symbolic link to the directory above the one it is in. You can think of symbolic links as a kind of link that points to a different place on the filesystem. With that in mind, seeing those can be kind of annoying. And in ‘man ls’, you’ll see that ‘ls -A‘ will ignore ‘.’ and ‘..’.
  • Q. Some folders have tons of files in them… and when using aterm you don’t get a scroll bar… is there a way of showing the output of ls page by page or something like that?
    A. ls | less (see “Piping and Redirection“)
  • Q. Why are some file’s in my terminal blue? Is this about permissions?
    A. ls will use colors to help you distinguish types of file. This is because you actually have ls aliased as ls –color. (see “Aliases“)
  • Q. Does that mean that if i don’t comment these lines out [in ~/.bashrc], the .bash_aliases file will not be run at login?
    A. Right, that code basically says if ~/.bash_aliases exists, then source it. “Source it” means it will read the file and run the commands it find inside. (see “Aliases”)
  • Q. How do you “ls” only directories? the same question go for listing only files
    A. ls -d */ lists only directories with ls. I’ve also seen some tricks with people using ls -F and then grepping for the special character at the end. (see “Basic Commands“)
  • Q. What can i do with command “alien“?
    A. ‘alien‘ is a program that tries to convert rpm’s to deb’s so you can install it in Ubuntu. I’d recommend you try to stay away from using rpm’s though. Try to use an Ubuntu repository, then an Ubuntu deb, and if you still can’t find the program, I would suggest just compiling it
  • Q. What about scripts ? is it enough to write a bunch of commands in a file ? and then how do i run it ?
    A. Any text file may be made executable with “chmod +x file“. But basically you want a shebang line as the first line telling it what to run and you want to make the file executable. shebang’s are things that look like: #!/bin/bash
  • Q. Is source a bash builtin? There is no man page for it.
    A. Yes source is a shell built in. With bash, you can get help on builtins (in the man page of course) or by typing ‘help source‘.

Command Line Basics (Take 2)
Aug 20, 2006 10:00 UTC
Instructor: ompaul

\o/\o/\o/ welcome to #ubuntu-classroom \o/\o/\o/

First off lets open a terminal. So click on application -> accessories -> terminal [Editor's note: KDE users click on K Menu > System > Konsole]. Okay just to blind you with science (or some such), I want to introduce the concept of a shell. You have in front of you in the default black writing on a white background [Editor's note: your setup may vary].On the left there is something that looks like this:

ompaul@desktop:~$

This is your username at your machine and it currently indicates you are in your home directory
if you type at that command ‘set | grep SHELL‘, you will see that the first line returned is SHELL=/bin/bash. Okay that indicates what “shell” your “environment” is set to use. This is the program that you use to converse with the kernel. This program provides a programming environment (usually in the form of scripts) to allow a user to interact with the machine and manipulate it. There are two ways it does this: it invokes command within itself or it can invoke commands external to itself. The ones within are referred to as “buildins”.

So the first command I want you to in there now is pwd. This command tells you where you are. pwd is hard to remember but it actually stands for print working directory. Now you may see from time to time things such as ‘ls -al‘ the part after the ls is called an argument. pwd accepts two arguments. The first is –help, which displays help for the program, and the other is –version, which displays the version number. After both of these functions have completed (and providing they complete correctly) the program exists. please run the following ‘pwd –help‘ to demonstrate an argument.

Let us use the command which invokes manuals. This is the ‘man‘ command. Please type ‘man –help‘ in your terminals now. You will notice that a lot of data is on the screen and the scroll bar on the right should indicate that some data has passed by. However we do not always have the luxury of a scroll bar. So now we will have a quick look at how to see more data. So to see the data one screen at a time, you can do this: ‘man –help | more‘. The function of that pipe is to take the output from ‘man –help and then present it to the command more. What more does is it allows output to be viewed one screen at at time. So if you press the down arrow the screen will scroll down one line at a time and if you use the space bar it is one page at a time. However more faces a restriction, a big restriction – it is one way. It only allows you to go down. so we can do “more than more” by using a new command, less. So it is that we can go backwards with less. We can use up and down arrows and page up and page down. This is useful of you have lots of data. So if you do ‘man –help | less‘ you can test this. You can navigate up and down and then to quit you can press ‘q’. The letter ‘q’ is your friend.

Now for some basics. Now lets have some fun. Please type ‘man man‘. On the foot of the screen you will see something like this: Manual page man(1) line 527/551 (END). This indicates what manual page you are looking at before the bracket(1), in this case man, and it also lets you know how big the manual page is the last digit, in this case 551. Although the manual pages are written in a very “tight” style, if you get used to them you will find them good friends to discover options when you try to do something more complex. Now please press ‘q’ and exit that man page.

Firstly let me tell you something of the layout of linux as it will help you understand some of what is there in front of you. When I say layout just now referring to the filesystem. You are currently in what is called your home directory. The prompt is as I showed earlier ‘ompaul@desktop:~$‘, the ~ after the : is short hand for saying /home/your_username/. The word ‘directory’ in English actually means “list”. However to be clear about what a directory is I like to think of the hard drive as a filing cabinet. There are many drawers in the filing cabinet each of the drawers can contain more drawers. To see the list of “primary drawers” we can use the command ‘ls‘ which is short for list. The whole cabinet is called ‘/‘, which we call “slash”. Not forward slash but slash. This \ is “back slash”. There is no forward slash. So let us get a list of the things in ‘/’. ‘ls /‘ Run that command. So you see bin, it is the first directory there. So now please do ls /bin. The colour you see for bin indicates it is a directory. You are now looking at the contents of /bin. You can see some very common every day commands there. ls is there, date, ps (which shows what processes are running on the computer when given certain arguments), tar, touch, sed, and a lot of others. The colour you see for arch and bash and most of the others in there is for an executable file, depending on how your console is set up. Please do this ‘ls -al /bin/bash‘.

-rwxr-xr-x 1 root root 6644-21 23:51 /bin/bash

That is what it replies or something like that. You will notice that the there are several letters on the left hand side of the screen and some dashes. They are the file permissions: r = read from the file | w = write to the file | x = execute (run) the file. You may notice that I say file and also you may remember I referred to “drawers containing drawers”. Well directories have file permissions too. In fact directories are nothing more than fancy files that contain more files and they too have permissions. If you run ‘ls -l / | grep bin‘, you will get back:


drwxr-xr-x 2 root root 47-12 17:5
drwxr-xr-x 2 root root 8192 28-18 23:37 sbin

Now on the extreme left of the permissions you will see the letter ‘d’. This indicates that these files are directories. So now you have two concepts, files and directories”, now you have also a concept of permissions, however not in detail. You will notice if I take the /bin/bash permissions that it starts with a -, then it has the first group of three rwx, then a group with r-x and another group with r-x. Well reading left to right we call these groups Owner Group World (or I have heard it called Everybody). So what does this mean? Well this gets more meaning from the two columns after the number 2, ‘root root’. This is the owner of the file and the group that the file is owned by. root owns the file and also there is a group called root. They are not the same. In some cases like where your username is the group. I will break it out into little blocks.

Please type ‘ls -al /etc/group‘. First off note that it is not executable. Second note that while anyone in the group ‘root‘ [can read it], anyone (everybody/world) can read it. So it is readable by all users on the computer. Now let us look inside that file: ‘less /etc/group‘. First line ‘root:x:0:’. So this is a group. The group has a numerical id. It is seen in the output. Then as you look down the file you will see your username. It will be a member of some of the groups in the machine. On Ubuntu, ‘admin’, for instance, is occupied by users who have “administration powers”. If you press the space bar you will get to the end of the file. You will see the first user created on the machine as a group name, the username with a GID (group id number) of 1000. In a business you might have a group sales and they would all be able to access the files belonging to the group “sales”. Now the reason we went down this road (and whole chapters in books have been written about permissions) was to explain that a file has an owner (as in a user) and a group owner. And these things can be used to grant access to the users on the box or deny them access to a file. This is important because if you can’t run a file, you may be trying to access something that the system will not allow.

So now in your home directories, [all that information in a way that people don't]


ompaul@desktop:~$ stat Desktop/
File: `Desktop/’

Size: 4 Blocks: 8 IO Block: 4 directory
Device: 371d Inode: 4653 Links: 7
Access: (drwxr-xr-x) UID: ( 1 ompaul) GID: ( 1 ompaul)

Access: 28-22+0100
Modify: 28-2.+0100
Change: 28-2.+0100

Okay, you will see the file name at the top. I said earlier that directories were files
you will see Desktop/ being called a file. Now for the most mind blowing thing you will ever learn about linux and UNIX based systems (at least in my opinion): EVERYTHING IS A FILE. And I mean that your screen, your keyboard, your mouse, they can be read, written to. Your printer, your USB key, the whole system is a collection of files. You take data and you move it from one place to another. This all goes back to an early design choice and it was very fortunate for us they choose that. What it means is that you can take the output of a file and redirect it to another. You an then add to it subtract and a whole lot of other things. I will demonstrate that next.

First off let us create a file in our home directories. The way to create an empty file is to use the touch command. It is normal to refer to random files as “foo”. Please type ‘touch foo123‘ in your terminal. Now ‘stat‘ it. The inode data there is its actual address on the file system, which contains the info about where the file lives. On the system, as you note, the file is owned by you, it is readable and writable by you, it is readable by the group and anyone on the machine. You remember earlier we used “man –help“, well let us capture that data in the file foo123. So do this ‘man –help > foo123‘. We can now look at the file with stat or we can do it the way most people do it ‘ls -l foo123‘. Right now it looks like “-rw-r–r– 1 ompaul ompaul 2396- 12:45 foo123“. The 2396 is the size of the file. Lets overwrite. But first have a quick look: ‘less foo123‘. Press the space bar until you get to the end, then press q to get out of less. So do this ‘wc foo123‘. Now what do you think your looking at? lets find out what your looking at ‘man wc‘. What does that tell you? “wc – print the number of newlines, words, and bytes in files“. So it tells you the lines that are in the file. Please press q to leave the man page. So we have seen the original stat data of the file. Lets look at that: ‘stat foo123 >> foo123‘. That should be fun. After that type ‘wc foo123‘. Okay so when we type ‘wc foo123‘ we note that the line has a size, then if we do the next part, ‘stat foo123 >> foo123‘, we add the stat info onto the end of the file. So the point here is that the > single redirection pipe takes some “random input” and puts it into the file “in this case foo123″. When we use the >> this APPENDS the additional data to the file. In this case we got it to add on the contents for foo123 to the tail end of the file. You can see this if you now type ‘less foo123‘. Now that is three pipes covered:

  • A | B” take the data from the left (A) and hand to the the program on the right (B) to be processed
  • We have also taken random data and put it into a file, usually that is output we want to capture to analyse for later. That is done with the >
  • And then we can open an already full file and append data to it. This is the >>

NOTE the > overwrites all previous data.

So now you have:

  • ls
  • ls -al
  • |
  • >
  • >>
  • touch
  • man
  • and the concept of an argument.

Now to find your way around the file system. You are in your home directory. You can move from there to your desktop. So in the terminal please type ‘cd Desktop‘. You have now moved to the desktop. If you “touch foo1234” here you will create an empty file on your desktop. Please do so and check it exists by minimising your IRC window.

To explain some more about where you are please consider the file system to be like this:

/
/home/
/ompaul/
and /Desktop/

The full path is /home/ompaul/Desktop/. Now we also know about /bin/. There are hundreds of directories on the machine and thousands of files (if not millions). Now ‘cd /‘ takes you to the root of the file system. You do not want to be creating things there. In fact you do not have rights to create data in that directory. The place you should create data is in you own directory or some subdirectory below that. Now if you are in the Desktop directory you can create a new directory in that: ‘mkdir myfirstdirectory‘. You can then enter that. ‘cd myfirstdirectory‘. So now you are within that location. Let’s do something. Let’s use the df command which tells us information about the file system layout. But lets make it human friendly output. Do the following ‘df -h‘. Now if you want to compare how much data how much disk space is used over time we can record the disk space used today, so do this: ‘df -h > dfinfoAug26‘. So this gives us humans a file we can relate to. Now if you go to your desktop and click on “myfirstdirectory“, you can find the file we just created in it. Okay lets make a copy of that file into our home directory. In the terminal ‘cp df‘ now hit [Tab] key. See it complete the file name. Now you want to get it into your home directory ‘cp dfinfoAug26 /home/ompaul/.‘ note the dot at the end. I could change its name with this ‘cp dfinfoAug26 /home/ompaul/MyNewName‘ or even do this ‘cp dfinfoAug26 ~/ompaul/.‘, which is the same as the first one.

Have fun! https://help.ubuntu.com/community/BasicCommands see that also.


Review: This was another job well done for the Ubuntu-NUN team! A very interesting and extremely useful topic. Beginners will learn much from this, while users could take the oppurtunity to refresh their memories. The command line is an extremely powerful tool, even in today’s seemingly GUI-centered age. The real challenge is how to make the command line less frightening and more practical to new users.

This class, like the previous one, seemed to be plagued by time issues. My suggestion still remains the same: announce the time for both classes before hand. This is specially important if the two instructors will be covering slightly different materials/topics, like what happened in this instance. As it turns out, the second day was not merely a repeat of the first class, but a supplementary session.

Summary of Commands and Symbols Used:

Command Description
pwd Print Working Directory
cd Change Directory
ls LiSt
mkdir MaKe DIRectory
touch touch/make a file
man MANual
cp CoPy
mv MoVe
rm ReMove
alias Make a word/command into an ALIAS of a longer command
cat conCATenate(link/combine) files then display the result
more display output one screen at a time; can only move forward
less display output one screen at a time; can move forward and backward; “you can do more (than more), with LESS
nano launch NANO text editor
apropos search manuals for a program’s description
grep search a file/output for a certain pattern
chmod CHange file’s MODe/permissions
help display HELP information for builtin commands
stat display file STATus
wc Word Count
df -h display disk space usage in human-readable format

Symbol Description
/ (as in cd /) root or primary directory
~ home directory
cd - cd to last directory you were in
. in the same directory
.. parent directory
| (pipe) A | B take the output of command A and present it as the input of command B
> A > B take the output of A and redirect/put it in file B, overwrite previous contents
>> A >> B take the output of A and redirect and append (add) it to the contents of file B

Classes Begin

August 9, 2006

MAJOR EDIT: I have decided to follow the format of my transcript for the second Ubuntu Classroom, and combine both days’ classes in one page. This will minimize having to switch from page to page. I also put the “Review” section at the end of the whole transcript, in order not to distract readers from the meat of the subject

Last August 5, 2006, the first Ubuntu Classroom session was held over the IRC (or Internet Relay Chat). Ubuntu is currently one of the most popular and one of the best (in my most humble opinion, of course) Linux-based Operating Systems (or OS) available. The Classroom, sponsored by the NewUsersNetwork, is a project that aims to hold biweekly “classes” over the IRC, covering a wide range of topics about this awesome OS, targeting users of all levels, from beginners to experts. Everyone who has access to IRC is welcomed to sit in and take notes. There are two classes held per topic, the second one being a repeat of the first, for those people who were not able to make it to the first class. For more information about the project, visit their little wiki page over at Ubuntu.

Summary: The fist class was entitled “Introduction to IRC”. However, it did not really go into the most basic IRC concepts and commands. Rather, the class focused on how to use two IRC clients (programs that you use to connect to IRC and chat with people) available in Ubuntu and Kubuntu. The first is a command line client called irssi. This lightweight but powerful program is installed by default in any Ubuntu system. The other client discussed is Konversation. This is a graphical IRC client that’s installed by default in Kubuntu. Ubuntu users can use XChat instead. Unfortunately, there was no one available to discuss about it in class. Questions could be raised during the class by sending a private message to a room moderator. The questions were put into a queue to be asked after the class.

I made a copy of the lessons for both days of the class. I had to edit them so that they would be easily readable by regular people (chat logs are so hard to read…). The “instructors” for the class will publish the chat logs of the class in the wiki page. I will link to it here when it’s already available. The contents of both classes are almost identical, except for a few changes in presentation. The Q&A portion is worth taking note of.


Note: This is the edited and formatted text of my IRC log of the Ubuntu Classroom session held last August 5, 2006 18:00 UTC on the topic “Introduction to IRC”. I have only edited the text in order to present it in an easily readable format. The contents are exactly the same (except in some instances where a small portion had to be relocated in order to place it in the proper context). The contents of the text are not mine but are just the output of the IRC client’s logging feature. Thus the contents belong to the instructor who gave them.


Introduction to IRC (Take 1)
Aug 5, 2006 18:00 UTC
Instructor: hybrid (Irssi)
Instructor: nixternal (Konversation)

Irssi – Command Line IRC Client

Ok, Welcome everyone to the first ever Ubuntu Linux Classroom Session. I am hybrid and i will be instructing today along side nixternal.

Today we are discussing IRC. You all have found you way to Freenode IRC Network, the network Ubuntu calls home. The program you use to connect and talk on IRC is a client and today we will be covering a Command Line client and a Graphical Client. Now I shall begin discussing our Command Line client.

The client I am covering is called ‘irssi‘. It is installed on most Ubuntu machines by default. You can open it by opening Konsole/Terminal/Xterm and typing ‘irssi‘ [Enter]. You will see a new look to the terminal which will include two bars. Now from here we must connect to a network. To connect to freenode you will type ‘/connect chat.freenode.net‘ [Enter]. You will then see information coming from freenode. This information just regards your connection and the server you are on, among a few other details.

You are then connected to Freenode, but not in any channel. From here to join a channel we must type ‘/join #channel‘ [Enter] where ‘#channel’ is the name of the channel you wish to join. You can join multiple channels by typing ‘/join #channel0,#channel1,#channel2‘ [Enter]. irssi will then join those channels in that order. You will notice, unlike its graphical counter parts, irssi does not have separate windows nor tabs. This making changing channels very different. In replace of clicking a tab or window in irssi you will type [Alt]+# Where [Alt] is your alt key and # is the number of the window you wish to go to also you may change between rooms by typing ‘/window #‘[Enter] where # is still the number of the room. So if we joined #channel0 #channel1 and #channel2 in that order, [Alt]+1 is always the server info window, [Alt]+2 would be #channel0 and so on. Now, anytime your name is said, the room number will turn yellow. This indicates someone is wanting your attention.

To private message someone in irssi you will type ‘/msg message‘. For example, if i wished to message nixternal to say ‘hi’ I would type ‘/msg nixternal hi‘ [Enter]. Private messages look just like channels, but there is only two people at all times. Now if you wish to message Nickserv to register your name, you would follow suit with, ‘/msg nickserv register [password]‘ [Enter] where [password] is the password or phrase you have chosen. You should be able to use irssi as a client at any time now.

Now nixternal will discuss a graphical client


Konversation – the KDE IRC Client

== Introduction ==
My name is Rich Johnson, aka nixternal. I have been working with Linux since 1996 and have had the privilege to work with my distributions. Kubuntu has since then replaced every distribution in my arsenal. I am an Ubuntu member, and also assist the Doc, Wiki, Marketing, Bug, Laptop, PDA, and various other teams, as well as the current team contact for Ubuntu Chicago LoCo. You can find me online as ‘nixternal’ and email me,

== KDE and IRC ==
You have a couple of options with KDE and IRC. The 3 main options are of course IRSSI, Konversation and KVIRC. For this tutorial, I plan on showing you the basics to get you up and running with Konversation.

== Kubuntu and IRC ==
The same for Kubuntu as KDE and IRC. However, Konversation is installed by default in Kubuntu, hence the reason I am showing you Konversation over KVIRC, and IRSSI was shown as the CLI option.

== Intro to Konversation ==
http://konversation.kde.org/
Konversation is the graphical IRC client maintained by KDE developers. Some of the features available for Konversation are:

Standard IRC features

  • SSL server support
  • Bookmarking support
  • Easy to use graphical user interface
  • Multiple servers and channels in one single window
  • DCC file transfer
  • Multiple identities for different servers
  • Text decorations and colors
  • OnScreen Display for notifications
  • Automatic UTF-8 detection
  • Per channel encoding support
  • Theme support for nick icons
  • Highly configurable

#konversation is the location on Freenode to get more information concerning Konversation and it’s development. The current stable release of Konversation is 0.19. 0.20 will be available for Edgy Eft.

== What we shall cover today ==
This will be a quick and easy tutorial that will show you the basics or connecting to servers, joining channels, as well as configuring Konversation and some tips-and-tricks if possible.

== First things first ==
Kmenu -> Internet -> Konversation if you are using Kubuntu of course ;)
This is how you open up Konversation. Now, we will follow along with some screenshots I made. The images are a default KDE/Kubuntu environment. I am shooting from the hip from this point on, as we will just skim through the images, and I will attempt to explain it to you.

https://wiki.ubuntu.com/Classroom/Intro2IRC
Everyone, check out that link…and lets start with image 1.

  1. It is the basic “Kmenu -> Internet -> Konversation” menu path it will open up Konversation, and now you should be looking at something similar to image 2. NOTE: My images are default everything. including Kubuntu install and Konversation. The theme is default, and may look different then yours
  2. Image 2: This shows you the main window for Konversation, and it automatically pops up the “Server List” window. The arrow >, if clicked will extend down, and now show you the server(s) used. This takes us to image 3
  3. Image 3: This is showing you by default, that the Freenode Network has the ‘irc.freenode.net’ server setup by default by selecting ‘freenode’ and clicking the “Edit…” button to the right, you will get image 4, the “Edit Network” window
  4. Image 4: This will show you the basic setup of an IRC server in Konversation. In here you can add servers for the Network, add channels for the network, and even edit your identity. The Ubuntu community currently uses ‘Freenode’ as the network for communications. Now within this network, you can join it via different servers. The main servers or choice are, chat.freenode.net (outside of the U.S.) and chat.us.freenode.net (inside the U.S. of course)
  5. Image 5: Here I select ‘irc.freenode.net’ and then press the “Edit…” button to it’s immediate right. This will lead us to Image 6.
  6. Image 6: This is the actual server configuration window. Here you would/could change it to ‘chat.freenode.net’ or ‘chat.us.freenode.net’ if you wanted to also, pay attention to the port.
  7. Image 7: Notice I changed the port to 8001. This is to protect you from malicious DCC attacks that go around and knock you offline. On to image 8…
  8. Image 8: I have selected #kubuntu in the “Auto Join Channels” list. i can edit it to change it, delete it, or add to the list. what this list does, is upon connecting to the ‘Freenode’ network, Konversation will automatically join the channels in that list since I am always at #kubuntu, I will keep it. now, press the add button and take a look at image 10.
  9. [Image 9: highlights which Add button to press]
  10. Image 10: this is where we will add another channel.
  11. Image 11: I added #ubuntu-nun. So now, when I join Freenode, konversation will now automatically join #kubuntu and #ubuntu-nun on Freenode, I believe there is a 20 channel limit, nalioth can comment on that further if I am mistaken.
  12. Image 12: You will notice the 2 channels are now in there and ready to be auto joined! On to image 13.
  13. Image 13: If you were back at the window similar to ‘Image 12′, you would press the ‘Edit…’ button to the right of “Identity: ‘Default Identity’”. That would give us the “Identities” window
    Here is where you would put in your information that will be relayed to the network, Freenode in this instance, upon connection. The network uses this information when you authenticate… So, I type in my Real Name, Rich Johnson the last time I checked. Now, we definitely want to change the nicknames, because everyone who uses Konversation by default and joins the server, you will see Kubuntu, Kubuntu_, Kubuntu__ and so on in the #Kubuntu channel at times you need to be unique! ;) I could just delete the Nicknames listed, but I will just go ahead and edit them. Highlight one of the nicknames, and then press the “Edit…” button to the right. This will give you image 15.
  14. [Image 14: highlights which button to press]
  15. Image 15: Edit Nickname -> Here you can type in the nickname of your choice. I type in nixternal. For instance, elkbuntu would type in ‘elkbuntu’ in this area ;) The name at the top of the list, is the main nickname you prefer. Everyone below it is secondary, and is recommended you pick at least one, if not a couple. Also make sure you register then with Freenode /quote nickserv register . That will register your nickname on freenode!
  16. Image 16: this shows the 2 nicknames I have chosen… nixternal is my main one, and just in case i disconnect and reconnect and nixternal gets ghosted (common occurrence), konversation and freenode with use nixternal_ instead. Image 16 shows the following…

    Service: type in nickserv
    Password: type in your password you created upon registering your nick

    You can “OK” your way out of that now and get back to the main Konversation window, which hasn’t been connected to a server yet

  17. Image 17: Please, for proper IRC etiquette, leave this section blank. We don’t want to see every time you go “Away”, and we definitely don’t want to see the messages.
  18. Image 18: This is advanced stuff here obviously. You can change it around if you know what you are doing. To be unique, feel free to change your “Part reason:” and “Kick reason:”. Just make sure you follow the Ubuntu Code of Conduct ;)
  19. Image 19: Back at the basic server window. If you were to close out of this window, and needed to get back in to edit stuff at a later time, check out image 20
  20. Image 20: “File > Server List…” or F2 will get you back to that window. Alrighty, we have the server setup, we have our identity. Before I go on…for those of you who registered your nickname, you know you need to do /quote nickserv identify every time you join the Freenode network. Konversation can do this automatically for you, however I seemed to have skipped that part really quick, to show you, Press F2. This opens up our server list. Now select “Freenode” and then press the “Edit…” button. Now in the edit network window, you want to press the “Edit…” button for your identity. This will open up a window like Image 13. At the bottom “Auto Identify”.
  21. Image 21: “Settings -> Configure Konversation…” This is where you go to make ALL of your “Look and Feel” configurations for Konversation. I will go over these briefly…
  22. Image 22: “Chat Window” under “Appearance”. Timestamps are the little [13:50] brackets you see on the right. You can show dates as well, but be warned, you will have one long line! Layout shows you some of the minor tweaks you can make to clean up your main views of channels. This is nice if you don’t want to see everything. Show channel topic shows you a bar across the top with the topic ;) Channel mode buttons are displayed in the upper right hand corner and look like T N S I P M K L. these set different modes for the channel, which is a little more advanced. Nick list and quick buttons…the nicklist displays at the right of the screen, and lists everyone who is in that channel, for instance…in #ubuntu-classroom, i can see everyone from “ChanServ” down to “zimmerman_luc”. What you see in image 22 is about all you really want, otherwise it becomes cluttered and messy, and difficult to read.
  23. Image 23: “Fonts”. Pretty basic I would say. You can change the fonts to whatever ones you prefer. I am a “bitstream” guy, so that is all my fonts.
  24. Image 24: “Themes”. Now, this isn’t a theme you are probably used to not like Kopete or aMSN themes. These are the little boxes you see in the “Nicklist” that will show “Voice”, “Op”, “Away” and such. Nothing big really, and useless if you ask me, i prefer the @ for op, and the + for voice, so somebody in here needs to create that theme ;)
  25. Image 25: Colors. I like dark backgrounds and light foregrounds actually…but you can change it to look the way you want. You can click apply while making these changes, and see them right away in the main Konversation window, which makes it easy to see if they will work or not.
  26. Image 26: “Behavior > General”. System Tray, I enable this and use it for notification…leave it default. That way, when some one says your nickname in a channel, the Konversation icon will flash red letting you know. You can edit it however you want to be unique. “Show Server List Dialog”. This is the same as pressing F2. You may not want to see that everytime you start Konversation. Uncheck it if you do NOT want to see it ;)
  27. Image 27: Connection. You can leave it default, no need to really make any changes here, unless you are going to debug of course.
  28. Image 28: Chat Window. Under General, you can clean up what you see and don’t see in channel windows. This is nice for busy channels like #ubuntu or #kubuntu and you don’t want to see all the join/quits and what not. Scrollback is another one i like…i have mine at 2500, that way there I don’t have to cat mylogs | grep what i want all the time. I can press Ctrl + F and do a search ;) Just like Firefox.
  29. Image 29: Tab Bar. This is my biggest pet peeve actually. I am in a lot of channels, so I can’t read all my tabs you can make changes to suit you.
  30. Image 30: Nickname List. This sorts out the nicklist….by user status will put Operators at the top, voiced below them, and then everyone else further down.
  31. Image 31: Command Aliases. My favorite. There are some neat aliases in there, however using them in some channels will get you banned!.. that is your first warning ;)

    Random Fortune: Personally, I think my choice in the mostest-superlative-computer wars has to be the HP-48 series of calculators. They’ll run almost anything. And if they can’t, while I’ll just plug a Linux box into the serial port and load up the HP-48 VT-100 emulator. – Jeff Dege, jdege@winternet.com.

    Sysinfo for ‘MasTequila’: Linux 2.6.15-26-k7 running KDE 3.5.4, CPU: AMD Athlon XP 2000+ at 1667 MHz (3338 bogomips), HD: 45/110GB, RAM: 807/1264MB, 107 proc’s, 15.18h up.

    Current weather for Chicago / West Chicago, Dupage Airport : Clear skies, Temperature: 72°F, Pressure: 30.11″ Hg, Wind: 0 MPH.

    There was /fortune, /sysinfo and /weather. For /weather to work, you have to have ‘Kweather’ installed and running as an applet in kicker. /media will show what you are listening to in Amarok or other media players. These aliases all reference scripts so everything after the /exec that you see, is the actual script name.

  32. Image 32: Quick Buttons. These are buttons you can show under the Nicklist. these buttons will allow you to perform special functions.
  33. Image 33: Ignore. Here is where you can ignore certain words, nicknames, and what not. There isn’t a lot of spam around here, so i don’t use this often, unless i have someone going nuts in a message ;)
  34. Image 34: Logging. Setting this up will log the channels you are in…logging is useful to go back and scour at a later time…and will be used to create the “minutes” of this lecture.
  35. Image 35: DCC. This is for sending and receiving files. there isn’t much I DCC anymore, as I quit using Windows a while ago, and most of you who have used windows and mIRC know what DCC is good for ;)
  36. Image 36: Tab Bar. This will setup the tabs of channels. You can change the color notifications to suit you.
  37. Image 37: Highlights. here you would add words that you want to be notified for. So if for instance, you are a developer for Kflickr, and you want to know when someone says it in a channel, you can add it here.
  38. Image 38: Watched Nicknames. Here you can have Konversation tell you when your buddy has joined. So everytime abattoir joins, I want to know. So I had his information here and I will be notified from now on.
  39. Image 39: On Screen Display. Those of you using Amarok know what this is…when someone notifies you, or you have a notification setup, a small translucent popup will display with who it is from and what it says. I like this feature, so when I’m working on something else, and somebody pings me to get my attention, i will know who and what…almost like screening phone calls ;)
  40. Image 40: Warning Dialogs. You can change these to your liking…i know the pasting large portions is nice. That way there, if you accidentally paste something big, you get warned..otherwise it could paste to the channel, and get you banned/kicked let alone booted from the server for a flood.
  41. Image 41: Configure Notifications. This will lead you to image 42
    Image 42: This is the notification window. Here you can set up how you are notified for certain events. The 2 to the right, just before “Events” are probably the most used. The one with the “K and gear” will flash your Konversation taskbar icon. The one with the speaker will make the sound of your choice. That can be annoying, but useful if you are not paying attention, or not at the keyboard.
  42. Image 43: is just clicking the “Advanced…” button and leading you to image 44.
  43. Image 44: Advanced options. And the last of the images.

NOW YOU HAVE KONVERSATION SETUP…READY TO ROCK AND ROLL
press F2
select Freenode
press “Connect…”
ENJOY~!!!!!

That concludes the Konversation part


Question and Answer:

  • Q. What is the difference between IRC and Yahoo Chat?
    A1. Yahoo chat is subject to Yahoo’s rules, anyone can create an IRC network. There are many open source IRC options, the Yahoo Chat Protocol is not Open.
    A2. Yahoo Chat is also a spot for many “Script Kiddies” who want to do harm. Same with IRC, however it is usually controlled by great people quite regularly
  • Q. I just want to point out something when using irssi: Changing channels on non-us keyboards sometimes also needs (next to meta and the number) e.g. on my belgium ‘azerty’-keyboard. Meta is most of the time your alt-key ;)
    A. Depending on ones keyboard settings, the ‘meta’ key may be ‘esc’, ‘alt’ or some other combination.
  • Q. If I join more than 9 channels, how do I change to the 10th, 11th, etc? And what is a room? And what are rooms?
    A. In irssi, you can type /window 11 [Enter]. Also meta key + q through o is 11 through 19, respectfully. A ‘room’ and a ‘channel’ are pretty much the same thing
  • Q. about registering a nick… i noticed it registered the nick in relation with an ip range as well…. won’t there be problems if the ip address is dynamically allocated and thus exits the ip range ? (yesterday ip address : 86.120.162.xxx today : 86.120.138.xxx)
    A. Your nick will work whenever you issue the password you registered with. It’s just something services does, i’ve logged in from across the US. As long as you remember your password, your nick will be identified.
  • Q. how do you leave a private message window/room?
    A. In konversation and most other clients …. /part. In irssi, /wc will close the current ‘window’ or /window.
  • Q. I can’t get more than 1000 lines in Scrollback option(Konversation)
    A. The 2000 lines limit in Scrollback option is available on the “nightly build” versions for testing purposes. You will be able to soon with the new version that should be released sometime this month.
  • Q. Will there be the lecture about configuring irssi (not just basics)?
    A. If we can find an irssi expert who wants to teach it, yes.
  • Q. if i have 5 rooms opened in irssi,how do i close the third room,or the fourth room?
    A1. you can /wc the visible ‘window’ to close it
    A2. meta key + 4 for the 3rd room…remember meta key + 1 = server….meta key + 2 is the first room.

Excellent! Thank you everyone for your interest today, and thank you for showing up. I hope everything was informational, and I hope it wasn’t to boring. Everyone has been wonderful! You all are the reason Ubuntu is Great!

Next Weeks Topic is Command Line Introduction


Introduction to IRC (Take 1)
Aug 7, 2006 01:00 UTC
Instructor: hybrid (Irssi)
Instructor: nixternal (Konversation)

Welcome to the second edition of the first Ubuntu Classroom Session. This is another session covering yesterday’s topic, but at a different time. We will be covering Basic IRC usage and launching nuclear weapons with nixternal. Today we will discuss two client, programs used to connect to IRC networks, one graphical and one command line option. I will cover irssi, a text based irc program, installed by default on most *nix boxen.

Irssi – Command Line IRC Client

Apparently you have found your way to freenode and the #ubuntu-classroom channel. To begin with irssi you need to open your chosen terminal emulator, shutdown X, or ssh to a server. From here we will type ‘irssi‘ [Enter]. This will transform your window. From here we will type ‘/connect chat.freenode.net‘ [Enter] or you can type ‘/con[Tab] fr[Tab]‘[Enter] and you will see the [Tab] key will complete the ‘/connect’ and ‘freenode’. Then much information will appear. Most is no use to you, but rather information about the specific network and server you have connected to. From here you need to chose a nickname, done by ‘/nick name‘ where ‘name’ is your chosen nickname.

Once you are connected and have your chosen name, you need to join channels, or rooms. Thus done by ‘/join #channel‘[Enter] or you can join multiple channels/rooms by ‘/join #channel0,#channel1,#channel2‘[Enter]. irssi handles room much different than its GUI counterparts. You will not see any tabs or separate windows. Instead, towards the bottom, will appear a list of numbers, each number representing a room/channel. Number 1 is always your server info window, number 2 is your first room, number 3 is the second room, etc. You chose the number you wish to go to and press [Alt]+# where [Alt] is your alt key and # is the number representing the room. Now you can talk in any room just as you would on your current client.

To Private Message someone, often compared to IMing, you type ‘/msg nick message‘. For instance if i wished to message nixternal ‘hello’ i would type ‘/msg nixternal hello’ [Enter]. This would bring up a new number and begin my private conversation with nixternal. Now anytime you see a channel turn a reddish color, someone has mentioned your handle. If someone was to say ‘hybrid’ in #ubuntu-nun at this moment, my number representing #ubuntu-nun would turn red, as i go to this room, the line containing my nick would turn yellow. If you have been using chat long you will be use to addressing people by, nick: message, in example nixternal: howdy. In irssi this is super easy, you type the first two letters of the person’s nick and hit tab, for example ni[Tab] becomes nixternal. If there are multiple nicks beginning with ni* then you can cycle through them with the tab. So om[Tab] leads to ompaul but om[Tab][Tab] leads to OmniColos.

Now you should be able to use irssi well enough anytime you wish or must.

Now to the GUI client.


Konversation – KDE IRC Client

== Introduction ==
My name is Rich Johnson, aka nixternal. I have been working with Linux since 1996 and have had the privilege to work with my distributions. Kubuntu has since then replaced every distribution in my arsenal. I am an Ubuntu member, and also assist the Doc, Wiki, Marketing, Bug, Laptop, PDA, and various other teams, as well as the current team contact for Ubuntu Chicago LoCo. You can find me online as ‘nixternal’ or you are free to email me, nixternal@ubuntu.com. Just so everyone knows, one of my favorite things is to help out others, because Ubuntu is and will always be free for me, this is the way I help pay back my gratitude. With that in hand, feel free to contact me anytime, with any issue!

== KDE and IRC ==
You have a couple of options with KDE and IRC. The 3 main options are of course IRSSI, Konversation and KVIRC. For this tutorial, I plan on showing you the basics to get you up and running with Konversation.

== Kubuntu and IRC ==
The same for Kubuntu as KDE and IRC. However, Konversation is installed by default in Kubuntu, hence the reason I am showing you Konversation over KVIRC, and IRSSI was shown as the CLI option.

== Intro to Konversation ==
http://konversation.kde.org/
Konversation is the graphical IRC client maintained by KDE developers. Some of the features available for Konversation are:

Standard IRC features

  • SSL server support
  • Bookmarking support
  • Easy to use graphical user interface
  • Multiple servers and channels in one single window
  • DCC file transfer
  • Multiple identities for different servers
  • Text decorations and colors
  • OnScreen Display for notifications
  • Automatic UTF-8 detection
  • Per channel encoding support
  • Theme support for nick icons
  • Highly configurable

#konversation is the location on Freenode to get more information concerning Konversation and it’s development. The current stable release of Konversation is 0.19. 0.20 will be available for Edgy Eft.

== What we shall cover today ==
This will be a quick and easy tutorial that will show you the basics for connecting to servers, joining channels, as well as configuring Konversation and some tips-and-tricks if possible.

== First things first ==
Kmenu -> Internet -> Konversation
This is how you open up Konversation. Now, we will follow along with some screenshots I made. The images are a default KDE/Kubuntu environment. I am shooting from the hip from this point on, as we will just skim through the images, and I will attempt to explain it to you. OK, I will be showing you all some images, be warned that your desktop/display may look different then the images I will be showing you. I am using the DEFAULT Kubuntu theme and colors. Here we go.

Images are located at https://wiki.ubuntu.com/Classroom/Intro2IRC

  1. Image 1: This is how you get to Konversation using KMenu
  2. Image 2: This is the initial window/screen you will see upon opening Konversation. You will notice the “Server List”. This is the main point for configuring Networks (i.e., Freenode), Servers (i.e., chat.freenode.net), channels (i.e., #ubuntu, #kubuntu, #ubuntu-classroom), as well as your identity.
  3. Image 3: This just shows you the server under the network Freenode. You will notice in the image that irc.freenode.net is used as the server. There are many servers you can use to connect to the Freenode network. http://www.freenode.net for more information on that!
  4. Image 4: “Edit Network” this is what you get if you highlight “Freenode” in the Server List, and then click the “Edit…” button. Here you will see the “Identity”, “Servers”, and “Auto Join Channels” sections. These are the 3 main sections of interest for us right now.
  5. Image 5: I have highlighted irc.freenode.net in this image
  6. Image 6: Pressing “Edit…” to the right of the ‘irc.freenode.net’ will open up this window
  7. Image 7: Notice I changed the port to 8001. This is to prevent DCC attacks to routers that are vulnerable to the attack
  8. Image 8: I have pressed OK, and I am now back to the Edit Network window, notice I have selected #kubuntu. I am pressing Add, which will give you…
  9. [Image 9: Shows which Add button to press]
  10. Image 10: The window to add a new channel
  11. Image 11: I have added #ubuntu-nun. You can add #any_channel_you_want and then press ok
  12. Image 12: Back to the Edit Network window, notice the highlighted “Edit…” button next to “Identity:”
  13. Image 13: Click the edit button. Identities window appears. Here you can add your personal information. I have added my real name, not worrying about some hacker getting it, since I don’t use Windows, I don’t fear them ;) Now, I could either delete the current nicknames, edit them, or add more. I go by ‘nixternal’ everywhere so I want nixternal in there. Now, you see there is kubuntu and kubuntu_. This is used in the case that you disconnect unexpectedely *excuse spelling ;) If you reconnect, and kubuntu was still on the server, but frozen, you can’t connect with the same nick. That is also located on the FAQ section and what not on the Freenode website.
  14. skip 14, and [shows which button to press]
  15. 15, as it is just editing the nicknames to suit me
  16. Image 16: You will see I have my basic identify setup completed. “Auto Identify”. Notice the ‘nickserv’ in the “Service” are and the ‘********’ in the “Password” area. This will automatically “Identify” my nickname as long as it is registered on Freenode everytime I log into the network. /quote nickserv register [password] This will register your current nickname. Freenode’s site has all the info you need for this! Moving on.
  17. Image 17: Please, whatever you do, leave this section alone. We do not like our windows being filled up with “Away” messages and this is pretty annoying. This could lead to kick/bans in some channels on IRC as well
  18. Image 18: Advanced section. The only thing I have ever changed was the “Part Reason” and the “Kick Reason”, just to be different and not “Stock”. as far as I know, with Freenode, there is no reason for me to send any “Pre-shell commands”.
  19. Image 19: Press OK, and you will be back at the main Server List window. Now you have the option to either “Connect” or “Close”. Connect will log you onto the Freenode server. Close will do exactly that and close the Server List window.
  20. Image 20 shows you how to open up the Server List window if you need it.
  21. Image 21: This is where the “Meat and Potatoes” for Konversation configuration lies. “Configure Konversation”. This will bring us to…
  22. Image 22: “Chat Window”. This is basic setting for the actual window you see when chatting in a channel. The following images are going to be brief, so feel free to ask questions at the end of this lecture. Here we go.
  23. Image 23: “Fonts”. Just that, the fonts that Konversation will use
  24. Image 24: “Themes”. Don’t confuse this with visual layouts. This is the icon theme you will see next to nicknames in the “NIckList”
  25. Image 25: “Colors”. Here is where you can change all the colors you need. Tip: By clicking apply, you can see changes in real time. This makes it easy to test your colors and see if they will work for you
  26. Image 26: “Behavior > General”. This has some nice features to play with…System Tray for notifications…Nick Completion, App Startup..and Misc
  27. Image 27: Connection. This just controls the timeout you will experience during a netsplit, or disconnect through your ISP. Pretty self explanatory actually.
  28. Image 28: Chat Window. This will allow you to make the layout of the window cleaner if you need it to. Scrollback window for Dapper and Konversation is 1000. Edgy is 2000 as it is using new SVN Nightly Builds
  29. Image 29: Tab Bar. My biggest pet peeve actually is the Konversation Tab Bar, but is currently being restructured for Edgy!
  30. Image 30: Nick Name List. This is the list you will see in Konversation over -> (to the right). It has everyone in the channel listed. Here you can sort by status, which will put OPs up top, Voice and everyone else under them, maintaining an alphabetical order as well.
  31. Image 31: Command Aliases. These are the “Scripts” in Konversation. Everything after the /exec under replacement is the actual script name. For instance /fortune does…

    Random Fortune: This is a logical analogy too… anyone who’s been around, knows the world is run by penguins. Always a penguin behind the curtain, really getting things done. And penguins in politics–who can deny it? — Kevin M. Bealer, commenting on the penguin Linux logo

    and /sysinfo does…

    Sysinfo for ‘MasTequila’: Linux 2.6.15-26-k7 running KDE 3.5.4, CPU: AMD Athlon XP 2000+ at 1667 MHz (3338 bogomips), HD: 46/110GB, RAM: 1129/1264MB, 117 proc’s, 5.27h up

    and if you have music playing… /media does…

    nixternal is listening to “Tonight, Not Again” by Jason Mraz on Waiting For My Rocket To Come [Amarok]

    these are also annoying in many channels, but fun in “offtopic”

  32. Image 32: Quick Buttons. These are the buttons that are under the nick list to the right. As you can see, they are used for basic Channel Management.
  33. Image 33: Ignore. Here you can ignore certain types of messages by word. Say you don’t want to see conversation concerning “Microsoft”, you would add that to the ignore list, and everytime somebody said Microsoft, you would never be annoyed by such a bad word ever again ;) This also works for ignoring usernames. So you could ignore hybrid…especially when he is shooting down GUI clients ;)
  34. Image 34: Logging. This is my favorite…it basically allows you to log “ALL” conversation in every channel that “YOU ARE IN”. You can make basic changes to how it is saved and laid out
  35. Image 35: DCC. many of you have probably gotten your fair share of Movies, Apps, and what not when you were Windows junkies, by using DCC and mIRC. DCC is Peer-2-Peer, and provides a direct connection to transfer files, or even to converse.
  36. Image 36: Tab Bar. This is just for notification purposes, as it falls under the “Notifications” section. Here you can change the look and feel of tab notifications.
  37. Image 37: Highlight. Say you are a Konversation developer and want to know when someone mentions ‘Konversation’, or any other word you want to know about. You can set it up here and be notified every time it is mentioned in conversations.
  38. Image 38: Watched Nicknames. Everytime jsgotangco joins IRC/Freenode I want to know. So I set his information up here, and when he comes online, I am notified about it!
  39. Image 39: On Screen Display “OSD” to us Geex. This is just a “Pretty” pop up window for notifications
  40. Image 40: Warning Dialogs. Most are annoying with the “Are you sure” business. However, the one I definitely recommend keeping is the “Warning on pasting large portions of text”. This will save you from paste flooding which could lead to kicks, bans, and k-lines
  41. Image 41: On our way to configuring “Notifications”
  42. Image 42: Notification Settings. Here you can change the different types of notifications you will receive. I only use the “Message” version, unless I am afk but still near by, then I will add some sound. Hovering your mouse above the images to the left of “Events” will explain what each column does
  43. Image 43: Click advanced for more…
  44. Image 44: This just displays the advanced options.

That is it for all of the images….

Thank you everyone! As this concludes Konversation 101


Question and Answer:

  • Q. In Irssi – what does it mean when i get ‘couldn’t look up your hostname’?
    A. That is a router issue i believe…i get it on every IRC client I use..it is harmless I’m sure. It means you aren’t broadcasting the name of your computer for one ;)
  • Q. Where can i find a list of irc commands?
    A. www.irchelp.org. Best bet is ‘/help’
  • Q. Will you be archiving these lessons?
    A. Yes!!! Log will be published soon on the Wiki for review
  • Q. Where does irssi get its list of default and alternate nicknames?
    A. In ~/.irssi/config. You can /set nickname, /set realname, and such. That is just an interface to ~/.irssi/config though.
  • Q. I just noticed that “/connect chat.freenode.net 8001″ connects me to that server using the 8001 port, right?
    A. Yes. you are safe from people booting you via DCC exploits. ~/.irssi/config can also make 8001 the default port. Or /server add -network Freenode chat.freenode.net 8001

Review: This is a first, I believe, in Ubuntu history. A class that specifically targets regular Ubuntu users, both old and new (There are other “classes” in Ubuntu, but targets developers and programmers). Like many “first” projects, there were probably a lot of expectations. I wouldn’t know if the expectations of others were met, since I have not seen much discussion of the class in the forums or in IRC. My expectations were mostly met, and I think that the team behind The Classroom has done exceptionally well. I probably shouldn’t have expected much “detailed” content regarding IRC, since knowledge of IRC basics is an implied requirement to be able to attend the class in the first place. Perhaps the title “Introduction to IRC” was a bit misleading.

Another issue that I had was the announcement of the time for both classes. Although the dates for the classes have already been decided and posted, the times are still TBD (To Be Discussed). But it’s okay. The real problem that I had was that the time for the two classes was not announced at the same time. The time for the first class (6 PM GMT) was announced I think a day or two before the class. The time for the second class (1 AM GMT), on the other hand, was announced after the first class. If I had known before hand that the second class would be held at that time, I would have not forced myself to stay up late for the first class (6 PM GMT is 2 AM in my place, while 1 AM GMT is 9 AM). The result was that I didn’t appreciate the lessons of the first class, as my mind wasn’t in its best condition. I thought I learned more in Take Two of the class, but as I reviewed the logs, it seems that there were actually more details in Take One.

Anyway, the organizers of the class mentioned that they will be announcing the times for the next 2 classes at the same time. I’m still undecided, though, whether I’ll just attend the class that’s scheduled to more convenient time, or still try to sit in both classes.

All in all, I think they really did a great job! Specially considering that this is all volunteer (a.k.a. not paid) work. One of the great things about Free/Open Source Software is that it brings about the best in people. To the NewUserNetwork team and instructors/moderators of The Classroom (nixternal, hybrid, nalioth, et al.), thanks for this awesome experience and gift to the community! I’m looking forward to the classes ahead!

Until then… RECESS!!!


Ubuntu Users: Get inside their heads

July 26, 2006

richbarna over at Ubuntuforums.org started a thread that collected blogs and/or websites of the different Ubuntu users/community members. Not all of them are Linux-related. It’s sometimes nice to know what other Ubuntistas (I think that’s what we Ubuntu users are called) are interested in. The variety of interests and personalities just goes to show how much Linux has become less “geek-oriented”.

Here’s the thread over at the forums:

http://www.ubuntuforums.org/showthread.php?t=219512

I’ve also re-compiled that same list here in my blog on the Ubuntu Users’ Blogs page.

Many thanks to richbarna for initiating it.