20 November 2009

10 Useful Bookmarklets for Web Designers and Developers

You may not be away of bookmarklets which are an underused tool in web designer or developer’s toolbox. A bookmarklet is a a term that merges bookmark and applet to add functionality to a web browser. They can be stored in the bookmark bar of any browser and used from there to perform useful tasks and consist primarily of Javascript code.



As Javascript is synonymous with web development, some clever developers have created some extremely helpful bookmarklets that can improve your day to day work. Here are ten of the best available.


1. Firebug Lite


firebuglite


All web designers and developers should be familiar with Firebug (if for some reason you’re not then go now) and Firebug Lite is a striped down version that works on all browsers. Especially useful for fixing IE issues.


Interesting fact: Firebug inspired the name for Inspect Element.



Use on this page.


2. MRI


mri


Enter the name of any selector into the text box and click the MRI button and this bookmarklet will highlight all of those selectors on the page.


Use on this page.


3. Design


design


Use on this page


4. Resize Viewport


Very simple, click on the following links to resize your browser window to these common resolutions. Only works in Firefox but that’s most of you who read Inspect Element.



1024 x 768 | 1280 x 1024 | 1440 x 900 | 1680 x 1050


5. ReCSS


One of the most useful bookmarklets for development is ReCSS. It reloads the CSS file independent of the HTML which speeds up work considerably when you’re only writing CSS code.


Use on this page



6. Save to Delicious


delicious


Delicious is one of, if not the most, popular way of saving articles especially in the web design and development community. This bookmarlet provides a quick way to save the current page to Delicious. Give it a go and save this article to Delicious!


Bookmark this page on Delicious


7. Edit Current Website


Sure, you can preview edits of HTML text using Firebug or WebKit’s Web Inspector but this bookmarklet turns the whole page into a WYSIWYG editor. Of course these changes aren’t permanent and are only local to your machine but gives you a good idea of what changing content does to the page.


Edit this page!


8. XRAY



xray


Similar to Firebug Lite in that you can inspect elements on a page but much clearer to see what you have selected. Also seems to be quicker.


Use on this page.


9. Layout Grid Bookmarklet


grid


Having trouble lining up elements on a page? Andy Budd’s layout grid bookmarklet will come in handy as it overlays a transparent image of a grid, complete with pixel rulers along the X and Y axis.


Use on this page.


10. Favelet Suite


The Favelet Suite bookmarklet is the Swiss Army knife of the web design bookmarklet world. It includes the following features:




  • Color List

  • Document Tree Chart

  • HTML Attribute Viewer

  • HTTP Header Viewer

  • Hidden Field Modifier

  • Javascript Object Tree

  • MODIv2

  • Mouseover DOM Inspector


  • Object Dimensions

  • Page Info

  • Remove Children

  • Resize Fonts

  • Ruler

  • Show Source

  • Style Sheet Tweak

  • Style Sheet Viewer



Use it on this page.




19 November 2009

Google OS Set To Explode Next Week

Google and it's record breaking industrial complex within the search engine world, has broken many barriers by creating interesting new products which fans go mad about. They first exploded with the search engine in 1998, and since then have not only become a giant worldwide in just indexing, but a well oiled machine in the software world as well.


Google has broken walls and created a foundation with it's innovations, allowing itself to not only become number one in the search category, but one of the best email services available, with Gmail. They since developed "Gears", which is an "active" production wheel of services that keep Google products adapting to your operating system.

Some knew this was a prequel to the future, and their beliefs were proven true when Google unveiled the mighty Google Chrome browser, which has become a powerhouse in competing with the number one ranked Mozilla Firefox, and the original Internet Explorer from Microsoft.

Google did not stop there. Google for the last year, have been implementing "Android" Google based "mobile operating systems" into cell phones, and have claimed a huge amount of market share in the ever growing handheld/mobile industry. Google had claimed it's throne as the "king of kings" in the online and multimedia categories.

Google though, had been planning something greater, the highly anticipated Google operating system for personal computers, which has still yet to reach the markets. It promised a linux-based engine, which would of course slaughter Microsoft Windows in performance. That day of reckoning is near, where as next week the Google OS will finally be revealed. Google busts out yet again, with a new force, but none are sure of how compatible it will be.

None the less, this new OS, will be another breakthrough for the powerhouse ran by Eric Schmidt, which many expect to be a huge success. Although there are doubters, many claim that drivers necessary for a smooth running platform OS will not be available immediately. Only time will tell.

The code-named "Chrome OS" is slated for the first public release next week, even though some analysts claim it will be pushed back. The future succession of the OS is yet to be seen, as Linux based operating systems and open source platforms have been available for a very long time, free of charge, and have yet to hold a firm grip upon the market.

