Parallels Experience

July 27th, 2010 -- 1 Comment

I was asked to write my experiences when using Parallels on my Mac. So I thought I would make a blog post about this at the same time to share my thoughts on this topic. If you own a Mac, Parallels is a purchase that is a must. It makes your life easier. So let me get onto my experiences.

Windows at work

At my work most computers are running Windows XP. When I decided to use a Mac instead of a Windows computers, I came into some issues. There are tools that only have Windows applications and I thought I would be in trouble. I ended up installing XP in Parallels and I was able to install the applications I needed. I needed access to internet explorer to run my automation scripts against website in internet explorer. The company runs some web applications that will only work in internet explorer and Parallels run these applications seamlessly. No issues at all, I do not even know that I am running a virtual machine.

Linux servers

Another thing that Parallels help me with is being able to setup Linux virtual machines. I create a lot of how-to tutorials and I use these virtual machines for them. Installing Linux in Parallels is easy and I do not run into many issues. Setting up and compiling kernels are easy to do. My Gentoo and Ubuntu distros find all the parallels drivers and it makes it so much easier.

The bad

The only bad thing I can say is gaming. I do understand that this is not easy but it is getting closer.

Conclusion

I thank the Parallels team and hope you guys and gals keep improving and keep bring in new features for your product.

Bluefish IDE Editor

July 26th, 2010 -- No Comments

Well as a PHP, HTML, CSS, and jQuery designer one of the things I have been looking for is a good lightweight text editor. I have used many different types of editors and not found the right one. When I programmed in Windows I loved Notepad++, but there is no Mac/Linux equivalent. The editors that I have used in the past are as follows:

The last editor I was and still will use is VIM. There is times I just want to click somewhere to move my cursor, I.E. Being lazy. I really like bluefish cause it is very lightweight and fast. Eclipse and Dreamweaver just are too slow for me. Bluefish will work in Mac, Linux, and Windows. The best thing I like about it, is it is free. So take a look at them, post some comments about what you think is the best. Maybe you have one that I just have not seen.

Setting up Eclipse

April 27th, 2010 -- No Comments

I wanted to talk about how to setup your Eclipse IDE to work with Selenium, Maven, and TestNG. For those who do not know what those are you can click on the link to learn more. I will be making some more posts/tutorials on how to use these items. Eclipse can run on Mac, Linux, and or Windows. You need to have Java installed and if you want to work with SVN then you need the command line SVN client.

From the video below here is the list of the sites that you will need to add to Eclipse:

  • Maven = http://m2eclipse.sonatype.org/sites/m2e
  • TestNG = http://beust.com/eclipse
  • Subclipse = http://subclipse.tigris.org/update_1.6.x

Here is the video. Below video I will paste the code that you want to add to the pom.xml

Here is the code that is remaining

<build>
  		<testResources>
  		</testResources>
  		<plugins>
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>app.env</name>
                            <value>${app.env}</value>
                        </property>
                    </systemProperties>
					<excludes>
						<exclude>**/TestUtilities.java</exclude>
					</excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <skip>true</skip>
                    <failsOnError>true</failsOnError>
                    <consoleOutput>true</consoleOutput>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
  	</build>
  	<dependencies>
        <dependency>
			<groupId>net.sf.jacob-project</groupId>
			<artifactId>jacob</artifactId>
			<version>1.14.3</version>
		</dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>2.5.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>2.5.3</version>
        </dependency> 
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>oracle</artifactId>
            <version>14</version>
            <scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.testng</groupId>
        	<artifactId>testng</artifactId>
        	<version>5.11</version>
        	<classifier>jdk15</classifier>
        	<scope>test</scope>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium</artifactId>
        	<version>2.0a2</version>
        </dependency>
        <dependency>
        	<groupId>org.seleniumhq.selenium</groupId>
        	<artifactId>selenium-server</artifactId>
        	<version>2.0a2</version>
        </dependency>
    </dependencies>

Hosts File

March 25th, 2010 -- No Comments

As a web developer one of the tools that I love to use is built right into the operating system. I have come across some jobs where the coder has coded everything in absolute paths. Let me show you an example of an absolute path and a relative path.

….

Absolute Path
<a href="http://www.jcwebconcepts.com/index.php">Home</a>
 
Relative Path
<a href="index.php">Home</a>

As you can see there is a little difference. So now you may ask why is this an issue. Well if you are like me and like to test stuff on a local server first, then you will run into some issues. If your page calls an file it will call it from the remote server and not the local one. There are other examples but I will spare you of them. Lets get to this hosts file.

The hosts file exists in modern day operating systems. You can find it in Linux, Mac, Unix, and or Windows. Let me show you where these files exist.

Linux (Most distros)/Unix
/etc/hosts
 
Mac
/etc/hosts
 
Windows
C:\Windows\system32\drivers\etc\hosts

Here is an example of what a host file looks like

