Linux Blog

Remotely Changing Windows Volume

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:41 pm on Sunday, October 18, 2009

This is not really “shell scripting” but the end result is some more bash scripts in my bin directory so what the hell? It’s going in the shell script section because its Sunday. So what?

I like to listen to music on my Windows box while I work on my Linux box. Online radio and other sounds, just get in the way too much. One of the things I wanted to do for a while was remotely control my volume so I didn’t have to use my KVM to switch over to change the volume when ever anyone came in my office.

Its actually pretty easy to control your windows volume from Linux.

At first I thought, I’d create a dummy audio device, and some how map it over. Then I figured that was overkill and I’d try something a bit easier. I have SSH via Cygwin, so all I needed was a way to control the volume locally, and I could execute the command with SSH. Having no volume utilities jump at me when I looked through the Cygwin repositories I went to look for something else.

NirCmd is an awesome utility, giving me and other Windows users the ability to do things that Linux users may take for granted, you can read about it here: http://www.nirsoft.net/utils/nircmd.html after installing it, and making sure that my corporate AV didn’t throw a hissy, it was just a matter of dumping some scripts in my bin directory and chmodding them so they would run.

Here is what they look like:

Volume Down Script: ssh windowsbox -l owen -C “nir changesysvolume -2000″

Volume Up Script: ssh windowsbox -l owen -C “nir changesysvolume 2000″

Mute: ssh windowsbox -l owen -C “nir mutesysvolume 1″

Unmute: ssh windowsbox -l owen -c “nir mutesysvolume 0″

Real simple, and the mute/unmute really comes in handy for when some one walks into my office.

Whats your take on proprietary software?

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 11:57 am on Monday, August 4, 2008

Using proprietary software to some Linux users is considered a sin, right up there with not reading the manual. Not everyone that runs Linux feels this way. I for one don’t mind using a commercial / propriety product if the product serves the purpose well, and perhaps better than an open source implementation.

Take VMWare server for example. Although it does have its problems, it works very well for virtualization. Its pretty stable, has a good interface, works well and most of all is free. I have no problem installing and using this as long as it works.  I’ve been using it for a while, its what I’m used to and I have no problems with it. The moment VMWare Server stops working, I’ll try to find another alternative. Be it open source or not.

I don’t get why some people are so into the open source movement. Not tainting a system to me has no clear advantages. If I were to not install any proprietary software I would hardly be able to use my Linux box. Think about it, no Java (ok, I’d have the IcedTea runtime and GCJ), but no supported Java for Tomcat / Eclipse, I’d have no Flash, hardly any video codecs and no 3D accelerated graphics. My virtualization, may or may not work depending on what day of the week it was or if I had supported hardware. There is probably a whole lot more that I am missing that I don’t even know about.

So, I’m just interested to know what is every one else’s take on using proprietary software? Am I alone in being “fine” with installing closed source / proprietary software? Is my computer going to go to robot hell and sing with Bender for eternity? Please let me know your thoughts.

Linux Performance Boosting – Graphics

Filed under: General Linux — TheLinuxBlog.com at 12:24 pm on Thursday, July 31, 2008

Is your Linux box chugging along? Does it take a while for web pages to load or to boot up? Does your screen lag when you scroll a web page?

Well my friends, you’ve come to the right place. The issue with your Linux box performing poorly could be a graphics issue. A lot of distributions do not install the correct graphics drivers by default. Yes, your graphical user interface might work, but without the correct Linux graphic drivers you will not get the performance that you should be getting.

Linux has a default video driver called VESA, most video cards work with this driver but perform poorly. The reason behind this is VESA uses the CPU to do graphics processing and does not rely on the video card for 3D acceleration. If you have a 3D accelerated video card (most ATI / NVIDIA’s I will not go into detail here) then you might be able to offload graphics processing from your CPU onto your GPU.

Here is how to test to see if your frames per second if you are using the VESA standard driver:

 

[owen@LinuxBlog ~]$ glxgears
2623 frames in 5.0 seconds = 524.096 FPS
1677 frames in 5.0 seconds = 334.784 FPS
1948 frames in 5.0 seconds = 389.488 FPS
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:0.0″
after 19707 requests (19415 known processed) with 0 events remaining.

