web analytics

Archive

Author Archive

vi Command list for Command Line Editing

September 16th, 2009 No comments

As you already know, Linux has some things that require command line even for user tasks. Most of them are connected with file modification. There are some ways to alter files from command line, and one of the most effective seems to be vi. It is a powerful editor that comes with lots of functions and if you know its hotkeys, it will save you lots of time. Some people say that it cannot be compared even with Windows text editors. So let me show you several things that will make your interaction with vi more pleasant.

We’ll start with cursor control, as it’s the first need when you open a file.

h Left
j Down
k Up
l (or spacebar)    Right

Of course, you’re welcome to use keyboard arrows if you like them so much. There are some more complicated manipulations, so let me show them. These commands will help you to navigate between your file text in a smart way.

w Forward one word
b Back one word
e End of word
( Beginning of current sentence
) Beginning of next sentence
{ Beginning of current paragraph
} Beginning of next paragraph
[[ Beginning of current section
]] Beginning of next section
0 Start of current line
$ End of current line
^ First non-white character of current line
+ or Return (Enter)    First character of next line
- First character of previous line
n | character n of current line

If your file takes some screens, there are some commands for screen movements.

H Top line of current screen
M Middle line of current screen
L Last line of current screen
nH n lines after top line of current screen
nL n lines before last line of current screen
Ctrl-F Forward one screen
Ctrl-B Back one screen
Ctrl-D Down half a screen
Ctrl-U Up half a screen
Ctrl-E Display another line at bottom of screen
Ctrl-Y Display another line at top of screen
z Return (Enter)  Redraw screen with cursor at top
z . Redraw screen with cursor in middle
z – Redraw screen with cursor at bottom
Ctrl-L Redraw screen without re-positioning
Ctrl-R Redraw screen without re-positioning

Of course, there are some commands related to search and moving between line numbers.
/text Search for text (forwards)
/    Repeat forward search (Just like F3 in Microsoft Windows)
?text Search for text (backwards)
? Repeat previous search backwards
n Repeat previous search
N Repeat previous search, but it opposite direction
/text/+n    Go to line n after text
?text?-n Go to line n before text
% Find match of current parenthesis, brace, or bracket (very useful for programmers).
Ctrl-G Display line number of cursor
nG Move cursor to line number n
:n Move cursor to line number n
G Move to last line in file

As you can see, there are lots of ways to navigate within a file. Let’s start with wile editing commands, they aren’t less interesting.

A Append to end of current line
i Insert before cursor
I Insert at beginning of line
o Open line above cursor
O Open line below cursor
ESC End of insert mode
Ctrl-I Insert a tab
Ctrl-T Move to next tab position
Backspace Move back one character
Ctrl-U Delete current line
Ctrl-V Quote next character
Ctrl-W Move back one word
cw Change word
cc Change line
C Change from current position to end of line
dd Delete current line
ndd Delete n lines
D Delete remainer of line
dw Delete word
d} Delete rest of paragraph
d^ Delete back to start of line
c/pat Delete up to first occurance of pattern
dn Delete up to next occurance of pattern
dfa Delete up to and including a on current line
dta Delete up to, but not including, a on current line
dL Delete up to last line on screen
dG Delete to end of file
J Join two lines
p Insert buffer after cursor
P Insert buffer before cursor
rx Replace character with x
Rtext Replace text beginning at cursor
s Substitute character
ns Substitute n characters
S Substitute entire line
u Undo last change

And we finally come to file manipulation commands as we will need to save (or not) our changes.

:w Write file
:w! Write file (ignoring warnings, force writing)
:w! file Overwrite file (ignoring warnings)
:wq Write file and quit
:q Quit
:q! Quit (even if changes not saved)
:w file Write file as file, leaving original untouched
ZZ Quit, only writing file if changed
:x Quit, only writing file if changed
:n1,n2w file Write lines n1 to n2 to file
:n1,n2w >> file Append lines n1 to n2 to file
:e file2    Edit file2 (current file becomes alternate file)
:e! Reload file from disk (revert to previous saved version)
:e# Edit alternate file
% Display current filename
# Display alternate filename
:n Edit next file
:n! Edit next file (ignoring warnings)
:n files Specify new list of files
:r file Insert file after cursor
:r !command Run command, and insert output after current line

