JC Web Concepts

Dotfiles

Setting up a new computer can be a tedious and tiresome process. I am not the person that has an exact image of my machine, so when things go wrong I just load that image. I would never have something like that because when I am ready to re-install, I want to start as clean as possible.

At some point I went ahead and starting backing up my dotfiles in Github. This starting to make things easier but it was still a problem. I still had to install all the apps I needed to do things. Then the problem was, what and how do I install these things again. So then I watched a video by another developer by the name of Nick Nisi. He built a script to not only get his dotfiles but also it started moving things to where they need to be. Take a look at the video below where I talk a little more about this topic. You can view my current dotfiles here.

Setting Up Blogofile

Blogofile is a simple blogging engine that brings something nice without the use of a database. I have been testing this out and I am starting to like this. I have even been thinking of replacing it with this. I am really enjoying this framework. Go ahead and watch this video below. After the video I will post the step by step instructions just in case you do not want to watch how to do it.

Setting Up a Git Server

Version control is something that a lot of developers use. I have been using SVN for the longest time and ignoring Git. I found it confusing and I just left it alone. I did the same thing before I started to use SVN. I thought I would have learned by now. So take a look at the video below and I will also put the steps at the end of the post.

On where the master git server will be hosted

mkdir /home/git/somerepo.git
cd /home/git/somerepo.git
git --bare init

Now lets go to your computer

mkdir somerepo.git
cd somerepo.git
git init
**Create a README file or you can type:
touch README
git add .
git commit -m "Some message"
git remote add origin username@yourservername:somerepo.git
git push origin master

Now this setup is just using the users that are already on the server. You can setup that you do not need to type in password. You can create just a git user. I hope that this tutorial has helped.

RabbitVCS SVN Client Linux

If you have used SVN in the past in the Windows world, you are probably pretty use too TortoiseSVN. It is a nice tool that integrates itself into the Windows shell. In the Linux world you probably were using the command line to do these things. Hey I understand I was doing that on my work computer when it was running Linux. I have something in Linux that will get rid of this. RabbitVCS is a client that integrates itself into Nautilus. It is pretty close to being a clone to Tortoise and I really like it.

Moving Your SVN Repo

One of the things that I sometimes have to do is move an SVN repo to another server or you just want to back it up. This tutorial will show you how to do this.

svnadmin dump /pathToYourRepo > reponame_dump
Example: svnadmin dump /var/svn/mywebsite > mywebsite_dump

So now you want to go move this file to your new server and create your subversion repo. Make sure you use the same name as the old one. Go to folder where you uploaded your dump file to and do the following:

svnadmin load /pathToYourRepo < reponame_dump
Example: svnadmin dump /var/svn/mywebsite < mywebsite_dump

So there you go. In this tutorial I did not include setting up the subversion server cause I made the assumption you know how to do this since you already have an SVN repo setup.

jQuery Basics Tutorial

jQuery is an upcoming/hot thing right now when it comes to web development. To me jQuery is slowly taking over flash. There are lots of things I can do in jQuery that I would have programmed in flash for. Before you kill the messenger there are things out there that flash can do that jQuery can’t. So let me post the source code for the tutorial and below that you can watch in video as I explain.


  
      jQuery Basics Tutorial
        
        
        
    
    
        
        
        
John Smith Developer
Greg Smith Owner
Michelle Smith Web Developer
Scott Smith IT Administrator
Michelle Smith Web Developer

Selenium Automation With TestNG

I wanted to start off with a simple tutorial that shows you how to write some simple automation scripts. Basically you write Selenium scripts that will test/verify information on a webpage. Example would be lets say you have a webstore that has a shopping cart. You might want to write automation that goes thru purchasing something to make sure it is working. So here is the video and below that I will have the script as well.

package com.jcwebconcepts.tutorials.basics;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

public class SimpleBrowserTests {
    private String appURL = "http://www.jcwebconcepts.net";

    @Test public void openMyBlog() {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get(appURL);
    }

    @Test public void searchGoogle() {
        FirefoxDriver driver = new FirefoxDriver();
        driver.get("http://www.google.com");
        driver.findElementByName("q").sendKeys("Apple");
        driver.findElementByName("btnG").click();
    }
}

Setting Up Eclipse

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:


    
    
    
    
        org.apache.maven.plugins
        maven-surefire-plugin
        2.4.3
        
          
              
                  app.env
                  ${app.env}
              
          
        
            **/TestUtilities.java
        
        
    
    
        org.apache.maven.plugins
        maven-compiler-plugin
        
          1.5
          1.5
        
    
      
          org.apache.maven.plugins
          maven-checkstyle-plugin
          2.2
          
              checkstyle.xml
              true
              true
              true
              true
          
          
              
                  validate
                  
                      check
                  
              
          
      
    
    
    
    
    net.sf.jacob-project
    jacob
    1.14.3
    
    
      org.springframework
      spring
      2.5.5
    
    
      org.springframework
      spring-webmvc
      2.5.5
    
    
      org.springframework
      spring-test
      2.5.3
    
    
      javax.servlet.jsp
      jsp-api
      2.1
    
    
      log4j
      log4j
      1.2.14
      runtime
    
    
      javax.servlet
      servlet-api
      2.4
    
    
      oracle
      oracle
      14
      test
    
    
    org.testng
    testng
    5.11
    jdk15
    test
    
    
    org.seleniumhq.selenium
    selenium
    2.0a2
    
    
    org.seleniumhq.selenium
    selenium-server
    2.0a2