Now, the performance of this machine is quite good so the resulting frames per second (FPS) is not too shabby, but its not the best either. After installing the correct Linux video card driver for this Linux box lets take a look at what kind of performance I get:

[owen@LinuxBlog ~]$ glxgears
6179 frames in 5.0 seconds = 1235.749 FPS
6558 frames in 5.0 seconds = 1311.449 FPS
6489 frames in 5.0 seconds = 1295.583 FPS
XIO: fatal IO error 22 (Invalid argument) on X server “:0.0″
after 39 requests (39 known processed) with 0 events remaining.

As you can see from the results the graphics driver make a huge difference in the number of FPS I can achieve, but this is not the only benefit from using the correct 3D accelerated driver. When the correct driver is installed, the graphics card does most of the work therefore freeing up the CPU do other tasks. Its a win-win situation, so get your graphics card set up properly today!

BSOD Humor

Filed under: General Linux — TheLinuxBlog.com at 11:36 am on Monday, July 7, 2008

Had a great time yesterday, a friend of mine came over. After dinner he was looking at some t-shirts since an advertisement had distracted him from his initial IMDB search. Some how this made him decide he wanted to make my desktop background a BSOD. I’m a big fan of the BSOD screensaver, and think its funny, whats even funnier is he figured out how to change my background on KDE (although it’s not that hard)

I saw the BSOD with the horrible background just staring at me. It was the classic, “there was an error processing your error”. I never see such things on my Linux box, I’m more used to failed reboots from failing to compile a kernel feature, so jokingly I click on the message box while laughing:

“Why won’t this go away”

Some people find humor in other peoples agony, this is why the TV series (and movies) Jackass do so well. I find humor in BSOD’s and hope that other Linux admin’s do to. But having a BSOD on your Linux box that’s not a screen saver is quite annoying, its like “Gates strikes back”

Here’s a poster I found amusing the other day:

Credit http://www.joyoftech.com/Billy Gates

Linksys NSLU2 – A Great Linux Box

Filed under: Linux Hardware — TheLinuxBlog.com at 2:35 am on Friday, March 21, 2008

This is a piece of hardware that I have owned probably for about two years now. I thought that it had died therefore it sat in my box of unused computer crap probably for about a year and a half. The other weekend I took this little gem back out of this box and actually un-bricked it. It was a bit of a pain to get it working again from its unusable state. It would never boot up, never beeped. Just stopped with an orange light, I really thought it was toast. So I tried the redboot method (regular upgrade method would not work) and it actually went into redboot. After flashing its memory and reloading firmware I was able to get a some what working Linksys NSLU2.

Now thats over with, naturally after having Linksys’s NSLU2 back to its original state, I had to fix it again. That is install Linux on it. The Linksys NSLU2 already runs Linux so there are a few options on how you can get Linux on the Linksys NSLU2. I opted for the easier install this time which is Unslung. My theory with this was, it has a lot more packages then when I first saw Unslung and my Debian Installation was what bricked the poor little slug. So, now I have a great Linksys NSLU2 that is sitting serving up files and is available to run lightweight applications.

I highly recommend the Linksys NSLU2 to anyone wanting to play around with Linux. It is so easy to get started with and they can easily be picked up for under $100. You don’t need anything special to use the Linksys NSLU2. Windows, Linux, MacOSX and anything with a Telnet or SSH client will work. There are so many things that you can do with Linux on an NSLU2 the options are endless. What are you waiting for? Grab one today!

Zend Studio Unexpectedly Quit Fix

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 6:43 am on Monday, January 21, 2008

Zend Studio is a really good PHP IDE for Linux well worth the money. Although it has a high price tag this doesn’t mean that its bug free. I some times have little quirks with it but they seem to have been fixed since I added more ram. Anyway recently while I was trying to use Zend it just would not open. I had to use another PHP IDE on my Linux box until I could figure out the problem. Well, the problem was:

This Application has Unexpectedly Quit: Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)

Reinstalling Zend does not fix the issue. The issue seems to be in the configuration directory. All you have to do to fix this issue is:

rm -r ZDE

I’d make a back up first if I were you, just incase, but mine was broken and I didn’t really have anything in the config directory except some saved urls so I just deleted it. Now my Zend Studio works like it used to again! Hurray!, Now I hope it wont do this again for another 6 months or so.