Linux Host File

So now let me show you some magic. So now on your testing box I would add a new entry. It can be added anywhere you want. So add this line

127.0.0.1     http://www.jcwebconcepts.net
127.0.0.1     http://jcwebconcepts.net
127.0.0.1     www.jcwebconcepts.net
127.0.0.1     jcwebconcepts.net

Of course you could substitute with any domain. So now when you test your files/scripts and the point to the absolute path you will pointing to your local box. Of course when you are done I like to comment that out. Just in case I forget that I have that and I want to look at the remote site. Now if you want to see the test environment on another computer the line you add to the host file will be different. First get your IP of the test box. Mine is 192.168.2.120

192.168.2.120     http://www.jcwebconcepts.net
192.168.2.120     http://jcwebconcepts.net
192.168.2.120     www.jcwebconcepts.net
192.168.2.120     jcwebconcepts.net

So you can start to see the things you can do with the hosts file that can help you. Instead of recoding all those absolute paths to relative you can edit the hosts file and test it that way.

Here is a video that explains some of this

NAS Server. Should I or Should I Not

March 2nd, 2010 -- 1 Comment

For the people who do not know what NAS stands for, it stands for Network-attached Storage. Do you have an old computer that is just sitting there collecting dust? I for one when I bought my iMac and MacBook my Dell became a dust collector. So one day I decided I needed to set something up to backup my files. I know I could have burnt stuff to DVD or buy an external hard drive to store them on.

Now for the Mac I could use a portable HD to setup Time Machine. Now my concern with Time Machine is that as far as I know you can only use it for one computer. Now I have not researched it so I could be wrong. With the external if you do run multiple operating systems like Linux or Windows then you have to worry about how you format your HD. Also if you buy a portable that needs a power source then I need to fiddle behind my desk to plug in the power adapter for the HD. What a mess I’ll tell ya.

Now if you have the luxury of having a dual layer burner you could burn all your backup data. Now I will tell you that data that does not change I still put to DVD but why waste it all for stuff that changes. You then need to setup databases or spreadsheets on what stuff is on what DVD or CD. I do not know about you but I would not want to worry about all that stuff.

So this brings me to setting up a NAS server. All you need is a computer with a decent size hard drive and if you want to hide it a wireless card. The other option here is buying a time capsule cause that is basically a NAS server. So if you decide the old computer you then have 2 choices for the OS that I would use. One is FreeNAS which is based off FreeBSD and the other would be Ubuntu. I basically chose Ubuntu cause I can run other things off it like a web server and set it up as a puppet master for some of my virtual machines.

So what are you going to choose? Do you have any opinions on what you think about storage backups? Post a comment and let us know what you believe the is the best backup solution.

Python Basics

December 23rd, 2009 -- 1 Comment

If you have been reading previous blog posts, I have been using a monitoring tool called Zenoss. Under the hood there is a lot of Python stuff. So I decided to start learning Python. Python can run on Mac, Linux, Unix, and Windows. Let me show you some basic on what you can do in python.

#!/usr/bin/python
 
firstName = "John"
lastName = "Costanzo"
 
# Lets just print out one variable
print firstName
 
# Now lets complete my name
print firstName, lastName
 
# Lets just print something random without a variable
print "The sun is warm. The grass is green"
 
# Now I will print some variables followed by some text
print firstName, lastName, "Is the owner of this blog."

For more information on Python you can visit this site.

VIM Tutorial

December 10th, 2009 -- No Comments

When I first started working with Linux one of the tools I disregarded was VIM. I felt it to be too confusing and believed it was not worth it at all. I was so use too notepad, nano, pico, etc… Then a programmer finally convinced me one day to make a switch. I am so glad I did.

So the first thing you have to get use to is that there are two modes to be in. One is command mode and the other is in insert mode. When in command mode you can save or do other things like find and replace. In insert mode you do like you normally do. You type away. I know it sounds confusing now but wait and I will show you what I mean.

VIM can be found in Mac, Linux, Unix, and or Windows. To start a file you bring up your terminal or if in Windows you open the application in your start menu. In the terminal you will type

vim whateverfilename

In the Windows work you go to file -> new I believe. Sorry not much in the Windows side of things.

Command Mode

Ok so lets get into some of the things you can do in command mode. So lets say you have to edit a document for work and you have to change the word Bob with the word John. hit ESC to make sure you are in command mode and hit the following:

:% s/Bob/John/g

The g at the end will make sure it goes thru the whole document. To search for some text is not that hard to do. So lets say we want to find all instance of the word happy. You will do the following:

/happy

When you find the first result you can hit n on your keyboard to go to the next instance that it finds the work happy. If there is none it will tell you that there is none. Now I am sure you are asking how do I search for multiple words? Well let me show you how to search for Happy Birthday

/Happy Birthday