As you can see, the number of vi commands is really huge. If you get acquainted to this editor, you won’t even try anything else, the professional programmers say. If you need vi to edit files (e.g. crontab modification), you will find all the necessary commands above.

Have a good time with vi! :-)

Asustek Eee Keyboard Will be Available in October

September 15th, 2009 1 comment

EEE Keyboard will appear in Europe and USA in october. This is another interesting device from Asustek, and we’ll take a closer look at it.

The Eee Keyboard looks like a computer keyboard. It also has a 5-inch touchscreen on the right-hand side of the board, and all the device components are located inside it. Screen size is too little, that’s why it is supposed that the device will be connected to an external display.

asustek eee keyboard will be released in october

asustek eee keyboard will be released in october

Asustek declared the device to be for household use. “We want to make the product useful for many things in the house, the home PC and LCD TV, for example,” said Jerry Shen, CEO of Asustek. It really should be much smaller than an usual home PC, so the only factor that could limit its usage is the price.

The Eee Keyboard has all major interfaces: Wi-Fi 802.11b/g/n, Bluetooth 2.0 and Ultra Wideband HDMI, in addition to ports for a number of connections, including USB 2.0, a VGA port, HDMI ports, and connections for speakers (headphones) and microphones.

EEE Keyboard has a 1.6GHz Intel Atom microprocessor inside, 1GB of DDR2 DRAM and an on-board 16GB or 32GB SSD (solid state drive) to store data. There is no information about video yet, but I suppose it won’t be great for such a device.

Device weight is 1.1 Kg, just like an EEE 901. It should appear in the shops around the world at October, 22, among with the appearance of Windows 7. The price is expected to be between $400 and $500, that’s quite expensive but EEE keyboard represents something new and I think they will sell a good amount of these devices.

Free Software: The History

July 14th, 2009 No comments

Free software

Nowadays free software is so widespread that it’s hardly possible to find a user who doesn’t use at least some free applications. Moreover due to the fact that free software is very similar in functionality with the proprietary one, it’s understandable why many people tend to choose it. But what does “free software” term mean? Let’s check the precise definition.

Free software represents software that is generally distributed with a “free software license” and can be used, studied, modified, and redistributed without or with minimal restrictions. To be more precise, here are the four freedoms which show that the software you get is free:

  • The freedom to run the program, for any purpose (freedom 0).
  • The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this as well.

However it should be mentioned that free software is not the same thing as “freeware”. The main difference between them consists in the fact that in case of freeware authors (or copyright holders) retain the rights to the software, i.e. users generally cannot study, modify or redistribute it. In addition to that free software being redistributable sometimes may not be free of charge, but cost some money, though the prices are generally quite affordable ones.

While talking about the “free software” term the great majority of users associate it with Linux OS and Linus Torvalds, thinking that they represent the source of free software. Though Linux, with no doubts, is the most popular free OS, there are two very important points to be emphasized…

  • The appearance of the free software is the merit of Richard Stallman who is considered to initiate the free software movement in 1983. The main purpose of that movement was to satisfy the need for and ensure “software freedom” to computer users. Moreover in 1985 Stallman creates the Free Software Foundation in order to provide the organizational structure for his free software ideas.
  • Linux is just a kernel, but the operating system is GNU (GNU is Not Unix). GNU project was launched by Richard Stallman in 1983 with the aim to develop a complete Unix-like operating system composed entirely of free software. Thus this combination should be called as GNU/Linux operating system; still it’s generally incorrectly called Linux. However, Linus Torvalds who wrote Linux kernel in 1991 is against the GNU/Linux naming, arguing that Linux is not a GNU project.

Appearance of free operating systems

