Showing posts with label Bash. Show all posts
Showing posts with label Bash. Show all posts

Wednesday, November 26, 2008

My recent development work... aka training excercise

I recently began to dabble with Python, and I am really starting to like the language. It is quite powerful, and intuitive, and allows for some really rapid development, especially when coupled with pyKDE4 (KDE Python bindings).

I was originally trained as a programmer, primarily using C/C++. However, in more recent years, I have been mostly programming in bash and perl, all under work related coding.

With my recent involvement with Kubuntu, I have felt it necessary to learn python, as many of its support applications are written in that language. So, what better way to learn than jump right into a new project. That's where todays post comes from...

I have recently submitted two new projects to Launchpad, with the following two goals:

1. teach myself python and pyKDE
2. hopefully fill a gap within Kubuntu in time for Jaunty

At this point in time, the projects are mere shells/placeholders, and really do not do anything useful besides provide a tray icon and a main window and help dialog. However, this is all a part of the learning process, and more code will appear as I test out various things.

So, what are these two projects? Well, the first is ufw-kde, a graphical interface to the Uncomplicated Firewall. The second is clamav-kde, a replacement for Klamav, which has yet to be ported to KDE4.

Anyway, my primary goal is learning python and kde programming via the python bindings. If these do indeed turn out to be useful in their own right, then that's awesome too.

If anyone is interested in help out on either project, feel free to contact me.

Monday, March 3, 2008

Bash and command line (terminal)

OK, so you've undoubtedly come across some problem and found a post which says you need to open a terminal and run some series of commands. You ask yourself, what is this terminal and why am I typing commands and what do they mean?

Well, using a terminal program like konsole or xterm simply allows you to access the bash shell from your session. Think of the bash shell as a DOS session on steroids.

Bash stands for the "Bourne Again SHell", and is a collection of commands which allow you to program via a series of commands, scripts and system programs which can either be called directly from the CLI (command line interface) or saved in a text file and executed directly from there or at some later time.

In fact, all the core start-up scripts for Ubuntu's (and most Linux) system are bash scripts, which tell the system what services to start/stop and when to do this.

I highly recommend that anyone using a Linux distro learn at least some basic bash. There are plenty of great resources on the net, like the Linux Documentation Project and the Bash homepage.

To give you a brief example, I'll explain some common commands:

cd - change directory (ex: cd /etc/apt). Use this command to specify a directory to work from called CWD (current working directory). You can also type 'cd' by itself to return you to your home directory, or use 'cd ..' to go up/back one directory.

ls - list contents of the CWD or directory/file (if specified) (ex: ls *.odt).

rm - remove a file (i.e. delete it) (ex. rm test.txt)

mv - move/rename a file (ex. mv *.odt Documents/)

man - man page which give more explanations than I have on above (ex. man ls)

Anyway, be adventurous and read a litle on bash. You will find it is not all that difficult or scary to perform simple and basic tasks with ease.