So I think it is probably about time I try to put some effort into becoming familiar with Linux. I've always toyed around with the idea, but I'm still running nothing but Windows. I think the biggest motivating factor for me right now is that it is becoming more and more difficult to get by w/o knowledge of Linux in my computer science courses at UT. It seems like the department relies on students working with Linux for some courses, which is certainly understandable. For the most part though, I haven't really had any problems with this over the years. I would usually do my programming assignments in Windows, and then I would upload it to my CS account to turn in electronically (might also compile/run it in Linux to make sure there were no strange errors that weren't found in Windows). I've managed to figure out some of the command line stuff (mostly just basic navigation or txt editing stuff), either through the help of some step-by-step instructions from professors/TAs or by looking up some basic commands online (ls, pico, mkdir, etc.). A recent assignment pretty much made it impossible for me to do any of that though. Not sure if it helps, but here's some of the instructions from the README file (cut out the beginning of the file paths to make it less obvious who the professor is, what the course is, etc.): Spoiler Outside of some of the basic parts, I didn't really understand this at all, nor did I have any success trying to start the project by myself. I've since had parts of it explained to me by some friends and finished the project, but I felt as though I spent way too much time concerned over how to get started instead of working on the assignment itself (probably spent less time overall on the assignment actually). On top of that, the professor suggested using GDB, which I attempted to use but I couldn't quite understand it in the limited time I spent with it. I'm sure there are some tutorials out there I could spend some time on, but any tips/help on it and other useful Linux tools used for programming would be nice. I've only really used the compilers (GCC) with my code in Linux, and from those, I've only used the commands that my professors have asked us to use (usually something like "g++ -Wall -Werror -o myProg myProg.cc." for C++ code). I'm not necessarily asking for suggestions on what Linux distribution I should use (and any useful tips involved with this), although I'm guessing that running Linux on my home PC might be the best way to become familiar with all this. I think the CS department uses Qubuntu (sp?), although I don't know how much that matters; I was probably leaning towards trying out Ubuntu a while back, which I would assume would be somewhat helpful since I'm guessing Qubuntu is based on Ubuntu (not sure of the specifics though). I think I've read that it has a strong community support, so that would certainly be helpful as well I guess.
The best way to learn any unix like operating system is to force yourself to use it with only a console and not the GUI. I also keep Unix in a nutshell and unix powertools handy
Whatever you do, don't use Fedora because it is a buggy mess. I like Ubuntu and CentOS. You could virtualize Windows on a Linux machine to help you with the transition.
I have used Mandrake, RedHat, and Ubuntu in the past. By far Ubuntu is the most user friendly Linux out of all 3. Linux is really not that hard. If you don't understand a command, just type "man command" and it will have a detailed manual page. If that doesn't help you, you can ask questions here. GDB in command line is pretty nasty to deal with. I suggest you use a front end GUI for GDB like Eclipse CDT first. Once you get used to that, then you can move to the command line stuff.
very much agree just ssh into one of the cs linux boxes and force yourself to do everything you would normally do on your comp from there
last I checked VI didnt allow you to establish a ssh tunnel into your box. RC, yes, Any flavor with ubuntu in the name is based on the core ubuntu system, Kubuntu is with KDE preinstalled...other flavors just use different window managers(read GUIs) you can dual boot with your windows install, the install routine for kubuntu will set the bootloader up for you. go for it...we can help you here, or you can go to the link given above to linuxquestions.com (a place I got tons of info from back in the day when I needed help) I will say it flatout, you cant be a computer major and NOT at least know basic linux.
Learning some basic UNIX skills will make you a much better programmer. You can install linux on a spare PC, your home PC, or a virtual machine like VMware. You could also install Cygwin on your PC, which is a port of many of the standard GNU tools to Windows. Cygwin also comes with an ssh client and X server, so you can log into the machines at school and remotely launch apps over an ssh tunnel. ACC used to offer a really easy correspondence course that covered a lot of command line and shell script programming that might be helpful to you. I think it was called Intro to UNIX. Check with your advisors to see if the course would transfer.
You cannot be a computer scientist without being at least familiar with Linux. Let me guide you through the instructions: You can access the executable commands in a Linux OS through a shell. A shell is a program similar to the command line prompt thingy in Windows. The most popular shell is called "bash". You normally access a shell through a program called "xterm", it stands for "X window system terminal". Similar to Windows, you can define environment variables in a shell/xterm. Each environment variable has a name and a value. To access an env variable on xterm, you can address in the form of ${var_name}. For example, $BOXESDIR is an environment variable called "BOXEDIR", you can see its value with the following command: > echo $BOXESDIR You can also have shell scripts in Linux, a shell script is similar to the batch files in Windows. You can define your script-specific environment variables in the following syntax: BOXESDIR=whatever However, this variable will disappear after the script has finished executing. To make it last after the script has finished, you need to use the following command: export BOXESDIR=whatever Be careful, there is no space in BOXESDIR=whatever . Some times, you want to run a new process/program in a new shell/xterm and you want to be able to see its output. Normally, you need to manually start a shell using the command "xterm", then in the new terminal, you have to type in the name of the command you want to execute. However, the command "xterm" allows you to directly run a program using its command line arguments, so the following command: xterm -e $BOXESDIR/string will start a terminal and run the command $BOXESDIR/string immediately. Remember that $BOXEDIR is an environment variable, so when it's passed to the command xterm, it will be translated back to its value. So if $BOXESDIR's value is "whatever", the above command is the same as: xterm -e whatever/string The "&" at the end means that this program is to be run in the background. In order for a linux OS to access your file, you have to first mount that disk/partition. The command to do so is "mount": I'm not exactly sure what that does, but you can read the documentation using "man mount". This is shell script run from the command line, it means: Code: for i in 1 2 3 4 5 copy the file called target${i} to the directory /tmp change the ownership and group ID of the file /tmp/target${i} to both "root" change the access permission of the file /tmp/target${i} to 4755 You should read the documentation on chmod to understand the meaning of 4755. You should install Ubuntu on your computer. Hope it helps. -NP
That would have been nice to know. I think I even have Eclipse CDT installed... That certainly seems doable... Actually, maybe I'd be wrong since I haven't done this, but I don't think it would be very difficult at all to do basically what I've been doing on my PC (web browsing and writing code mostly). I forgot I actually did this for one small assignment (did everything in Linux), although it wasn't my preferred way of doing things. By itself, I'm not sure it would have helped me understand how to get started on my last assignment, but I'm guessing it would have helped me become familiar with other aspects of Linux. There's a 1-hour CS course that I think covers the same topics as well (also called Intro to UNIX). I nearly took it this semester, but I think my adviser said she heard mixed things about the course. I decided to just try and learn it by myself at some point, although I wasn't expecting to do it so soon. I think I can find a link to the course website that might have some good info though. IIRC, I needed to use that command to send updated files to the Boxes environment. If it helps, this project was done to teach us about stack buffer overflow attacks, making us figure out exploits that would get us root access in Boxes (a system based on User Mode Linux, whatever that means exactly). The files we worked with were in the hw3 file path, and as I updated the files there, I think I used that command to update them for Boxes (although I think I changed the file path a bit since I only changed a few files and not all of them). Does that make sense? I think I more or less understood what that command did as a whole, although I didn't completely understand what every part of it meant (mostly "none -t hostfs /mnt -o", although I guess I could look it up). Thanks for explaining in detail all the other commands. And thanks to everyone else as well. On a related note, would you guys recommend using/learning Emacs? At least one of my professors has used it and I'm somewhat curious about it. It didn't seem like anything more than just a text editor, although I think I heard that it could save a lot of time when programming (assuming you know what you're doing). When working in Linux, I think I would usually use KWrite...or it might have been one of the other KDE text applications, can't remember exactly.
I think I can explain the mount command. A normal mount command would look something like this: mount /dev/cdrom /mnt Instead of /dev/cdrom, your command uses a special variable ("none") for the device because it is a virtual device of some sort. The -t flag tells mount that it is mounting a hostfs filesystem. The "/mnt" is the target mountpoint. The "-o" flag allows you to pass special arguments to the device, in this case, where to start mapping the drive. You'll either love or hate Emacs. It has a pretty steep learning curve. I'd start with a graphical version of vi, like GVim (which you can get for Window here ). It does a good job of syntax highlighting without as much of a learning curve. You should definitely learn vi or Emacs well enough to be able to use one of them in terminal mode, just in case you have to edit files from the command line.
You are doing stack buffer overflow attacks? That's awesome! Unlike (old versions of) windows, Linux/Unix systems have very strong protections on files and processes. For example, in general you cannot access other people's files and process unless the right permissions have been given. For most *nix systems. There is a a super user whose login name is "root". This user can access any user's files and processes, therefore it's very dangerous. For example, normally, if someone is hogging the CPU with lots of processes, there is nothing you can do about it; however, if you are the root user, you can just kill all his processes. Furthermore, most, if not all the system files cannot be modified by a normal user, but the root user can modify them. To put this in context, most *nix systems are designed to allow multiple users to access it simultaneously through different terminals, so it's vital for the OS to make sure that the users cannot interfere with each other, but also cannot dominate the enter server. Gaining root access can mean one of many things. But it basically means to changing the ownership of a running process from a normal user to root, thereby giving that particular process all the permissions of a process run by the root user. I'm a bit surprised by how little you know about file systems and processes. Shouldn't you have done a subject an operating systems to be doing SBOF attacks? I have no idea what it does, but that's what the menu is for. The -t flag is the "file system type flag". "-t hostfs" means that the file system to be mounted is "hostfs". The "-o" flag is probably for you to specify file system specific flags. I doubt you need to worry about this command. But if you have other doubts, read the following webpage for hostfs: http://user-mode-linux.sourceforge.net/hostfs.html It really is up to you. A religious war has been ongoing for aeons between vi users and emacs users. Both editors are very powerful, and you can do virtually anything you want with either of them. But having used both, I feel that vi/vim/gvim has a slightly easier learning curve than emacs.
Install a linux system on your PC...force yourself to learn how to install software and manage file system on it. That's how I learned how to use linux.
I think that makes sense, thanks. Will work on that, thanks for the link. Looking back at how much I struggled getting started on the project, probably so. There is required CS class on Operating Systems, although I don't think most people take it until their last year or so, partly due to the prerequisites for the course (I'll probably take it in the Fall). As I mentioned earlier, there is a 1 hour Unix course, although it isn't a required course for any CS class AFAIK. I think I did a SBOF attack in a class a year ago, although it was MUCH simpler (can't remember the specifics...although it dealt with the LC-3 Simulator IIRC). I think the idea is to get us to understand how the stack works and how poor coding habits could lead to a SBOF attack (simplest case being creating a buffer with a predefined limit, and then using strcopy without checking the size of the string, possibly allowing the return address to be modified). Again, thanks for the help you guys. Another thing I forgot to ask is would it make a difference if I already dual boot between XP and Vista? I'd assume not, although I haven't really messed with this to fully understand how it works. My dad set that up on my PC, although he doesn't know anything about Linux unfortunately. Then again, I might prefer to use Linux on my laptop, which I don't use quite as much as my PC (plus it might help with performance a bit, the 512MB of RAM doesn't help it run XP all that well at times).