The main principles of free software – openness and cooperation – appeared a long time before Richard Stallman created the Free Software Foundation and introduced the “free software” term. Thus in the 1950s and 1960s almost all software was developed by academics and corporate researchers being not considered as a commodity. At that time source code was distributed with software because users often modified it in order to fix bugs and add new functionalities. That’s why Richard Stallman stated in 1971 when he became a programmer at the Artificial Intelligence Laboratory of MIT (Massachusetts Institute of Technology) that the “software sharing community at MIT existed for many years”.

However in the late 1960s and 1970s the situation began to change. The main reason for that consisted in the fact that manufacturer’s software costs were dramatically increasing. Although some software was still free, the amount of proprietary one was becoming more and more significant. As a result in the late 1970s and 1980s most of the computer vendors and software companies charged for software licenses, considering them as assets and imposing legal restriction on the development of new software.

So here are the most important prerequisites of Stallman’s Free Software Movement and the appearance of free software:

1) High cost of the operating systems available at that time (MS-DOS, Unix and etc.), i.e. they were available for a very limited amount of users

2) Paying extra money for the operating system while buying computer made it even harder for a person to get one

3) Providing no source code for the systems meant:
-  The users weren’t able to study the OS in order to understand the way it worked or to use it as a basis of their own work
-  There was no way to adapt the system to users’ needs
-  Users weren’t able to fix the bugs or improve the system

4) Proprietary licenses meant that the operation systems were not for sharing, thus slowing down the speed of OS improvement because there were less bug reports.

5) Slower development of software in comparison with hardware. In case of proprietary software it’s irrational to release new versions very often, because the users knowing that a better version is going to appear soon, won’t spend money to get the current version and etc.

