Sunday, November 25, 2012

Create rounded corners with CSS

Rounded corners for Safari/Chrome, Opera and IE9:
#example {
border-radius: 15px;
}
Rounded corners to be supported by Firefox as well:
#example {
-moz-border-radius: 15px;
border-radius: 15px;
}
border-radius
The border-radius shorthand property can be used to define all four corners simultaneously. The property accepts either one or two sets of values, each consisting of one to four lengths or percentages.
Example:
border-radius: 5px 10px 5px 10px / 10px 5px 10px 5px;
border-radius: 5px;
border-radius: 5px 10px / 10px;
The first set of (1-4) values define the horizontal radii for all four corners. An optional second set of values, preceded by a ‘/’, define the vertical radii for all four corners. If only one set of values are supplied, these are used to determine both the vertical and horizontal equally.
If all four values are supplied, these represent the top-left, top-right, bottom-right and bottom-left radii respectively. If bottom-left is omitted it is the same as top-right, if bottom-right is omitted it is the same as top-left, and if only one value is supplied it is used to set all four radii equally.

Basic examples that should work in current versions of Firefox, Safari/Chrome, Opera and even IE9:
#Example_A {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 50px;
border-bottom-right-radius: 50px;
}
#Example_B {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 50px 25px;
border-bottom-right-radius: 50px 25px;
}
#Example_C {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 25px 50px;
border-bottom-right-radius: 25px 50px;
}
#Example_D {
height: 5em;
width: 12em;
-moz-border-radius: 1em 4em 1em 4em;
border-radius: 1em 4em 1em 4em;
}
#Example_E {
height: 65px;
width:160px;
-moz-border-radius: 25px 10px / 10px 25px;
border-radius: 25px 10px / 10px 25px;
}
#Example_F {
height: 70px;
width: 70px;
-moz-border-radius: 35px;
border-radius: 35px;
}
Another opinion in considering most of the browsers when create rounded conners through CSS:
Since each of the browsers still has its own unique idiosyncrasies, they apply prefixes such as -moz and -webkit.
-moz-border-radius is for Firefox, -webkit-border-radius is for Chrome/Safari and -khtml-border-radius is for older Konquerer browsers.
rounded-corners {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px; }

CSS Box Shadow

Syntax

box-shadow: h-shadow v-shadow blur spread color inset;
JavaScript syntax:
object.style.boxShadow="10px 10px 5px #888888"
Note: The box-shadow property attaches one or more drop-shadows to the box. The property is a comma-separated list of shadows, each specified by 2-4 length values, an optional color, and an optional inset keyword. Omitted lengths are 0.
VALUE
DESCRIPTION
h-shadow
Required. The position of the horizontal shadow. Negative values are allowed
v-shadow
Required. The position of the vertical shadow. Negative values are allowed
blur
Optional. The blur distance
spread
Optional. The size of shadow
color
Optional. The color of the shadow.
inset
Optional. Changes the shadow from an outer shadow (outset) to an inner shadow


Box Shadow for Firefox, Safari/Chrome, Opera and IE9:
CSS Box Shadow
.Example_A {
  -moz-box-shadow:    3px 3px 5px 6px #ccc;
  -webkit-box-shadow: 3px 3px 5px 6px #ccc;
  box-shadow:         3px 3px 5px 6px #ccc;
}
Inner Shadow for Firefox, Safari/Chrome, Opera and IE9:
CSS Box Inner Shadow
.Example_B {
   -moz-box-shadow:    inset 0 0 10px #000000;
   -webkit-box-shadow: inset 0 0 10px #000000;
   box-shadow:         inset 0 0 10px #000000;
}
One Side Box Shadow for Firefox, Safari/Chrome, Opera and IE9:
CSS Box One-Side Shadow
.Example_C {
 -webkit-box-shadow: 0 8px 6px -6px black;
    -moz-box-shadow: 0 8px 6px -6px black;
         box-shadow: 0 8px 6px -6px black;
}

CSS Text Shadow

Syntax

