Linux Blog

Bash Aliases

Filed under: General Linux,Linux Software,Quick Linux Tutorials — TheLinuxBlog.com at 12:23 pm on Wednesday, June 25, 2008

Have you ever wanted to make a command for something that did not exist? Perhaps modify the functionality of a particular application to something more suitable? I know I have. For example, and I know that there is probably a better way to do this, but on certain Linux machines (such as servers), I like to clear the output before exiting. While I can type the command:

 clear; exit

this still leaves me with a line at the top of the screen. Some distributions clear this automatically, for those that don’t an alias can be used.The basic principal for a bash alias is easy. You set an alias up and then use that alias instead of the command.
It appears that aliases have precedence over any already existing applications in the path so it becomes handy if you wish to override a command or perform a task before launching a built in command. I’m sure that this option can be changed if needed.

Now you know what aliases are here is how to use an alias to override the exit command in bash.

alias exit="clear; exit > /dev/null 2&> /dev/null"

Aliases with parameters can get tricky, the best workaround I have found is to write a shell script and put it in your local bin directory.

Two Screens, Two Linux Boxes – One Keyboard and Mouse

Filed under: General Linux,Quick Linux Tutorials — TheLinuxBlog.com at 8:50 am on Wednesday, September 26, 2007

Ever wished you could use your keyboard and mouse on another computer? In this article I will show you how.
To read it it should take about 60 seconds. In this time I’ll show you how to use one keyboard and mouse on two Linux machines. I’ll cover how to use the same keyboard and mouse on a Linux and Windows machine in another article.

Ready? Lets go!

First Decide which keyboard and mouse you want to use across multiple monitors on different machines and sit at that computer. The program needed to get this to work is called x2x.
As of this writing the stable version is 1.27

Download the stable version from http://x2x.dottedmag.net/

wget http://x2x.dottedmag.net/releases/x2x-1.27.tar.gz

Extract The Source code

tar xvzf x2x-1.27.tar.gz

Compile x2x

./configure && make && make install

If x2x compiled without any errors you should be good to run the program.
On the computer you want to use your primary keyboard and mouse on do the following:
Find out your IP

/sbin/ifconfig ethX

Run xhost to allow clients to connect to your display:

xhost +

Going back to your original computer decide which side of the monitor you want your mouse to jump to the other computer on. It will either be North, South, East or West. If your second linux box is on your left like mine, it will be west.
Now lets get the two computers connected with the same keyboard and mouse:

x2x 192.168.X.X:0.0 -west

Thats all there is to it. You should be able to mouse over the right of your screen and see your mouse cursor on the other computer.

Low cost PC’s in China. Is Linux about?

Filed under: General Linux — TheLinuxBlog.com at 11:56 pm on Monday, August 6, 2007

I was listing to NPR late yesterday evening on my way home from work. There was an interesting tech talk going on about computer manufacturers in China. Notably Dell and Lenovo (IBM). They are both offering PC’s for around $199. The Dell ships with Windows, but I am unclear on what the Lenovo ships with. Since the dirt cheap Dell ships with a monitor, keyboard & mouse but its competitor the Lenovo desktop only ships with a keyboard & mouse. A television is used for the monitor. It makes me wonder what OS the Lenovo is running.

Apparently the Lenovo shipped in April. There are rumors that Microsoft, one of Lenovos partners has been cooperating with the company to deploy Linux machines. Microsoft pushing Linux in China? Thats a interesting concept, but in my opinion there is nothing wrong with it. It does make me wonder if even Microsoft has come to the conclusion that the cost of Windows is too high.

There is a huge market for low end PC’s in China the NPR radio show reported. With 800 million potential customers who wouldn’t attempt to make a profit if given the chance? What better way to maximize profit then to use an operating system with a such a low cost to maintain? Given the potential customers are mostly rural farmers that earn only $600 a year its possible that they could still afford a computer if they saved up for a while. The show also went into say that the computer could be a powerful tool for the farmers. I agree with this in that they would be better able to predict when to buy and sell produce. They could check the weather to make sure that grounds are soft for planting crops the next day.

The low end computers would be a good asset to own. I am proud of the Linux operating system if the rumors are true. I wish the best to Lenovo and Dell and hope they are successful in their business in China.