Thursday, June 30, 2011

Cat5-Cat6 difference

The most obvious difference is their transfer capability. CAT5 has four pairs of twisted copper wire and supports up to 100m of Fast Ethernet (100Mbps) transfers. Although CAT5 has four twisted pairs, it only makes use of two pairs. CAT6 also has four pairs of twisted copper wire which supports Gigabit Ethernet (1000 Mbps) of up to 100m. Unlike CAT5, CAT6 takes advantage of all four pairs. CAT6 has a 2x transfer rate compared to CAT5 but due to the higher price tag of CAT6, it isn't used alot yet.

There is also CAT5e (enhanced). Like CAT6 is makes use of all four pairs but it isn't quite as fast at transferring as CAT6 but does support Gigabit Ethernet so is a popular choice.

There is also talk of CAT7, but thats going beyond your question.

Hope thats of some help.

This is repost from http://www.ozzu.com/hardware/cat5-cat6-cable-t34232.html

Office LAN design using Common Sense and expenses

In the past I always wonder how lan is designed.

but recently got chance to put lan setup in office.

We moved to quite big place with around 25 people sitting capacity.

I first thought to put 24 connectors

2 * 8 port switch- Rs.1900 (950*2)
1 24 port switch - Rs. 3800
--------------
wall jacks - 250* 24

labour - 300 per jack

we used Cat 6 cable instead of Cat-5 cable (still need to figure out difference)
Cat 6 100mtr cable - Rs. 2800
Cat 5 100mtr cable - Rs. 1900

Our electrician was not available so We called some electrician to do wiring work but he asked 3500. We tried to negotiate with him to take 2700 for work but he didnt want to negotiate. so we fell back to our trusted guy. He did whole work in just Rs. 1700

so It was going out of budget as we are only 8 people team so I reduced total jacks to 10 and cost got reduced accordingly.

Total cost was Rs. 11000 (including labour and material cost to setup lan with 10 pcs)

here comes interesting part lan designing, please refer to lan diagram attached.

Office has 2 floors, Basement and ground floor. Challenge was to keep everyone on single LAN also provide additional lan for ground floor.

Wednesday, June 29, 2011

Installing MySQLdb with Python 2.6 on Mac OSX10.5

It seemed easy but took quite time for me to install MySQLdb library on Python on Mac Osx 10.5

here are 2 links which saved day for me..

http://stackoverflow.com/questions/3061277/python-mysql-wrong-architecture-error

I have a fresh MacBook Air, and I managed to get MySQLdb working by doing the following: (Snow Leopard 10.6.6, preinstalled Python)

uname -a
Darwin Braindamage.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386

Download the MySQL 32-bit dmg file from mysql pages, Install it.

Add the following lines to your ~/.profile (or ~/.bash_profile):

PATH="/usr/local/mysql/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes


http://stackoverflow.com/questions/1448429/how-to-install-mysqldb-python-data-access-library-to-mysql-on-mac-os-x

here are numerous step-by-steps on how to build and install the MySQLdb libraries. They often have subtle differences. This seemed the most popular to me, and provided the working solution. I've reproduced it with a couple of edits below

Step 0: Before I start, I assumed that you have MySQL(32 bit version) and Python installed on the mac.

Step 1: Download the latest MySQL for Python adapter from SourceForge.

Step 2: Extract your downloaded package:

tar xzvf MySQL-python-1.2.2.tar.gz

Step 3: Inside the folder, clean the package:

sudo python setup.py clean

COUPLE OF EXTRA STEPS, (from this comment)

Step 3b: Remove everything under your MySQL-python-1.2.2/build/* directory -- don't trust the "python setup.py clean" to do it for you

Step 3c: Remove the egg under Users/$USER/.python-eggs

Step 4: Originally required editing _mysql.c, but is now NO LONGER NECESSARY. MySQLdb community seem to have fixed this bug now.

Step 5: Create a symbolic link under lib to point to a sub-directory called mysql. This is where it looks for during compilation.

sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

Step 6: Edit the setup_posix.py and change the following

mysql_config.path = "mysql_config"

to

mysql_config.path = "/usr/local/mysql/bin/mysql_config"

Step 7: In the same directory, rebuild your package (ignore the warnings that comes with it)

sudo python setup.py build

Step 8: Install the package and you are done.

sudo python setup.py install

Step 9: Test if it's working. It works if you can import MySQLdb.

python

>>> import MySQLdb

One final hiccup though is that if you start Python from the build directory you will get this error:

/Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.pyc, but XXXX/MySQL-python-1.2.3c1 is being added to sys.path

This is pretty easy to Google, but to save you the trouble you will end up here (or maybe not... not a particularly future-proof URL) and figure out that you need to cd .. out of build directory and the error should disappear.

As I wrote at the top, I'd love to see this answer generalised, as there are numerous other specific experiences of this horrible problem out there. Edit away, or provide your own, better answer.

Friday, June 24, 2011

Ubuntu - set Server time to UTC

Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime

OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime

OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Wednesday, June 08, 2011

mod_rewrite to another server

We have hosted our company blog at blogspot.

We wanted to have blog hosted on org website. as people should not leave our website.

First solution was to host blog with some blog engine like wordpress.

Second solution I thought it might be possible to use apache mod-rewrite to internally redirect http://screen-magic.com/blog to
our screen-magic.blogspot.com

I never did it. but I started by websearching. Apache mod rewrite it bit tricky. You never know whats happening.

after several unsuccessful attempts and pemutation and combinations finally got it work.

here is the solution



Options -Indexes FollowSymLinks MultiViews
AllowOverride all
Options +FollowSymLinks
RewriteEngine on
RewriteRule blog http://screen-magic.blogspot.com/ [P]
Order allow,deny
allow from all


Here is working demo
Click to see ScreenMagic Blogs