Upgrade Centos 5.5 / RHEL 5.5 ImageMagick from 6.2 to 6.7

We where running RHEL 5.5 and many of the new resize / background features where not available in image Magick 6.2. So we needed to upgraded.

convert -version
wget http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-devel-6.7.4-7.x86_64.rpm
wget http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.7.4-7.x86_64.rpm
sudo yum install ImageMagick-devel-6.7.4-7.x86_64.rpm ImageMagick-6.7.4-7.x86_64.rpm
convert -version

That is all there is to it.

Then exclude ImageMagick from being updated

http://www.cyberciti.biz/faq/redhat-centos-linux-yum-update-exclude-packages/

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
exclude=ImageMagick* <--important line to add

References

Learned about yum installing rpm’s from here

https://github.com/Snorby/snorby/wiki/CentOS-5.5-64bit-by-RISC427

Change path for _www user on OSx for Apache

While trying to use wget and image magic on my mac via a call to apache,

calls to exec where failing when doing

exec($cmd = 'wget '. escapeshellarg($remote_url) .' -O '. escapeshellarg($local_path) .' 2>&1', $out, $status);

I fix this by changing the path for my _www user.

mate /System/Library/LaunchDaemons/org.apache.httpd.plist

and

<key>EnvironmentVariables</key>
<dict>
    <key>PATH</key>
    <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
</dict>

Restarting apache i can no make calls to wget and git.

Installing Selenium Webdriver on Ubuntu 11

Start by installing rvm. Dealing with ruby on a linux system without it is a nightmare.

RVM – Install

$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Install zlib

rvm pkg install zlib

You may also need to install zlib.

aptitude install zlib1g-dev

or

apt-get install zlib1g zlib1g-dev zlibc

Upgrade to the latest version of Ruby.

rvm install 1.9.2 --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr

Not doing the above resulted in:

    ERROR:  Loading command: update (LoadError)
        no such file to load -- zlib
    ERROR:  While executing gem ... (NameError)
        uninitialized constant Gem::Commands::UpdateCommand

Set Ruby 1.9.2 to be the default version

rvm --default use 1.9.2

Update the System so it has knowledge of all the gems etc.

rvm gem update --system

Install Selenium Web Driver

Network Manager Overrides resolve.cnf

Problem:

Ubuntu Rackspace cloud server can’t access internet via firefox or ping. This occurs after install ubuntu desktop on a rackspace cloud server.

Solution:

Temporary fix: modify resolve.cnf

`sudo vi /etc/resolve.cnf` 

`   nameserver 173.203.4.8
    nameserver 173.203.4.9
`

Permanent fix: disable network-manager or configure it to default set needed name servers.

Installing VNC on an Ubuntu Server

We at NetPlenish are starting to use Selenium more and more, and we are doing it in the “cloud”. One of the first things i wanted to do was be able to watch my tests run on the system. So I needed to install VNC and ubuntu Desktop.

Its very strait forward.

Login as root.

`sudo su -`

Update the apt-get

`apt-get update`

Install ubuntu desktop

`apt-get install ubuntu-desktop`

I picked gnome for my display manager.

`apt-get install gdm`

Update xserver to work with the new gui.

`dpkg-reconfigure xserver-xorg`<p class="more-link-p"> <a href="http://www.markalanevans.com/2011/11/01/installing-vnc-on-an-ubuntu-server/" class="more-link">Read more &rarr;</a></p>

Searching for a git Workflow

As we add more and more people to our team at NetPlenish, I find my self searching for a solid git workflow.

I have found a few pages that have inspired me.

We are using GitHub to manage our team. Although BitBucket just realeased its support for git and its half the price… Might consider the move.

I will update this as soon as i figure out one that makes sense for us.

What I Do Now

Best Practices

  • Commit Messages * Keep messages in present tense. * Keep message lines to 72 characters *

Git Aliases

My Git Config File

[user]
    name = Mark Evans
    email = my@emailaddress.com
[color]
    branch = auto
    diff = auto
    interactive = auto
    status = auto
    ui = auto
[color "branch"]
    current = yellow reverse
    local = yellow
    remote = green
[color "diff"]
    meta = yellow bold
    frag = magenta bold
    old = red bold
    new = green bold
[color "status"]
    added = yellow
    changed = green
    untracked = cyan
[alias]
    st = status
    ci = commit
    br = branch
    co = checkout
    df = diff
    lg = log -p
    who = shortlog -s --
    up = pull --rebase
    sync = !git up && git push
    stuff = !git add -A && git ci -a
    shove = !git stuff && git sync
[push]
    default = matching
[core]
    quotepath = false

Git Prommpt

My Git Prompt File

#Description: OSX Git Prompt - make your git repo prompts look pretty
#Installation: In your .bash_profile, add a line:  source .gitprompt
#FileName: .gitprompt
#Owner: Mark Evans:
#Stolen From: http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt

c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`

parse_git_branch ()
{
    if git rev-parse --git-dir >/dev/null 2>&1
    then
        gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
    else
        return 0
    fi
        echo -e $gitver
}

branch_color ()
{
    if git rev-parse --git-dir >/dev/null 2>&1
    then
        color=""
    if git diff --quiet 2>/dev/null >&2 
    then
        color="${c_green}"
    else
        color=${c_red}
    fi
    else
        return 0
    fi
    echo -ne $color
}

#Branch First
#PS1='[\[$(branch_color)\]$(parse_git_branch)\[${c_sgr0}\]] \u@\[${c_red}\]\w\[${c_sgr0}\]:'
#Branch Last
PS1=' \u@\[${c_red}\]\w\[${c_sgr0}\]: [\[$(branch_color)\]$(parse_git_branch)\[${c_sgr0}\]]'

Resources

Cleanup email. Remove Distractions. Save Money.

All day long i’m bombarded with blog posts. Daily deals. Newspaper feeds.

Its literally a distraction every 10 minutes. Not any more.

I use GMail for managing all my emails and decided to simplify the “clutter” in my life.

Its easy to find all the clutter to… every single one of those emails can be “unsubscribed” from.

Search your email for “unsubscribe”. Then start unsubscribing. and deleting those emails. You don’t need them.

Imagine how much money I will save by not being pressured into buying all this stuff, imagine how much time I will save by not being distracted by some new deal or news report.

I can always load my blog reader app to catch up on those.

GIT Repo in Bash Prompt OSX

Description: OSX Git Prompt – make your git repo prompts look pretty

Thief: Mark Evans:
Location: http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
parse_git_branch (){
    if git rev-parse --git-dir >/dev/null 2>&1
    then
        gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
    else
        return 0
    fi
    echo -e $gitver
}
branch_color (){
    if git rev-parse --git-dir >/dev/null 2>&1
    then
        color=""
    if git diff --quiet 2>/dev/null >&2 
    then
        color="${c_green}"
    else
        color=${c_red}
    fi
    else
        return 0
    fi
    echo -ne $color
}

#Branch First
#PS1='[\[$(branch_color)\]$(parse_git_branch)\[${c_sgr0}\]] \u@\[${c_red}\]\w\[${c_sgr0}\]: '
#Branch Last
PS1=' \u@\[${c_red}\]\w\[${c_sgr0}\]: [\[$(branch_color)\]$(parse_git_branch)\[${c_sgr0}\]]'<p class="more-link-p"> <a href="http://www.markalanevans.com/2011/08/16/git-repo-in-bash-prompt-osx/" class="more-link">Read more &rarr;</a></p>