Install Mozilla Firefox on Amazon EC2 instance

Ensure that you have CentOS yum repositories added and VNC / X11 environment setup prior to proceeding. See the previous post on the details how to do that.

Add required packages:

sudo yum install libstdc++44.i686 pango pango-devel cairo glib2 redhat-lsb redhat-lsb-graphics libtiff libtiff-devel libjpeg-devel gcc urw-fonts

Download Firefox, GTK source code and RPMs we'll need for GTK.

wget ftp://ftp.muug.mb.ca/mirror/centos/5.6/os/i386/CentOS/atk-1.12.2-1.fc6.i386.rpm
wget ftp://ftp.muug.mb.ca/mirror/centos/5.6/os/i386/CentOS/atk-devel-1.12.2-1.fc6.i386.rpm
wget ftp://releases.mozilla.org/pub/mozilla.org/firefox/releases/5.0/linux-i686/en-US/firefox-5.0.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.gz

Install the RPMs

sudo rpm -i atk-1.12.2-1.fc6.i386.rpm
sudo rpm -i atk-devel-1.12.2-1.fc6.i386.rpm

Untar and start building GTK (should take over 20 min on EC2 micro instance)

tar-xvf gtk+-2.10.14.tar.gz
cd gtk+-2.10.14

./configure

sudo make
sudo make install

Untar Firefox and setup symbolic links to GTK

tar -xvjf firefox-5.0.tar.bz2

ln -s /opt/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so.0 /opt/firefox/libgdk-x11-2.0.so.0
ln -s /opt/gtk+-2.10.14/gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so.0 /opt/firefox/libgdk_pixbuf-2.0.so.0
ln -s /opt/gtk+-2.10.14/gtk/.libs/libgtk-x11-2.0.so.0 /opt/firefox/libgtk-x11-2.0.so.0

Start Firefox using ./firefox

Reference

https://forums.aws.amazon.com/thread.jspa?messageID=224857 

Enable VNC for an Amazon EC2 instance

The default installation of the CentOS variant on an EC2 micro instance is missing some required packages. The packages are available from default CentOS repos which need to be added to the instance yum configuration.

Start vi to edit the repo configuration:

sudo vi /etc/yum.conf

and append the following to the end of the configuration file.

[base]
name=CentOS-5 - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=os
#baseurl=http://mirror.centos.org/centos/5/os/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
[updates]
name=CentOS-5 - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates
#baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
[extras]
name=CentOS-5 - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=extras
#baseurl=http://mirror.centos.org/centos/5/extras/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1

and import the keys for accessing the packages

sudo rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

The yum configuration is all set. Next install the packages using the following commands and enter 'yes' when prompted

sudo yum install vnc-server xterm twm

Once the installation completes successfully, start the VNC server using

 

vncserver :1

 

which configures port 5901 for VNC access. Use the Management Console or the command line commands to create new security rule to allow access to port 5901 for your EC2 instance.

Next, from your client machine used to access the EC2 instance, ensure that you are using the following parameter to your ssh or putty executable

 

-L 5901:localhost:5901

Check that the following processes are running 

 

Xvnc :1 -desktop ip-10-122-177-186:1 (ec2-user) -httpd /usr/share/vnc/classes -auth /home/ec2-user/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/ec2-user/.vnc/passwd -rfbport 5901 -pn
vncconfig -iconic
xterm -geometry 80x24+10+10 -ls -title ip-10-122-177-186:1 (ec2-user) Desktop

 

References

 

https://forums.aws.amazon.com/message.jspa?messageID=196807

https://forums.aws.amazon.com/thread.jspa?threadID=14260 

Shooting of Rep. Giffords

While the citizens of United States are praying for the life of congresswoman Gabrielle Giffords from Arizona and mourning the death of federal judge John Roll, the rhetoric from demagogues on both sides is predictably partisan. Liberals are blaming the militant right and the conservatives are blaming government's handling of homeland security. It is wrong to  to focus the debate on the false choice between the freedom of speech vs the security of elected officials. Politicians in a democracy must be free to meet and talk to their constituency. A democracy must permit free speech, even the sort that uses militant analogies to advocate victory in an election. 

We need to recognize that the shooting happened because the gunman was a deranged, crazy man. The deaths and suffering that happened today should lead us to take enough security precautions to protect elected officials from unexpected and unlikely violence of individuals. Despite today, the United States should preserve its freedoms of speech and rights of the public to access their political candidates and elected officials.

Full Screen bookmarklet for Google Bookmarks

If you are an avid del.icio.us user then undoubtedly you have followed the hoopla surrounding Yahoo's announcement about the retirement of the service. Since Google seems like a company that might stick around for at least another decade or so, why not move the bookmarks and the precious tags over to them? HT delicious2google for inspiration. Unfortunately the default bookmarklet available from Google uses an annoying popup, a feature that I thought was out of style since the late 1990s. Sounds like a nice 5 minute JavaScript challenge! Without further ado, here's the code you should use for full screen bookmarking to Google Bookmarks:

 

javascript:(function(){var a=window,b=document,c=encodeURIComponent;location.href="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location) + (b.getSelection().toString().length == 0 ? "" : ("&annotation=" + b.getSelection())) +"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=420px,width=550px,resizable=1,alwaysRaised=1";})()

Note that in addition to capturing the title and the link of the page, the button will also capture your highlighted text and add it to the notes section of the bookmark.

Now...instead of having to hit Back a few times, I wish that the bookmarks/mark service would redirect back to the bookmarked URL after I click on Add Bookmark.