Table Already Exists SQL Server

May 27, 2015
Somehow I have created or you can say I have imported database into SQL and try to continue installation, but error "table already exists sql server" occur then installation has been interrupted. Meanwhile, another error "SQL=Duplicate entry 'add_user' for key 'PRIMARY':" also appear. In this case I had deleted those tables and modified dbsetup file.

CREATE TABLE logs (
        id bigint unsigned NOT NULL AUTO_INCREMENT,

to

CREATE TABLE logs (
        id bigint(20) unsigned NOT NULL AUTO_INCREMENT,

On sql I have used this command to delete tables

MariaDB [(none)]> use syslog
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [syslog]> drop table {YourTableName};

Huawei Switch Show Commands

May 25, 2015
Here are basic show commands used in Huawei switch. For configuration of Huawei switch click here.

1. Show VLANs
<sw1>display vlan

8. Show port base VLAN
<sw1>display port vlan  
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
Eth-Trunk0              hybrid       1     -                                
GigabitEthernet0/0/1    trunk        1     1
GigabitEthernet0/0/2    hybrid       1     -                                
GigabitEthernet0/0/3    access       301   -                                
GigabitEthernet0/0/4    access       302   -                                
GigabitEthernet0/0/5    hybrid       1     -                                
GigabitEthernet0/0/6    hybrid       1     -                                
GigabitEthernet0/0/7    hybrid       1     -                                
GigabitEthernet0/0/8    hybrid       1     -


2. View Configuration
[sw1]display current-configuration configuration
!Software Version V200R003C00SPC300
#
sysname sw1
#
vlan batch 301 to 302
#
stp region-configuration
 region-name JR
 instance 1 vlan 20 to 30
 active region-configuration
#
vlan 30
 description fiber
vlan 20
 description Wireless
[sw1-mst-region]active region-configuration

[sw1]display stp instance 0 interface GigabitEthernet 0/0/1 brief
 MSTID   Port                        Role  STP State     Protection
    0    GigabitEthernet0/0/1        DESI  FORWARDING      NONE



interface Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan 20 30
mode lacp

int gi0/0/5
eth-trunk1
undo negotiation auto

int gi0/0/6
eht-trunk1
undo negotiation auto


3. Show interface configuration
[sw1]display interface Eth-Trunk 1
Eth-Trunk1 current state : UP
Line protocol current state : UP




4. LACP port status

[sw1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: LACP                              
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP      
System Priority: 32768      System ID: 30d1-7eea-c824                      
Least Active-linknumber: 1  Max Active-linknumber: 8                      
Operate status: up          Number Of Up Port In Trunk: 2                  
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/5   Selected 1GE      32768   1      305     10111100  1  
GigabitEthernet0/0/6   Selected 1GE      32768   2      305     10111100  1  

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
GigabitEthernet0/0/5   32768    001b-0c17-b780  32768   515    1       10111100
GigabitEthernet0/0/6   32768    001b-0c17-b780  32768   514    1       10111100
VID  Status  Property      MAC-LRN Statistics Description  
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                      
301  enable  default       enable  disable    fiber                          
302  enable  default       enable  disable    Wireless


5. Show interface vlan

[sw1]display int Vlanif 25
Vlanif25 current state : UP
Line protocol current state : UP
Last line protocol up time : 2014-07-21 18:57:40 UTC-05:13
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.10.10.11/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 30d1-7eea-c824
Current system time: 2014-07-21 19:01:47-05:13
    Input bandwidth utilization  : --
    Output bandwidth utilization : --

6.  [sw1]ping 10.10.10.10  
  PING 10.10.10.10: 56  data bytes, press CTRL_C to break
    Reply from 10.10.10.10: bytes=56 Sequence=1 ttl=255 time=4 ms
    Reply from 10.10.10.10: bytes=56 Sequence=2 ttl=255 time=5 ms
    Reply from 10.10.10.10: bytes=56 Sequence=3 ttl=255 time=5 ms
    Reply from 10.10.10.10: bytes=56 Sequence=4 ttl=255 time=7 ms
    Reply from 10.10.10.10: bytes=56 Sequence=5 ttl=255 time=5 ms

  --- 10.10.10.10 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 4/5/7 ms

Huawei Switch Configuration Commands

May 25, 2015
Here are some Huawei switch configuration command and verification command is here.


1. Enter int to the privilege mode
<sw1>system view

2. Create the VLAN
[sw1]vlan 30
[sw1]des fiber

3. Configure interface trunk
[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk

4. Configure interface access
[sw1-GigabitEthernet0/0/3]port link-type access
[sw1-GigabitEthernet0/0/4]port link-type access

5. Assign vlan to that port
[sw1]vlan 30
[sw1-vlan30]port GigabitEthernet 0/0/3
[sw1]vlan 30
[sw1-vlan30]port GigabitEthernet 0/0/4

6. Change port speed and duplex
[sw1]interface GigabitEthernet 0/0/3
[sw1-GigabitEthernet0/0/3]undo negotiation auto
[sw1-GigabitEthernet0/0/3]speed ?
  10                10M port speed mode
  100               100M port speed mode
  1000              1000M port speed mode
  auto-negotiation  Auto negotiation
[sw1-GigabitEthernet0/0/3]speed 100
[sw1]int gi0/0/4
[sw1-GigabitEthernet0/0/4]undo negotiation auto
[sw1-GigabitEthernet0/0/4]speed 100

[sw1-GigabitEthernet0/0/4]duplex ?
  full  Full-Duplex mode
  half  Half-Duplex mode
[sw1-GigabitEthernet0/0/4]duplex full


7. Configure VLAN and add VLAN in trunk port
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 301 302
Info: This operation may take a few seconds. Please wait for a moment...done.

8. MST Configuration

[sw1]stp region-configuration
Info: Please activate the stp region-configuration after it is modified.
[sw1-mst-region]region-name JP
[sw1-mst-region]instance 1 vlan instance 1 vlan 10 20 30 to 50 600 to 616
[sw1-mst-region]instance 0 vlan 302

9. Create management interface
[sw1]interface Vlanif 25
Error: Can not create this interface because the interface number of this type has reached its maximum.
[sw1]undo interface Vlanif 1
[sw1-Vlanif25]ip add 10.10.10.11 255.255.255.0
[sw1-Vlanif25]ip route-static 0.0.0.0 0.0.0.0 129.102.0.2


10. Configure SSH

[sw1]rsa local-key-pair create
The key name will be: sw1_Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
       it will take a few minutes.
Input the bits in the modulus[default = 2048]:1024
Generating keys...
.....++++++
..........++++++
.................+++++
...+++++

11. Create local user
[sw1]aaa
[sw1-aaa]local-user jpudasaini password ?
  cipher               User password with cipher text
  irreversible-cipher  User password with irreversible-cipher text
  <cr>

[sw1-aaa]local-user jpudasaini password
Please configure the login password (8-16)
It is recommended that the password consist of at least 2 types of characters, including lowercase letters, uppercase letters, numerals and special characters.
Please enter password:
Please confirm password:
Info: Add a new user.

[sw1-aaa]local-user jpudasaini service-type ssh telnet

12. Configure telnet session
[sw1]stelnet server enable
[sw1]ssh authentication-type default password
[sw1]ssh user jpudasaini
[sw1]ssh user jpudasaini authentication-type password
[sw1]ssh user jpudasaini service-type stelnet


[sw1]user-interface vty 0 4
[sw1-ui-vty0-4]authentication-mode aaa
[sw1-ui-vty0-4]protocol inbound ssh



[sw1-aaa]local-user jpudasaini privilege level 15
[sw1-aaa]local-user jpudasaini service-type ssh
[sw1]ssh authentication-type default password

13. DHCP Snooping enable
[huawei-sw1]dhcp enable
[huawei-sw1]dhcp snooping enable ipv4
[huawei-sw1]dhcp server detect

[huawei-sw1]dhcp snooping check dhcp-rate enable
<huawei-sw1>display dhcp snooping
[huawei-sw1]dhcp snooping check dhcp-rate 50

14. Apply to VLAN
[huawei-sw1]vlan 301
[huawei-sw1-vlan301]dhcp snooping enable

15. Apply to Interface
[huawei-sw1-GigabitEthernet0/0/3]dhcp snooping enable
[huawei-sw1-GigabitEthernet0/0/3]dhcp snooping check dhcp-rate enable


16. Apply to Trunk port
[huawei-sw1-GigabitEthernet0/0/4]dhcp snooping trusted


17. Verify Command
[huawei-sw1]display dhcp snooping configuration    
#
dhcp snooping enable
dhcp snooping check dhcp-rate enable
dhcp snooping check dhcp-rate 50
dhcp server detect
#
vlan 301
 dhcp snooping enable
#
interface GigabitEthernet0/0/3
 dhcp snooping enable
 dhcp snooping check dhcp-rate enable
#
interface GigabitEthernet0/0/4
 dhcp snooping trusted

PERL can't locate module in @ INC

April 24, 2015
Hi, recently when I'm trying to install some linux daemon in CentOS 7 I have encountered a PERL issue, indicating that some module are missing e.g.

Can't locate sys/syslog.pm in @INC

It means it can't find the pear-sys-syslog. So I have to install this daemon to continue my installation. In my case its syslog.pm but you may encounter different than this. I mean the module name is different, but the error code is same. You need to search that package and install it. In my case I have just used this module

root@localhost#yum install -y perl-sys-syslog

Now the installation has been working.