Microsoft dominates, clearly in the world of operating systems, but, another brand of competition, let alone a financial giant such as Google, could prove to be a challenge for Microsoft. We shall all see soon.

03 October 2009

Install jboss as daemon (autostart at boot)


Install jboss as daemon (autostart at boot)



Introduction

This guide will let you run jboss as a daemon, that means you'll have a jboss instance that starts a computer boot. When you download jboss you get some example init scripts for different distributions but none for ubuntu. I did however get it to work with minor changes to the red hat init script. This is how I did it, there might be some better way and if you find better solutions than the ones in this guide please let me now and I'll post them here.

At the end of this tutorial you will have (if everything goes as planned) a jboss instance running that starts at computer boot with the help of a daemon script in /etc/init.d/. To keep things tidy jboss will have a separate user called jboss as process owner.

Ubuntu versions tested

Ubuntu 7.10 32 bit Server Version
Ubuntu 7.10 32 bit Desktop Version

Step 1: Install suns jdk

There have been problems reported with jboss and java 6 in the past. I don't know if there still is compatibility issues but to be safe I use java 5.

Code:
sudo apt-get install sun-java5-jdk
Step 2: create the jboss user

The reason to use a separate user account for jboss is to control the permissions of the jboss instance. You don't want jboss running as root with unlimited access to the whole system. There is no password created for the jboss user, and you probably don't need one either (unless you actually want to login as the jboss user).

Code:
sudo mkdir /home/jboss
sudo useradd -s /bin/bash -d /home/jboss jboss
sudo chown jboss:jboss /home/jboss/
Step 3: Download jboss

Go to
http://labs.jboss.com/jbossas/downloads/ and get the latest stable version of jboss (4.2.2.GA when this guide was written). Download it to your home directory.
Now you have a file in ~/jboss-4.2.2.GA.zip

I used unzip to extract the archive, to install it run

Code:
sudo apt-get install unzip
but feel free to extract it with what ever program you feel fit.

sidenote:
When I installed jboss on my server I installed it in the /opt/folder instead of /home/jboss/. Where ever you decide to put jboss make sure the jboss user has read and write permission to the jboss folder and it's subfiles/-folders.

Move it to jboss home and extract it. To make a future upgrade of jboss a little easier a symlinc to jboss home is created. When you decide to upgrade jboss you'll just have to edit the symlinc to point to the new version.

Code:
cd ~
sudo mv jboss-4.2.2.GA.zip /home/jboss/jboss-4.2.2.GA.zip
sudo chown jboss:jboss /home/jboss/jboss-4.2.2.GA.zip
sudo su jboss
cd ~
unzip jboss-4.2.2.GA.zip
ln -s jboss-4.2.2.GA jboss
exit
Step 5:Get the init scriptt

All the changes to the red hat init script is in the setup section in the beginning of the script. If you followed my guide to the letter you can download my version of the script thats attached to this post. If you installed java or jboss in other directories it's probably easier to edit the script your self.

Option 1: download my script

Download the scriptattached to this post to your home folder then run this to move it to the correct folder.

Code:
sudo mv ~/jboss/jboss_init.sh /etc/init.d/jboss
End option 1

Option 2: edit the original red hat script yourself.

Copy the red hat init script to the init.d directory and rename it.

Code:
sudo cp /home/jboss/jboss/bin/jboss_init_redhat.sh /etc/init.d/jboss
This is all the changes I made to the scipt, nothing fancy, just som variables for jboss that needs to be set correct.
Code:
#define where jboss is - this is the directory containing directories log, bin, conf etc

JBOSS_HOME=${JBOSS_HOME:-"/home/jboss/jboss"}

#define the user under which jboss will run, or use 'RUNASIS' to run as the current user

JBOSS_USER=${JBOSS_USER:-"jboss"}

#make sure java is in your path

JAVAPTH=${JAVAPTH:-"/usr/lib/jvm/java-1.5.0-sun"}

#configuration to use, usually one of 'minimal', 'default', 'all'

JBOSS_CONF=${JBOSS_CONF:-"default"}

#the host where jboss should answer. o.o.o.o means answer all calls. set this to yourhost.com

JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}

# Uncomment this line to store the console output, otherwise it's sent to /dev/null
 (good for debugging)
# JBOSS_CONSOLE=${JBOSS_CONSOLE:-"$JBOSS_HOME/server/$JBOSS_CONF/log/console.log"}
End option 2

Step 6: Install the init script

Make your script owned by root and executable.
Create run level shortcuts for the script.

Code:
sudo chown root:root /etc/init.d/jboss
sudo chmod ug+x /etc/init.d/jboss
sudo update-rc.d jboss defaults
To start jboss you type
Code:
sudo /etc/init.d/jboss start
If everything has gone as planned you should now have a functional installation of jboss that will start itself on computer boot.

