Archive for category Uncategorized

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. Read the rest of this entry »

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 Read the rest of this entry »

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. Read the rest of this entry »

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` <a href="http://www.markalanevans.com/2011/11/01/installing-vnc-on-an-ubuntu-server/#more-466" class="more-link">Read the rest of this entry &raquo;</a>

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}\]]' <a href="http://www.markalanevans.com/2011/08/16/git-repo-in-bash-prompt-osx/#more-423" class="more-link">Read the rest of this entry &raquo;</a>