Monday, December 19, 2011

What coding sources do you suggest for someone starting out ?

This is a question I am often asked, usually in the form of "how do I start coding" or "where can I find a good tutorial on coding". I usually suggest that people start to learn to code by learning to make bash scripts. Bash is an often overlooked medium for the budding coder, but if we face it, it is probably the place where most of us started out and most of us didn't realise at the time that we were actually coding. I know that a lot of people will put down bash scripting and say that it is a useless thing to learn, but I strongly disagree. Once you have learnt the basics of bash, you can very quickly use it to perform quite complex tasks. The knowledge that you will attain from this can be applied to other languages as you gain experience and feel the need to move to a more powerful language or want to learn a new one such as python.

So here are a couple of what I would call quite good resources for someone wishing to start their journey into coding.

Firstly, bash

http://www.tldp.org/LDP/abs/html/index.html

Don't be put off by the title "Advanced Bash-Scripting Guide" as it starts of very basic, and then progresses to more complex topics. The author even says that "This tutorial assumes no previous knowledge of scripting or programming, " so it's perfect for the beginner.

Ok, so what if you want to learn Python.

Well I don't think that there can really be a better source on this subject than that provided the people that produce it, so in this case python.org is my suggestion to you.

http://docs.python.org/tutorial/

There is always the question when it comes to python, which version do I learn ?
Well in my opinion and remember that this is just my opinion, you should learn 2.x

Why 2.x and not 3.x ?
Well, when 3.x came out, there were significant changes to the way in which the language worked. Those changes were so significant that it made 2.x and 3.x code incompatible and backwards compatibility was broken. This caused a big rift amongst the users of python causing very few to be willing to rewrite in some cases millions of lines of code to make it 3.x compatible and as such, more than 95% of python code you will see today and probably for some years to come will still be based upon the latest 2.x version.
So because of this, I always suggest learning 2.x and not 3.x
If at some time in the future you find yourself in a situation where you need to write 3.x code, you can always pick up a book dedicated to updating your skills to 3.x python.


Monday, December 12, 2011

Install nvidia drivers on BT5

In order to install the nvidia graphics drivers on BT5 you need to enter the following into a terminal prompt while X is not running.

First you need to prepare the kernel sources if you have not done so already by:

Please remember to copy and paste these commands into your terminal prompt as formatting can make long lines wrap over into two or more lines !

apt-get update
apt-get install linux-source

prepare-kernel-sources
cd /usr/src/linux
cp -rf include/generated/* include/linux/
cd /

Then for 32bit BT5: following the prompts

wget http://us.download.nvidia.com/XFree86/Linux-x86/270.41.06/NVIDIA-Linux-x86-270.41.06.run
chmod +x NVIDIA-Linux-x86-270.41.06.run
./NVIDIA-Linux-x86-270.41.06.run

Or for 64bit BT5: following the prompts

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/270.41.06/NVIDIA-Linux-x86_64-270.41.06.run
chmod +x NVIDIA-Linux-x86_64-270.41.06.run
./NVIDIA-Linux-x86_64-270.41.06.run

And that's it, you should now be able to restart, startx and enjoy the full glory of BackTrack at the full resolution offered by your graphics card and monitor.

Prepare kernel sources on BT5

To be able to install most software to your own install of BackTrack that does not come from the repo's you will need to prepare the kernel sources.

This is very simple to do and will only take you a couple of minutes.

At the terminal, issue the following commands:
Please remember to copy and paste these commands into your terminal prompt as formatting can make long lines wrap over into two or more lines !

apt-get update
apt-get install linux-source
prepare-kernel-sources
cd /usr/src/linux
cp -rf include/generated/* include/linux/
cd /

And that's it.

Other than resolving any dependency requirements of the software you wish to install, you are good to go.