Archive for the ‘Linux’ Category

Installing VNC Server on Linux

Sunday, December 27th, 2009

There isn’t a very automatic way to install vnc server on Debian or any linux distro for that matter. This install is specific for Debian based distros but should work for others providing you use the distro specific startup/service config application and package manager.

For debian:

First, install vnc server:

sudo aptitude install x11vnc

This will install all the required packages for VNC

Next we will configure the vnc server
To comply with the current standards, all config files should be stored in ~/.config/{appname}/ so:

mkdir -p ~/.config/vnc
vncpasswd ~/.config/vnc/passwd

Insert your desired VNC password, then verify.
Next create your init script

echo "x11vnc -ncache 10 -nap -bg -many -rfbauth ~/.config/vnc/passwd -desktop "VNC ${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.config/vnc/port" > ~/.config/vnc/vnc-server

sudo ln -s ~/.config/vnc/vnc-server /etc/init.d/vnc-server

sudo update-rc.d vnc-server defaults 99

This will create the service and set it to start on system start, and exit on system reboot/shutdown. To manually start or restart the service, do:

sudo /etc/init.d/vnc-server start | restart

You can connect to this server using the many popular vnc clients such as Ultra VNC, Win VNC, Tight VNC, etc.

Code Editor of Choice

Tuesday, May 26th, 2009

I read a pretty cool article that basically highlighted the differences of 22 code editors available for Windows.

I have mentioned I am a Linux user at heart but I do find myself using Windows a large majority of my time (again relating back to my current position as a Windows Admin) so this list was interesting and useful to me.

I have tried about half of these editors when I was looking for the editor I would be doing code work in. I landed on Notepad++ and I also use GVim occasionally. I use Vim on Linux.

Here is the list: http://net.tutsplus.com/articles/web-roundups/22-neat-code-editors-for-windows/

After the Software Wars

Friday, May 22nd, 2009

As you may have figured out by now, I use Linux. But I do not use Linux solely. I am not a zealot in any sense of the word and use Windows primarily, due to occupational requirements (I am a Windows system administrator by day..) but I do disagree with many of the Microsoft policies, ideologies and business practices.

One ideology which was installed into the companies roots by one Bill Gates himself (read his letter to hobbyists from when MS was still a baby), the anti-anything-open-source ideology, I disagree with because there are huge pros to the open source movement.

I am a software developer to be and would like to think that my degree, time and skills are worth something and software I develop will in some way compensate me for my time, but the open source movement is far more than just FREE software. It is about education, sharing ideas and networking. It is about community involvement. The open source movement is about looking past petty differences and creating a better future for the world of technology.

So to that end, an ex Microsoft software developer has written a book about his experience with the Redmond based software giant. And in the spirit of open source, the book is available for free download in full!

Check it out:

http://www.lulu.com/content/4964815

Converting Raw NEF images to JPG

Tuesday, May 19th, 2009

My wife and I take a fair amount of pictures and to keep them in the highest quality we use the cameras RAW image setting. This saves the image in .NEF format. Not many applications can read .NEF and it isn’t as simple as changing the extension to convert them to .JPG format if we want to post them online or something.

I am also a Linux (debian based distros) user so I tap into the awesome power of the Linux command line to convert the images in bulk. The applications necessary to do this are imagemagick and ufraw. To install these do the following:

sudo apt-get install ufraw imagemagick

They are actually installed by default on many modern distros. Once they are installed, there are a few ways to work the conversion magic but the way I choose to do it is this; First I will list the directory contents (all the .NEF images) and pipe the output into a file

ls > listnef

Then I will copy that file to make the list of jpg image names

cp listnef listjpg

Then I will edit the jpg file and replace all the .NEF file extensions with .jpg extensions

vi listjpg

while in vi:

:%s/NEF/jpg/g

This will replace all instances of NEF with jpg in the file. Save the file with
:wqa

Then I will run the converter on the list of files. I use the verbose switch so I can see whats going on. The way the conversion works, it converts the files and stores them in a temp directory, then when the entire list is in the temp directory, it finishes the conversion and moves the jpg files to the original directory so if you cancel the conversion (Ctr +C) before it is finished, there won’t be any jpg’s converted.

For some reason, the converted jpg’s will all be named after the last file in the list plus a counter, for example if you have a list of files like: pic1.nef pic2.nef pic3.nef pic4.nef all the jpg’s will be named pic4-01.jpg through pic4-04.jpg I don’t know why the conversion does this but in my process it really doesn’t matter so I haven’t read the man pages extensively or anything.

I wrote this up because there are plenty of forum posts asking about this, but none of them have much of an answer.