Saturday, October 31, 2015

How to extend the number of ports on a Switch (connecting the switches together)?

How to extend the number of ports on a Switch (connecting the switches together)?

Connect another switch to your current switch. Either by cascading switches, where the uplink (if present) of the new switch is connected to a port on the original switch. Or by using stackable switches.

Cost/Needs are relative, based on the equipment you already have, bandwidth needs per machine, future expansion, etc. Remember, if you are cascading switches, the sum bandwidth total on the second switch will be limited to the speed of the port on the first switch. If this is not acceptable and your switch is not stackable, then you have to replace the switch with one with more ports.

What is the disadvantage to cascading multiple switches?

We did this in an office where we were stuck with 1 port in each room, and we put a 100Mb switch in each room. It was OK for basic tasks, web surfing, email, etc - but the BIG downside is that if you start doing heavy network traffic (for example, copying a multi-gig file from one office to another) you chew up ALL the bandwidth for two offices, because each office is sharing a single uplink.

You are almost describing the cisco multi-tier model. You have a 'core' layer connected to 'distribution' switches (or a 'head' switch in each closet) that will connect to 'access' switches that will finally distribute to the end users/servers/devices.

If you use switches and not hubs on all your network, there's not much of a problem doing that (it's even recommended to do it that way). Just remember the uplinks. If you have 48 ports running at 1GB most of the time and your uplink from access to distribution is only 1 GB, you can suffer of lack of bandwidth, so it's better that the uplinks from access to distribution to core to be larger than the average speed of the access ports (in my network now I have access ports at 1GB and 10GB fiber uplinks)

Also, remember to use STP (Spanning Tree Protocol) to prevent loops and provide failover configs on your network.

port expand

So you've run out of ports on your hub or switch! Or maybe that 4 port router you bought can't handle your growing network. Fortunately, there's an easy fix, but you need to follow some simple rules.

If your network is small, you can always connect two hubs or switches together. You do this by one of two ways:

1) Use a "crossover" cable to connect a "Normal" port on one hub to a "Normal" port on the other.

2) Use a regular UTP (Unshielded Twisted Pair) cable to connect the "Uplink" port on one hub to a "Normal" port on the other.