My Linux Box has a new video card!

Filed under: General Linux,Linux Hardware — TheLinuxBlog.com at 12:10 am on Friday, December 7, 2007

NVIDIA GeForce 4 Ti 4200 AGP 8X Driver IssueI’ve got a new to me video card to temporarily service as my video card until I can get a cooling kit for my GeForce FX 5200. Its an older GeForce 4 Ti 4200 AGP8X. I thought it would be as simple as plugging it into my agp slot, turning the computer on and re-installing the NVIDIA driver module but I was wrong.

The problem is, since this is an older card I have to use a legacy driver:

WARNING: The NVIDIA GeForce4 Ti 4200 with AGP8X GPU installed in this system
is supported through the NVIDIA 1.0-96xx legacy Linux graphics
drivers. Please visit http://www.nvidia.com/object/unix.html for
more information. The 100.14.11 NVIDIA Linux graphics driver will
ignore this GPU.

If you can’t see the screen shot click it. Its basically a pretty version of the above error message that tells me that I need to use the: “NVIDIA 1.0-96xx legacy Linux Driver”. Here is the download page for the driver if your running into the same problem: http://www.nvidia.com/object/linux_display_x86_96.43.01.html

You can temporarily use the “nv” driver in your XORG configuration but be warned this is not accelerated so you should just use it to download the legacy driver, quit X and then install the accelerated one. Unfortunately I could not get links or lynx to download from nVidia’s site because of some strange javascript code. I find it Ironic that the Unix drivers page isn’t even compatible with the basic Unix browsers.

Video Card Failure.

Filed under: Linux Hardware — TheLinuxBlog.com at 11:59 pm on Thursday, November 29, 2007

Linux Blog - Video Card

At the moment I am a little unhappy with my Linux Box. It was making funny sounds (more than normal) the other night so I decided to turn it off. When I turned it back on, it was making even more racket. Turns out that my video card has been toasted, literally. The picture on the left shows the damage. Its pretty evident that the fan stopped spinning and burned up.

So much for my 128MB GeForce FX 5200.

I have an older GeForce laying around somewhere but I’ll have to use the legacy drivers. Until I find the card don’t fear I’ll be continuing to blog on my laptop. Which isn’t the best machine to use, but it will get the job done. Also from this experience I have thought of an blog post to write: dealing with hardware failure.

Secure VNC By Tunneling with SSH.

Filed under: General Linux,Quick Linux Tutorials — TheLinuxBlog.com at 10:09 pm on Saturday, October 13, 2007

Introduction
Remote administration is either a luxury of necessity when it comes to computing. I don’t know how many times I’ve heard people say they would like to be able to remotely access their files or us their computers. Luckily for Linux users this is an easy task.
VNC (Short for Virtual Network Computing) is used to open up a window of a remote desktop. It was created by Olivetti & Oracle Research Lab and acquired by AT&T, now there are many different flavors of VNC servers and clients available. I recommend the use of TightVNC and x11vnc.

Security
VNC is not a secure protocol by default, passwords and data are transmitted in clear text and can be sniffed by any malicious user. To resolve this problem I introduce SSH Tunneling. As we all know SSH is a secure remote shell and with this we can tunnel ports to create a secure connection.

Server Setup
The First step is to have a VNC server running on the box. I like to use x11vnc as it uses the current X session if its available. After x11vnc is installed make sure that X and x11vnc are running.

Client Setup
On the client a VNC Client is needed any client will do but I recommend using TightVNC or RealVNC.

Commence the tunneling
Once the server and client are set up a SSH connection will have to be set up with local to remote port forwarding. The syntax for this command is:

ssh [-R [bind_address:]port:host:hostport] [user@]hostname

To setup a connection from my laptop to The Linux Blog:

owen@linux-blog-lappy:~$ ssh -R 5999:192.168.1.x:5900 thelinuxblog.com

The “-R port:host:hostport” Portion of the command is the part that sets up the port forwarding. In my above example its telling the SSH client to forward localport 5999 to port 5900 on 192.168.1.x (my laptops IP). Once your SSH connection has been made the VNC Client on your local Linux box can be started.
Each client is different but with TightVNC from your run prompt or terminal you can just type:

