2008/10/06

VIM tutorial

We hebben gezien dat veel van jullie nog werken met de editor Kate / Kwrite. Weliswaar zijn deze editors toegankelijk en snel te begrijpen, ze werken voor een programmeur behoorlijk inefficient (bedenk alleen al eens hoe vaak je op de spatiebalk moet rammen tijdens een sessie programmeren of wat een moeite het kost om een loop in z'n geheel te indenten).

We zouden jullie willen aanraden om VIM te gaan gebruiken. Uiteraard kunnen we jullie niets verplichten, maar VIM heeft voordelen als:
- alles te bedienen met het toetsenbord ZONDER ingewikkelde toetscombinaties (Ctrl-Shift-Alt Z e.d. zul je niet tegenkomen)
- de aanwezigheid van verschrikkelijk geavanceerde functies (waar veel IDEs niet aan kunnen tippen), maar tegelijkertijd het binnen een seconde opgestart zijn en draaiend op de traagste systemen (of over je SSH-verbinding)

We kunnen hier nog wel even doorgaan met een lofzang op VIM, maar dat doen we niet. We zouden jullie willen aanmoedigen om VIM uit te proberen.
Omdat VIM een kleine drempel heeft om ermee te beginnen, heeft Tim een tutorial geschreven. Deze staat hier.

2008/09/20

SSH & SCP for Windows -> PuTTY

For those first-year students still on Windows, I'll post two articles.

The first one is on how to get the SSH-functionality while you're still running Windows, the second one will be (I hope within a week) to post another article - about migrating to Linux.

When you want to access your UvA-home folder and you have only a Windows environment, here's the solution: PuTTY. PuTTY is a program that has the SSH-functionality, and you can simply run it from the Windows-shell (cmd.exe).

I won't give too many details over here - just try to download it, you won't have to do any installation (many people carry PuTTY with them on a USB-stick because of that). The PuTTY SCP program is called pscp.

Download PuTTY here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

(I hope you know how to use a Windows commandline..)

2008/09/19

SCP (follow-up to SSH)

(If you don't know how to use SSH, first read the previous post)

Another post for the first year students of UvA..

SSH starts a remote shell, enabling you to work on a computer and have full control while you're on the other side of the world (but also if you're sitting next to it, of course). A little downside is, that you - when you're physically on another pc - cannot access your local pc from within the same shell. To move files to and from remote pc's over a SSH connection, there's another tool in Linux, called SCP.

(Before copying anything using scp, you don't have to log in to a ssh server. Of course it is possible to copy anything after logging in, but in that case the "local" file is in reality the "remote" file, and the "remote" file is a file on another "remote" server.

Syntax is quite simple if you're used to ssh:
scp user@host:/path/to/sourcefile /path/to/destinationfile
of course it will work in two directions:
scp /path/to/sourcefile user@host:/path/to/destinationfile
and, instead of destinationfile you'll also be able to specify a directory:
scp user@host:/path/to/sourcefile /path/to/destinationfolder/
use of wildcards is also permitted.
scp user@host:/path/to/sourcefolder/* /path/to/destinationfolder/

So, let's copy a all .txt-files from our UvA-home directory to the directory at the pc I'm now working on:
scp scienceaccount@sremote.science.uva.nl:~/*.txt .
(the last "." stands for "current directory")

Or, copy everything in my UvA-home directory to the directory called "uva_homedir" on the PC I'm right now working on:
scp -r scienceaccount@sremote.science.uva.nl:~/* ~/uva_homedir

SSH

A special post just for our beloved first-year students at UvA :).

It might well happen that you're at home and while having a beer with your dad (or anyone else) you remember you forgot to e-mail your assignment you was working on to yourself. Trouble. You just planned to finish your assignment tonight, but now you left everything you did at the university!

Well, I got some good news for ya: SSH.

On any Linux-pc with a working internet connection, just open a shell and type:

ssh user@host

to open a secured remote shell (where user has to be the user to log in on the remote pc, and host has to be the address of the remote pc).

In case of the University of Amsterdam, user will be your science-account, and host will be sremote.science.uva.nl, so:

ssh scienceaccount@sremote.science.uva.nl

After connecting (this will take about half a minute) you'll be welcomed by the FNWI welcome screen, and asked for your password. While you type in your password, the cursor will NOT move - this is default on UNIX shells.

After logging in, you'll get your bash shell and can access all your files directly. However, the policy of the sremote server requires us to ssh from there to a physical pc - no calculations are allowed at the sremote server (some people have been banned for that).

So, after logging in, choose a pc (ow124, ow125, .. ow141 and so on) and type:

ssh ow124

(because you are already logged in, your current username will be used, and because you're on an internal network you don't have to specify a domain name or something).

From that on, you can perform everything you can on a UvA-PC. Even running graphical programs (nautilus, firefox, try it!).

If the graphical part doesn't work, give SSH the parameter -X (capital x). This will enable X forwarding.

If you're in a Gnome Desktop Environment, you can also select "Connect to Server.." from the "Places" menu. Login credentials:
Service type: SSH
Server: sremote.science.uva.nl
Port: (default, leave empty)
Folder: (default, leave empty)
User name: Your science account user name
Name to use for connection: Be creative :).

After clicking "connect" you will be asked for your password. Now you have your SSH connection integrated in Nautilus!

2008/02/16

Opening your VAIO - part 2

My SONY VAIO notebook. In the previous post you can read something of my not-working keyboard, so now I have to open it again.. While taking some photos of course :-).

The first thing we have to take off is the battery.
To access anything inside the laptop, we first have to remove silver panel just above the keyboard - because some of the screws are beneath that panel.
To take this panel off, take out all screws on the red marked positions (at the image, not on your laptop - unless you've marked them red yourself like I did).

Now take out the DVD drive. This is because there's a tiny bracket positioned over there - if you don't release it, the front panel won't come off

The tiny bracket. Push it away with a small screwdriver.

Now, take that small screwdriver again, to push away some more brackets. Try to find them (it's quite easy if your screwdriver isn't too large and you are careful) and release them with a "click". When the front panel is no longer fixed on the front side, it's time for the next step.


At the back side of the front panel, there are more brackets - I've marked them on these photos. Be careful! Maybe you've to change the position of the laptop screen a few times to release the front panel totally. This I find the most difficult point myself.


The front panel's off! In order to remove the keyboard, only three more screws need to be removed. The first two are just on the place where the front panel used to be.
The third one is on the other side. Remove the cap protecting your memory modules (that's the one in the center) and in the upper right corner of there's our final screwed friend.
Now the keyboard should be free! You can take it off - be careful with the cable (it's long enough, but anyway). Maybe in another post I'll show how to open the rest of the notebook, but I think this will be enough for today.

2008/02/15

Opening your VAIO - part 1

A while ago, when trying to install certain version of Mac OS X Leopard on my VAIO-FZ19VN notebook (OSX86), I read somewhere that my Intel wireless network card would not work in Mac OS X, but according to some people on the net it should be easy to replace.

And I got myself two notebooks over here! No, that's not because I have too much money, and no, it's not a PC and a Mac, alas.
My second notebook, an HP laptop, I bought second hand from my mother. She used it for about 1,5 year and about that time errors began to happen. Strange lines across the screen, and the system hanging time after time. Nowadays, I even can't install Windows - only some Linux-versions will boot in this strange machine. But it HAS a wireless network card - Broadcom, so it should work under Mac OS X.

It was not very difficult to open my VAIO, if I had known how. Anyway, I figured it out without damaging my notebook.
Once it was open, it became clear that the slot containing the network card in the VAIO was different from the slot in the HP, so I had to put the whole laptop back together, without any changes made.

Next day, when I was entering in the minutes at a meeting, some of the keys on my keyboard stopped working. So I had to substitute each "r", "u", "f", "j" - and some other keys.
And I had to open my notebook again - my keyboard cable was not connected properly.
This second time opening my notebook, I've taken some photos for all VAIO users out there who want to open their laptops for one or another reason. I'll post them in my next post