As you can see you I did the same thing as above. VIM knew that you were looking for multiple words. Before you ask if there is a term in the document called Birthday of Happy, it will not bring that up as a result. The next thing I want to show you is if you need to get to line 10000 in a file all you have to do is the following:

:10000

Yep that is it. To wrap up this first tutorial on VIM I will show you how to quit without saving, saving but not exiting, and saving and exit. Here they are in order.

:q!

The q stands for quit. If you forget the ! you would be prompted about saving before quiting

:w

The w tells VIM that you want to save the changes

:wq

As you see we combined the w and the q to save the changes then quit. Now before you ask, if you would do :qw that would fail. Cause vim reads the commands from left to right. Well I think that is enough for now. If you have any questions about vim please post a comment.

Below is a video on what I basically explained above.

Zenoss Local Templates

November 13th, 2009 -- No Comments

One of the coolest things I learned today was about creating local templates for specific devices. So lets say you have 5 Linux boxes and and only 2 are running apache. I do not need to graph apache stuff on my 3 other boxes. So I go into the device that I want to have its own version of the template and click on the down arrow and go to more. Then click on templates. You will now see all the templates that are bound to the device class. The one that you want to change to the specific device click on Create local copy.

Now you can edit that template and it will only make changes for that device. I am telling you that Zenoss is just a great piece of software.

Zenoss Training

November 8th, 2009 -- 1 Comment

Today I went to a Zenoss training in Baltimore MD. This is a training that usually costs around $1500 USD to attend. They are offering this one day training session for free. As soon as I heard this I said where do you sign me up. Of course I have a 2 hour drive in rush hour to get to inner harbor but I will tell you it is worth it. So I thought I would share some highlights and my thoughts about how this training went.

Traveling

Well according to Google Maps, it would take me about an hour and half.  With traffic believe it or not it only took about 2 hours. The hotel was easy to find and parking was not expensive at all.

Training Itself

Well lets get to the reason why you are reading this blog post. I really liked this training. The slide show presentation was done well. It started off by explaining the backend and how Zenoss works. Then they got into each section and explain how they work. I did feel it went a little fast but we only had so many things to cover is such a little time. There were a few questions which kinda took us off course, but the trainers got it back on track really fast.

The only con I had from the whole thing was the amount of time we had. Due to this we really could not drill down on certain things. The trainers did a great job in explaining the basic to give you the idea on how it works. I am very interested in possibly taken the paid training. Honestly if you have an opportunity to attend one of these you should. It is worth the traveling time and any feels involved.

Gifts

When I got there they had a bag of gifts to give everyone. I got a 4GB pen drive, a pen, Zenoss sticker, Zebra stress toy, and a Zenoss shirt. They also provided a great lunch. Thanks again to Zenoss team. Take a look at their website for more information on the product.

Categories: Linux / BSD, Servers, Windows

Gentoo vs Ubuntu

October 28th, 2009 -- No Comments

Well I know the first thing that people are saying is, “Oh no not another distro debate.” I myself hate these debates so I am going to try my best to not make this one. My purpose here is to explain the difference between the two. One of the things Linux offers is a lot of choices of distributions. There is no regulations on who can create one. For more on that you should visit Distro Watch.

Gentoo

Gentoo is an operating system that beginners should not get into unless you like to live dangerous. Unlike most distro’s it is not a click next installer. You have to edit configuration files and work via the command line. Now I know that Gentoo is working on a GUI installer so that might make installing a little bit easier.

The one of the things I do like is that you can set the USE flag for installing applications. What I mean by this is you can tell Gentoo when install an application what you want to build with it. For example you can build apache without MySQL support. So if you wanted to add mysql support you just have to add the word mysql to the USE section in the make.conf.

Now one of the con’s of Gentoo is that all applications from portage (the system Gentoo uses to install applications) are built via source. So on some systems to install KDE it takes over 10 hours. This of course can depend on your system. So I would recommend that you try installing Gentoo in a Virtual Machine first to see how you like it or of course you can try the Live CD.

Ubuntu

Ubuntu to me is the Windows of the Linux world. You install it by answering some questions, hitting next and all the work is done for you. Ubuntu is the distro I recommend for the beginner to the Linux world. There is hardly no configuration change at all. I have rarely seen an install that you had to mess with configuration files to get it to work.

The apt-get system is like portage but it does not build the application’s from source. The only con that I can come up with is that it is too simple. This is a preference to me. Let me explain this logic here. There was a time that installing Linux was not an easy task. Everyone could not do it. Gentoo is one of those examples. When you could install it you felt good about it. When you install Windows you feel nothing. This is how I feel about Ubuntu. But being easy is need because then Linux has no chance of overtaking Windows. Well that is for another blog post at another time.

In conclusion I believe if you are new to the Linux world you should try using Ubuntu and mess around with that and get your feet wet. Then when you are ready for a challenge and ready to take the next step, install Gentoo.

Categories: Linux / BSD, Windows