As a result on September 27, 1983 Richard Stallman announced the plan for creating the GNU operating system, having the goal of bringing a wholly free software operating system into existence. The software development itself began in January 1984. Later on in March 1985 all the ideas of Richard Stallman were published as the GNU Manifesto. Most of GNU has been written by volunteers (some in their spare time, some paid by various companies, educational institutions, and other non-profit organizations.

Stallman contributed a lot in propagation of the “share with the neighbor” idea, giving the users the opportunity to be able to study, modify and redistribute the software that they use. According to Stallman’s point of view “freedom is vital for the sake of users and society as a moral value” and not for developing technically superior software; thus he does not agree with the phrase “software wants to be free” which is often mistakenly attributed to him.

Creating Linux Kernel

Before we go on with the history of creation of Linux kernel let’s find out what the main reason, which provoked 21 year-old Finnish student of Helsinki University of Technology, Linus Torvalds, to start that project, was. Though there wasn’t the only reason, the most important one is considered to be the fact that in 1991 no operating system was well adapted to the 32-bit features of the increasingly cheap and popular Intel 386 architecture for personal computers (MINIX had 16-bit design, but GNU and 386BSD kernels were not available at the time). Later Linus Torvalds stated that if either the GNU or 386BSD kernels were available at the time, he likely would not have written his own.

Despite the fact that the project of Linus Torvalds became well-known as the Linux kernel, initially it was a terminal emulator, which he used to access the large UNIX servers of the university. The program was written just for the specific hardware Linus was using at that moment (PC with an 80386 processor). As he wrote in Just for Fun, he eventually realized that he had written an operating system kernel.

Taking into consideration that Linus Tovalds developed it on Minix using GNU C compiler some of the researchers stated that young software engineer used Minix code while created the kernel. The main reason for such a statement was the time Linus spent on his invention. If Tanenbaum created Minix within some years, for Torvalds it took a couple of months to create Linux kernel. Another thing was that as a student Torvalds had access to Minix’s source code. However as Tanenbaum emphasized in his book Samizdat, Torvalds had not copied Minix’s design. Here is a short excerpt from his book:

“But the code was his. The proof of this is that he messed the design up. MINIX is a nice, modular microkernel system […] Linus rewrote the whole thing as a big monolithic kernel, complete with inline assembly code. The first version of Linux was like a time machine. It went back to a system worse than what he already had on his desk. Of course, he was just a kid and didn’t know better (although if he had paid better attention in class he should have), but producing a system that was fundamentally different from the base he started with seems pretty good proof that it was a redesign…“

The unfriendly tone of this excerpt can be explained by the fact that there was quite an unpleasant Tanenbaum-Torvalds debate about Linux, which Tanenbaum considered to be obsolete since it was a monolithic kernel. However later on Tanenbaum’s prediction proved to be incorrect.

On 26th of August, 1991 Linus Torvalds posted his famous message to comp.os.minix, in which he wrote about the creation of free operating system for 386 AT clones. Since that time a lot of users contributed code to the project. The Linux version 0.01 had 10,239 lines of code and appeared by September 1991. It was just the kernel and as Linus mentioned “to get a working system you need a shell, compilers, a library etc. These are separate parts and may be under a stricter (or even looser) copyright. Most of the tools used with Linux are GNU software and are under the GNU copyleft…”

With the release of version 0.12 in February 1992 GNU General Public License (GPL) was adopted instead of the previous self-drafted license, which did not allow commercial redistribution. In March 1992 Torvalds decided to make a large jump as far as the version number was concerned and the new release was the version 0.95. The explanation was that there wasn’t so much work left until the final release of the version 1.0. Unfortunately that was too optimistic and the version 1.0.0 appeared just in two years. AS for the current latest version 2.6.30 it appeared on 9th of June 2009 and contains 11,637,173 lines of code.

Another interesting point I forgot to mention is the appearance of the Linux name… Although Torvalds considered the name “Linux”, he decided not to use it because to his mind it was too egoistical. So the name he wanted to call his invention was Freax – combination of “freak”, “free” and “x” (from Unix). However his coworker at the university, Ari Lemmke, didn’t think that Freax was a nice option, deciding to call it Linux (Torvalds didn’t know about that). Later as Linus found out about the name Ari gave to the project, he agreed it.

Although Linus Torvalds did not design Linux to be portable (he especially emphasized that “it is NOT portable, and it probably never will support anything other than AT-hard disks, as that’s all I have…”), at the moment Linux represents one of the most widely ported operating system kernels. As for the end of 2008, GNU/Linux was used on more that 87% of systems on the Top 500 supercomputers list. In addition to that it has been ported to different mobile and handheld devices. Moreover the Android operating system, which becomes very popular these days and is considered to have very decent potential, uses the Linux kernel as well.

The Bottom Line

As far as the license is concerned at the moment Linux is licensed under version 2 of the GPL, with no option to use a later version. Here are some of the terms and conditions of the GPL:

- Licensee is given permission to modify the work, as well as to copy and redistribute the wok or any derivative version
- Licensee is allowed to charge a fee for this service if he/she wants to
- Distributor may not impose “further restrictions on the rights granted by the GPL”
- Programs distributed as pre-compiled binaries are accompanied by a copy of the source code ad etc.

However, according to the terms of the GNU GPL if no version is specified, then any version may be used. Still currently the great majority of the kernel programmers prefer GPL version 2 that version 3. If you would like to learn more about GNU GPL and its versions, please visit this page.

To sum up we should say that Linux and GNU developers, and many others who contributed to the design of GNU/Linux OS, manage to create a really functional, competitive and customizable operating system, which corresponds to all four Stallman’s freedom, ensuring thus the real freedom to the users.

Instant Messaging Solutions for Linux

July 7th, 2009 No comments

It won’t be an exaggeration to say that at the moment every single Internet user has at least one instant messaging client installed. It’s really hard to imagine that there is someone who does not use IM clients to communicate with other people; moreover the variety of IM clients is so great that everyone is able to choose the one he/she needs. That’s why the ability to use IM clients while switching from Windows to Linux OS has to be taken into consideration as well.

Though some Windows users may think that on Linux there are not so many IM clients to choose from, in reality the amount of counterparts is very significant. In the given review we are going to discuss the major Linux alternatives to Windows IM clients in order to demonstrate that there is no need to worry about the possibility of losing functionality of the IM client you prefer.

IM Protocols and Clients

ICQ

ICQ is a popular instant messaging service, the first version of which was released in November 1996. Since that time ICQ became one of the most popular instant messaging clients (at the moment it’s used by over 38 million users worldwide). The name ICQ is a homophone for the phrase “I seek you”. ICQ uses OSCAR (stands for Open System for CommunicAtion in Realtime) protocol that is a flagship instant messaging protocol of America Online (AOL). OSCAR protocol is used in AIM as well; as a result ICQ and AIM users are able to add each other to their contact list without the need for any external clients.

The latest version of ICQ (ICQ6) launched in April 2007 has the following most important features: sending text messages, offline support, multi-users chats, free SMS from ICQ to mobile, multiplayer games, animated icons, greeting cards, voice and video communication.

ICQ users are identified by numbers called UIN (meaning either Universal Internet Number or Unified Identification Number) which represent names assigned to each ICQ user. Moreover since ICQ6 appeared users have the opportunity to log in using their email addresses.

Although ICQ is very popular among the users there are some really important issues for which it has been heavily criticized. Here are the most important ones:

Spam – many users have to install antispam-bots, because ICQ is often used for distribution of spam and unwanted advertisement

Message delivery – proper message delivery is not guaranteed

Aggressive policy regarding alternative clients – American Online implements a lot of different changes to stop unauthorized ICQ clients working

Privacy and copyright – the acceptance of ICQ Terms of Service means that ICQ may publish or distribute any messages which were sent through the system that could be meant to be private

As far as the programs for Linux are concerned I would like to emphasize that the great majority of them support the most popular protocols giving users the opportunity to communicate everyone they want. Here are the most popular ICQ clients which run on Linux OS:

  • Kopete supports AIM, ICQ, MSN, Yahoo, XMPP, Google Talk, IRC, Gadu-Gadu, Novell GroupWise Messenger and others, for Unix-like;
  • Licq supports ICQ, AIM and MSN, for Unix-like;
  • Pidgin (formerly Gaim) supports ICQ, Yahoo!, AIM, Gtalk, MSN, IRC, XMPP, Gadu-Gadu, SILC, Meanwhile (IBM Lotus Sametime) and others;
  • qutIM Qt-based, cross-platform;
  • Sim-IM supports ICQ, Yahoo!, AIM, MSN, XMPP, for Windows and Unix-like and others.

File Sharing Becomes Easy: Opera Unite

June 18th, 2009 No comments

Today the Opera Software company has formally introduced a new technology, Opera Unite. According to the developers, Opera Unite can do the server from any computer. Using this feature, you can communicate with other users directly avoiding usage of online services and applications. This technology allows better control for private data usage in the public domain. Users also have remote access to their computers with any other dеvice equiррed with a modern web browser.
opera unite launched

Opera Unite Services are based on the same standards as the Web sites. It simplifies the creation of new applications, based on Opera Unite. Opera Unite technology is available in a special version of Opera browser 10, which is available for free download at Opera Labs.
The Opera Unite Services works right in your browser. This time users have the following free services:

File Sharing. With this application you can grant access to files on your computer to other users. In this case, don’t need to pre-load these files to the specialized online services. You must select on your local disk folder, and Opera Unite generate a direct link to this folder.
Web Server. This service allows you to run a website from your computer. Just choose to local disk folder with the files the web site and allow access to it from outside.
Media Player. Media player provides access to the music of the user wherever they are located and from any computer. Just choose the folder with the music collection in MP3 format and allow access to it. You can open the direct link of Opera Unite in any browser.
Photo Sharing. Now you can share photos directly from your computer without sending the files to online services. You must select the folder of photos on a local disk, and the application form a gallery of thumbnails. Full photos are downloaded by clicking on the thumbnail.
The Lounge. With this service you can organize chat with your friends right on your computer. Friends may join the conversation by clicking on the link directly, without having to register with any online service. Depending on the plants, just tell them the password to enter the chat room.
The Fridge. This service makes it possible to attach a note to the virtual refrigerators friends. You can exchange messages with them in safe mode and in real time.

Here is the screenshot of this page:

operau2

This service will allow easy file sharing for users without experience. Also there is nothing to install and remote access can be set up with any operating system. That’s another great tool from Opera Software: I like their browser and of course, Opera Mini…