Step 7: Redirecting traffic from port 80 to jboss port 8080 (Optional)

The default port for jboss is 8080 but the standard port for http traffic is 80. Port 80 is however a restricted port and can only be bound by root. To get around this little pickle you can redirect the incoming traffic on port 80 to 8080, the same goes for the https traffic on port 443 to jboss 8443. Here's a way to do that.

Code:
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8080
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
iptables -t nat -A PREROUTING -p udp -m udp --dport 443 -j REDIRECT --to-ports 8443
This forward script was originally found here, http://www.2nrds.com/port-forwarding-in-linux

Remove
If you found a better way to do this or if you just don't want this installed anymore here's what you do.

Warning! All files will be removed from your sytem.

Remove the init daemon script

Code:
sudo /etc/init.d/jboss stop
sudo update-rc.d jboss remove
sudo rm /etc/init.d/jboss
Remove jboss files and user
Code:
sudo userdel jboss
sudo rm -r /home/jboss
Remove java
Code:
sudo apt-get remove sun-java5-jdk
Remove unzip

Code:
sudo apt-get remove unzip




Some Basic Linux Command


Searching and Installing packaages on Centos
yum search jdk

This will find out all available package with name jdk
yum install java-1.6.0-openjdk
This will install package java-1.6.0-openjdk

To See all running services
ps -Al 
ps -a
This is like task manager of  windows. It will show all proccess being running in console

Download file/folder from internet
lwp-download http://www.perl.com/CPAN/src/latest.tar.gz
and
wget http://www.perl.com/CPAN/src/latest.tar.gz
This will download latest.tar.gz from given url

Create and Edit file
vi filename
saving file
ESC + : +wq
Quit without saving
ESC + : q!

Creating folder
mkdir foldername

Deleting file
rm filename
rm file1 file2  ------ deleting multiple files at a time

Deleting folder
rm –rf foldername

Open File and See content
cat filename

Finding File
find -name ‘*.txt’
and
locate "*.c" -n 10 ---- -n 10 limit result to 10

Copy file to directory
cp file dir1/dir2

Copy folder to directory
cp –r folder dir1/dir2

Renaming file
mv filename1 filename2

Moving file to directory
mv file dir1/file2

Find all username who has currently login
who

Find username of me
whomi

Send message to other user
write username/ip
ctr+d to exit

Change permission on file
chmod 777 filename

Point Tables
R  W  X  
4  2  1  

Owner  Group  Other
Owner = rwx = 4+2+1=7
Group = rwx = 4+2+1=7
Other = rwx = 4+2+1=7

Text Editor Commads
vi filename

Save changes to buffer
ESC + :w       
Save changes and quit vi         
ESC +:wq      
Save file to new file     
ESC +:w filename
Quit without saving      
ESC + :q!       
Save lines to new file   
ESC + :10,15w file

Restarting Server
reboot

start/stop/restart services
service httpd start
service httpd stop
service httpd restart


Stoping firewall
iptables stop




Some Basic Linux Command

Searching and Installing packaages on Centos

yum search jdk

This will find out all available package with name jdk

yum install java-1.6.0-openjdk

This will install package java-1.6.0-openjdk

To See all running services

ps -Al

ps -a

This is like task manager of windows. It will show all proccess being running in console

Download file/folder from internet

lwp-download http://www.perl.com/CPAN/src/latest.tar.gz

and

wget http://www.perl.com/CPAN/src/latest.tar.gz

This will download latest.tar.gz from given url

Create and Edit file

vi filename

saving file

ESC + : +wq

Quit without saving

ESC + : q!

Creating folder

mkdir foldername

Deleting file

rm filename

rm file1 file2 ------ deleting multiple files at a time

Deleting folder

rm –rf foldername

Open File and See content

cat filename

Finding File

find -name ‘*.txt’

and

locate "*.c" -n 10 ---- -n 10 limit result to 10

Copy file to directory

cp file dir1/dir2

Copy folder to directory

cp –r folder dir1/dir2

Renaming file

mv filename1 filename2

Moving file to directory

mv file dir1/file2

Find all username who has currently login

who

Find username of me

whomi

Send message to other user

write username/ip

ctr+d to exit

Change permission on file

chmod 777 filename

Point Tables

R W X

4 2 1

Owner Group Other

Owner = rwx = 4+2+1=7

Group = rwx = 4+2+1=7

Other = rwx = 4+2+1=7

Text Editor Commads

vi filename

Save changes to buffer

ESC + :w

Save changes and quit vi

ESC +:wq

Save file to new file

ESC +:w filename

Quit without saving

ESC + :q!

Save lines to new file

ESC + :10,15w file

Restarting Server

reboot

start/stop/restart services

service httpd start

service httpd stop

service httpd restart

Stoping firewall

iptables stop