TIP: (In the following info, we'll refer to "hubs", but the same information applies to switches, and devices with built-in hubs or switches such as routers, gateways, etc.. You can mix hubs and switches, but you can't mix fixed 10BaseT and 100BaseT equipment. If you want to mix 10BaseT and 100BaseT components, make sure they're all 10/100 autosensing.)

TIP: A port on a hub or switch is considered to be "Normal" unless otherwise marked.

Some hubs and switches have a switch next to a port that controls whether it's a normal or uplink port.

Others have two connectors on one port circuit. The "Uplink" connector has the connections for the Receive and Transmit wire pairs reversed from the "Normal" connector's wiring (just like using a "crossover" cable). The "Uplink" allows you to use a normal UTP cable to connect two hubs/switches together.

Don't connect cables in both the "Uplink" and the port connector next to it at the same time! Your network will not work correctly and you'll give yourself a very confusing troubleshooting problem!

Finally, some hubs have neither a switch or Uplink port. If you have two of this type, you'll need to use a crossover cable to connect port to port.

TIP: Let the "link" light be your guide

If you are properly connected, the "Link" light on the port at both ends of your connection should be lit.

You might not need a crossover cable!

Some routers such as the 2Wire HP100 and NETGEAR RP114, have "auto-MDI/MDI-X sensing" ports. It doesn't matter whether you use a straight or crossover cable, or whether you daisy-chain to a normal or uplink port -- the LAN ports will automatically adjust! Very handy!

For larger sized networks...

If your network is larger than two hubs can handle, you can still expand, but you need to watch how you do it. The easiest thing to do is to take one hub and plug each expansion hub or switch into it, creating a "star" configuration of hubs. The diagram below shows such a configuration, connected to a router.

Hub cascading with router

You can repeat the "star" to one more level as shown below, but don't go to three levels or you may have speed, corruption or functionality problems with the resulting network.

Two level cascaded network diagram

Supersize it!

If you need even more ports, you may want to use a "stackable" hub or switch. "Stackable" hubs have a special connector on them that allow the internal circuitry to be connected together via a special cable. By connecting together the internal circuitry, the stacked hubs act as one hub with a lot of ports, instead of smaller hubs connected together. This Linksys page has more info if you want it.

Crossover cable

A "crossover" cable is just a normal 10/100BaseT UTP cable that is wired so that the Receive signal pins on one connector are connected to the Transmit signal pins on the other connector. A "crossover" cable can be purchased from a computer supply store, or you can make one, using the diagram below.

A nicer diagram of both normal and crossover UTP cables can be found on this Linksys page.

An excellent step-by-step how-to on making your own UTP cables can be found here at the Dux Computer Digest site. (Thanks to Julien Levi for the tip!)

TIP:Crossover cables are not just used for connecting hubs together. You sometimes need to use them to connect a cable or DSL modem to a router or gateway, due to the way that the 10/100BaseT jack on some modems is wired. As we said before, let the "Link" light be your guide!


Tuesday, October 27, 2015

hosts file in Windows Mobile device

hosts file in Windows Mobile device

There is no hosts file in Windows Mobile device. However, you can edit the registry to have the same effect.

1. Run "Remote Registry Editor". It is under this path:

"C:\Program Files (x86)\CE Remote Tools\5.01\bin\ccregedt.exe"

2. Go to HKEY_LOCAL_MACHINE\Comm\Tcpip

3. Add a key called Hosts under: HKEY_LOCAL_MACHINE\Comm\Tcpip

4. Add a key called "MyDomain.local" under HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts

5. Add a binary value called "ipaddr" under HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\MyDomain.local

Note: use hex for the IP address. For example: C0 A8 05 10

6. Add a binary value called "ExpireTime" under HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\MyDomain.local

With the value: 99 99 99 99 99 99 99


Monday, October 26, 2015

copy / backup outlook signature

copy / backup outlook signature


Monday, October 19, 2015

upgrade svn subversion 1.8 on CentOS 7

Remove the previous installed subversion:

# yum remove subversion

# yum remove subversion-libs

Add a new yum repository:

# vim /etc/yum.repos.d/wandisco-svn.repo

name=Wandisco SVN Repo

Clean up the cache:

# yum clean all

Install subversion:

# yum install subversion

Check svn version:

# svn --version

svn, version 1.8.11 (r1643975)
   compiled Jan 30 2015, 13:21:57 on x86_64-redhat-linux-gnu

Disable the yum repository:

# vim /etc/yum.repos.d/wandisco-svn.repo


Let svn command add the utf-8 encoding parameter automatically:

# mv /bin/svn /bin/svn.orig

# touch /bin/svn

# chmod 755 /bin/svn

# vim /bin/svn


### initialize

### use encoding utf-8 as default if run "svn ci" or "svn commit".
if [ "$1" != "help" ]; then
  for myarg in "$@"; do
    if [ "${myarg}" = "commit" ] || [ "${myarg}" = "ci" ]; then
      svnarg="--encoding utf-8"

### wrapper script to set umask to 027 on subversion binaries
### Note: the meaning of each umask:
### umask 0002 // File permission 644. Owner can read/write. Group and Others can only read.
### umask 0007 // File permission 660. Owner and Group can read/write. Others can not read or write.
### umask 0027 // File permission 640. Owner can read/write. Group can read. Others can not read or write.
umask 0027

### svn command
/bin/svn.orig ${svnarg} "$@"

Setting up svn server:

# mkdir /home/srv/svn_repos
# cd /home/srv/svn_repos

# svnadmin create test
# cd test

# vim conf/svnserve.conf

anon-access = none
auth-access = write
password-db = passwd

# vim conf/passwd

myname = mypass

# /bin/svnserve -d --listen-port=3690 -r /home/srv/svn_repos

# ss -an | grep :3690

tcp    LISTEN     0      7                      *:3690                  *:*

Block a specific IP address through firewalld on CentOS

Block a specific IP address through firewalld on CentOS

# firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="" reject'

# firewall-cmd --zone=public --list-all

To remove the rule:

# firewall-cmd --zone=public --remove-rich-rule='rule family="ipv4" source address="" reject'

How to delete mail queue in Postfix in CentOS 7

How to delete mail queue in Postfix in CentOS 7

# mailq | tail
# find /var/spool/postfix/deferred/ | wc -l

Remove particular mail queue id:

# postsuper -d mail_queue_id

Remove only ALL deferred mails which are in queue:

# postsuper -d ALL deferred

Remove ALL mails from queue:

# postsuper -d ALL


Tuesday, October 13, 2015

How to stop autoplaying ads, videos and media on web pages

Solution 1:

Disabling autoplay videos and media in Chrome is simple. First of all you need to type "chrome://chrome/settings/content" into the URL bar. Then all you need to do is scroll down to the plug-in section, and select 'Let me choose when to run plugin content'.

Solution 2:

Type chrome://flags/#enable-tab-audio-muting in the browser's address bar. This should open the experimental flags page of the browser and jump straight to the right flag.

Switch the flag to "enabled" with a click on the link.

Restart Chrome afterwards.


Wednesday, October 7, 2015

httpd cant write to folder/file because of selinux

httpd cant write to folder/file because of selinux

It replaces the existing context. But unless you're running the strict policy this doesn't matter since user processes run in unconfined_t, which can access all contexts given the appropriate *nix permissions. – Ignacio Vazquez-Abrams Oct 11 '12 at 22:42

Create another context that both vsftpd's and httpd's domain have write access to. It's a bit more work, but it's far less drastic than disabling SELinux for one or both daemons. – Ignacio Vazquez-Abrams Oct 12 '12 at 14:25


Saturday, October 3, 2015

IQ Test DK, answers and reasoning

IQ Test DK, answers and reasoning.

The knowledge in this post is presented based on the following link. I'll explain the logic behind its final and hardest puzzles.

1 D
2 F
3 B
4 G
5 A
6 H

7 B
8 E
9 H
10 A
11 C
12 F
13 B

14 D
15 H
16 E
17 F
18 C
19 E
20 D

21 G
22 A
23 B
24 H
25 B
26 A
27 H
28 G
29 E

30 A - Pay careful attention to the images. Images in the middle are shrunk when they combine with the image on the left to form the image on the right. The middle image is reduced to the size of the image on the left, resulting in a square of the same size and an additional black ball.

31 D - Images in each corner are formed by two combined shapes from their nearest respective directions.

32 E - Obvious, one segment moves each time.

33 G - There are three separate patterns, each is placed at a certain angle.

34 G - The middle circle acts as a + or - function. Balls outside are minus, inside are addition.

35 C - There's a pivot in each arrow, for the two patterns above it's in the middle, for the third it's in the bottom right.

36 F - Imagine it's a bar chart. In patterns, the largest 'bar' appears three times, and one and two sized bars appear twice. Using these patterns you can deduce that the answer must be F.

37 H - The entire image is a continuous pattern. A black square appears every turn. There are two balls that move one space right every turn. When they pass a black square, they are not only invisible, but they change colous when they emerge.

38 F - The arrow not only enlargens but changes orientation too.

39 B - Each symbol moves right one space per turn. Triangles turn to Xs, Xs to Os, and Os to triangles.