vncviewer localhost::5999

This will open up the VNC client on your local machine, connect to your local port that you set up in the SSH connection and tunnel all information through the secure connection.

Conclusion
Voilla! There you have it, you can now use SSH and VNC in unity to achieve secure VNC communications. Neat!

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.

Avoid The Apple Keyboard: Sexy Brushed Aluminum Alternatives

Filed under: General Linux — TheLinuxBlog.com at 10:51 pm on Friday, August 17, 2007

I feel a bit goofy tonight so I figure I’ll make an attempt at a post that might make a few people giggle and catch a few others on fire. This post is going to be about Apples new keyboard, or as I like to call it the iKeyboard.

Don’t get me wrong I do like the look of Apples new keyboard but brushed aluminum keyboards are nothing new. To be quite honest for a company being largely based on style I’m quite surprised that they hadn’t released one sooner. The previous white plastic one was a fantastic keyboard to use and there was also the bluetooth version. The new one is a complete redesign. The plastic has gone and it has a new modified layout. They removed the Apple icon from the Open Apple button and its now been replaced with the word command, they also moved the function key to where the insert button is suppose to be and changed the num pad layout a bit. Now with all of the layout changes and being used to a standard keyboard I don’t think I would be able to use one properly let alone justify buying one.
Having a fancy keyboard is nice. An elegant design feel and a quiet keyboard is what in my books makes a nice keyboard. Most standard keyboards can’t touch the look of the new Apple keyboard so I set on a quest to find the ultimate Linux keyboard.

The Linux Friendly Keyboard Requirements I came up with:

  • Must be compatible with Linux out of the box.
  • Must be brushed aluminum to match the look of the iKeyboard and clash with my other ugly hardware.
  • Must be thin and light but also strong so that I can’t break it when I smash it because my code isn’t working or WordPress fails to format my blog post correctly.
  • Wireless would be a plus but is not needed.

After some searching I found three keyboards that match my criteria. I have my findings listed below:

Speed-link Keyboard
This keyboard from [speed-link] is a pretty slick design. Its pretty like Apples new keyboard, it has media shortcuts that I will never use and they also re-arranged the keys so I’ll have to re-learn a keyboard layout. Thats perfect! Just kidding, they have an U.S layout available and there is a review of it here: [altgamer.org]
Its about the same price as the Apple keyboard and its not completely aluminum the base is actually made of plastic but I don’t know too many people that would actually inspect your keyboard (unless their Apple fan boys.)

The Hiper Clavier Aluminum Keyboard
This keyboard can be purchased from [ipcrepublic.com] for a mere $37. Thats pennies on the Apple keyboard. Its been out for at least two years so it has been tested longer than the Apple keyboard. I don’t know about you, but I like to have my products tested before I buy them, why not buy a product thats been on the market for a while? Like the other keyboards this one also has media shortcuts that nobody ever really uses.
A review can be read here: [phoronix.com] Like the Speed-link keyboard the base is also made of plastic.

Enermax Aurora
Enermax makes keyboards?
Yes they do and this is probably the best alternative I have found. It can be brought from [newegg] for about the same price as the Apple. It has the USB ports on it like the Apple but also has audio jacks which the Apple doesn’t have. Granted its not flat but it has an elegant design to it and also a standard layout. It comes in two colors aluminum and black aluminum. Considering its made of one solid piece of aluminum its quite light. It also doesn’t sit flat which is a plus as I like a raised keyboard.
A full review can be read here: [digitaldingus.com]

Since I’m picky, I would actually have to go to the store and test a keyboard before I purchased one. I have tried many keyboards and to be honest I’m perfectly happy with my $5 keyboard that I purchased on sale. Its the keyboard that makes a difference, its how its used. Its clear that any skilled Linux user is going to have the best keyboard for their needs since they can modify the layout as needed. This also allows the consumer to use the keyboard the way that they want it to work not how a hardware manufacturer has decided it should work.

Perhaps this is the best keyboard for Linux users: [thinkgeek.com] I would love to be able to type in DVORAK and have one of these keyboards! With this keyboard nobody would ever know your top secret shortcuts. It would also give you the flexibility of customizing it as you needed without any markers on the keys. This would stop people saying

“Well it has the windows logo on it, why did it lock your screen?”.