text-shadow: h-shadow v-shadow blur color;
JavaScript syntax:
object.style.textShadow="2px 2px #ff0000"
Note: The text-shadow property attaches one or more shadows to text. The property is a comma-separated list of shadows, each specified by 2 or 3 length values and an optional color. Omitted lengths are 0.
VALUE
DESCRIPTION
h-shadow
Required. The position of the horizontal shadow. Negative values are allowed
v-shadow
Required. The position of the vertical shadow. Negative values are allowed
blur
Optional. The blur distance
color
Optional. The color of the shadow
Text shadows:
Text shadows
h3 {text-shadow: 0.1em 0.1em #333}
Fuzzy text shadow:
Fuzzy text shadow
h3.a {text-shadow: 0.1em 0.1em 0.05em #333}
h3.b {text-shadow: 0.1em 0.1em 0.2em black}
Readable white text:
Readable white text
h3 {color: white}
h3.a {color: white; text-shadow: black 0.1em 0.1em 0.2em}
Multiple shadows:
Text multiple shadows
h3 {text-shadow: 0.2em 0.5em 0.1em #600,
      -0.3em 0.1em 0.1em #060,
      0.4em -0.3em 0.1em #006}
Emboss effect: Raised Emboss & Inset Emboss
Emboss effect
h3.a {text-shadow: -1px -1px white, 1px 1px #333}
h3.b {text-shadow: 1px 1px white, -1px -1px #444}
Drawing letters as outlines:
Drawing letters as outlines
h3 {text-shadow: -1px 0 black, 0 1px black,
      1px 0 black, 0 -1px black}
Neon glow:
Neon glow
h3.a {text-shadow: 0 0 0.2em #8F7}
h3.b {text-shadow: 0 0 0.2em #F87, 0 0 0.2em #F87}
h3.c {text-shadow: 0 0 0.2em #87F, 0 0 0.2em #87F,
        0 0 0.2em #87F}

How to setup VLAN on CISCO routers

It is assumed that:
- you are into router as user with full rights – level 15 – ssh, telnet or console
- You just want to route a specific range of IPs through one interface
- You will not use STP / Trunks on that VLAN
- Physical interface is FastEthernet 4
a1) Setup VLAN
cisco1#configure terminal
cisco1(config)#interface vlan4
cisco1(config-if)# ip address 192.168.1.1 255.255.255.0
cisco1(config-if)#exit
cisco1(config)#exit
cisco1#write
a2) Link VLAN and physical interface
cisco1#configure terminal
cisco1(config)#interface FastEthernet4
cisco1(config-if)#speed 100
cisco1(config-if)#no cdp enable
cisco1(config-if)#spanning-tree portfast
cisco1(config-if)#switchport access vlan 4
(Will you receive error the see b), solve the issue and come back )
cisco1(config-if)#exit
cisco1(config)#exit
cisco1#write
a3) Create route
cisco1#configure terminal
cisco1(config)ip route 192.168.1.0 255.255.255.0 vlan4
cisco1(config)#exit
cisco1#write
a4) Create access list
Use by your own access-list command
b) Error when try to add vlan4
It is possible to get this error :
“..Access VLAN 4 does not exist. Please add it to vlan database”
It may help to fix this problem:
It is assumed that:
-you are into router as user with full rights – level 15 – ssh, telnet or console
-do not go to configure menu
cisco1#vlan database
cisco1(vlan)#vlan 4
VLAN 4 added
….
….
cisco1(vlan)#write

How to Create and Delete VLAN on Cisco Catalyst Switch

One of the typical configuration activities you’ll perform on a Cisco Switch is to manipulate VLANs.
VLAN stands for Virtual Local Area Network.
In one physical cisco switch, you can create multiple VLANs that connects to different network.
For example, a VLAN for 10.10.191.0 network, a VLAN for 10.10.192.0 network, and a VLAN for 10.10.193.0 network. All three of these can be configured in the same physical switch.

While these commands were tested on a cisco catalyst switch 3750 series, similar commands (may be with slight variation to the port number format) should work on all cisco switches.

Create VLAN on Cisco Switch

If you are planning to have only one network in your whole switch (for example, 10.10.192.0). i.e All the ports in the switch will be connected to the 10.10.192.0 network, then you don’t need to create a VLAN, just use the default VLAN 1.
Every switch comes with the default VLAN 1 as shown below. In this example, all the ports in this switch ( from 1 through 8 ) are part of the default VLAN 1.

#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------ 1 default active Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4 Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
In the following example, we are creating 192 VLAN network (for 10.10.192.0 network). While creating a VLAN you also need to specify the range of ports from the switch that needs to be part of this VLAN network.
In this example, ports 3 through 6 are configured as part of 192 VLAN network.
config t
vlan 192
interface range gigabitEthernet 1/0/3-6
switchport access vlan 192
exit
In the above commands:
  • config t – Goes into the configuration mode
  • vlan 192 – Creates VLAN 192
  • interface range gigabitEthernet 1/0/3-6 – Indicates that the port numbers 3 through 6 are assigned to this VLAN
  • swithport access vlan 192 – Indicates that the access to the vlan 192 is enabled
Apart from providing the access to the vlan 192 for the port numbers 3 through 6, you can also specify the following additional switchport configuration parameters (for example, nonegotiate and mode access)
config t
interface range gigabitEthernet 1/0/3-6
switchport mode access
switchport nonegotiate
exit
Once you’ve created a VLAN verify it as shown below,
#show vlan

VLAN Name       Status    Ports
---- -------------------------------- --------- ------------
1    default    active    Gi1/0/1, Gi1/0/2, Gi1/0/7, Gi1/0/8
192  VLAN0192   active    Gi1/0/3, Gi1/0/4, Gi1/0/5, Gi1/0/6
On a side note, it is always recommended that you upgrade ISO image on your cisco switch to the latest version.

Delete VLAN on Cisco Switch

You might want to delete a VLAN, if you are planning to switch the ports assigned to VLAN 192 to a different VLAN. Or, you might want to delete a VLAN, just because you’ve created it by mistake.
Let us assume that you want to delete the VLAN 192 (ports 3 though 6) that you just created.
Deleting a VLAN is as simple as assigning the default VLAN 1 to the ports that are part of the VLAN you want to delete, and delete the VLAN.
i.e If you want to delete VLAN 192, assign VLAN 1 to the ports 3 through 6, and just delete the VLAN 192.
First, assign the default VLAN 1 to ports 3 though 6 as shown below.
interface range gigabitEThernet 1/0/3-6
switchport access vlan 1
exit
Next, delete the vlan itself as shown below.
no vlan 192
Finally, verify that the VLAN 192 got deleted as shown below.
#show vlan

VLAN Name       Status    Ports
---- -------------------------------- --------- ------------
1    default    active    Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
                          Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
As a final note, if you don’t know what you are doing, do not execute any of the above commands on production switch, as you might bring down your network. Do this only on a test system, where you can play around and learn how to manipulate VLANs on cisco switch.

Linux Install Google Chrome Browser [ Ubuntu, Suse, Debian, Fedora ]

How do I install Google Chrome browser under Linux operating systems? How do I install google-chrome-beta_current_amd64.deb or google-chrome-beta_current_x86_64.rpm file under Linux?

Google Chrome is another web browser which runs web pages and applications with lightning speed due to its superior JavaScript rendering engine.

Step #1: Download Chrome Browser

Visit this url and download the package for Linux desktop.
Fig.01: Please select your download package format
Fig.01: Please select your download package format
Save .deb or .rpm package at /tmp directory.

Step #2: Install Google Chrome Browser

Open the terminal and type the following command to install the same under Debian or Ubuntu Linux:
cd /tmp
sudo dpkg -i google-chrome-beta_current_amd64.deb
If you are using Suse or Fedora Linux, enter:
 
rpm -ivh google-chrome-beta_current_x86_64.rpm

How Do I Run Google Chrome Browser?

You can launch Google Chrome browser by visiting the Application > Internet > Google Chrome. Or type the following command at a bash prompt:
google-chrome &
Fig.02: Linux Google Chrome In Action
Fig.02: Linux Google Chrome In Action

Removing a Directory In Linux

How do I remove a directory in Linux using the shell prompt?

You can use the following commands:
[a] rmdir command : remove empty directories.
[b] rm command : remove files or directories.

Linux Delete a Directory Command Examples

The syntax is as follows:
 
rmdir dirName
 
Login using the ssh client or open a command-line terminal (select Applications > Accessories > Terminal under Gnome desktop), than type the following command to delete empty directory called foo:
 
rmdir foo
 
By default, the rm command does not remove directories. Use the --recursive (-r or -R) option to remove each listed directory, too, along with all of its contents including all files and subdirectories:
 
rm -r documents
 
You can also specifiy the full path:
 
rm -r /data/dir1
rm -r /home/vivek/dir2
rmdir $HOME/mp3