Thursday, February 5, 2015

How to Huawei router configuration

How to Huawei router configuration


Huawei router configuretion is very easy. Any people can do it esely. I have giv the simple command below:
Huawei router configuration
<Huawei>
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]

[R1]interface GigabitEthernet 0/0/0

[R1-GigabitEthernet0/0/0]ip address 10.12.12.1 24
[R1-GigabitEthernet0/0/0]

[R1-GigabitEthernet0/0/0]quit
[R1]

[R1]interface GigabitEthernet 0/0/1

[R1-GigabitEthernet0/0/1]ip address 10.12.13.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]

[R1]interface LoopBack 0

[R1-LoopBack0]ip address 10.12.1.1 24

[R1-LoopBack0]qui

[R1]quit

<R1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Feb  6 2015 12:15:06-08:00 R1 %%01CFM/4/SAVE(l)[0]:The user chose Y when deciding
 whether to save the configuration to the device.
Now saving the current configuration to the slot 17.
Save the configuration successfully.

How to Huawei router IP configuration

How to Huawei router IP configuration:

Huawei router IP configuretion is very easy. Any people can do it esely. I have giv the simple command below:
Huawei router IP configuration
Huawei Router IP configuration.
At first we will get user view.
<Huawei>
then we have to enter system view by simple command "system-view"
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
 Now we will give the router name Like as R1.
[Huawei]sysname R1
[R1]

[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.10.12.1 24
[R1-GigabitEthernet0/0/1]
[R1-GigabitEthernet0/0/1]quit

[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.10.13.1 24
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]quit
 
[R1]interface LoopBack 0
 [R1-LoopBack0]ip address 10.10.1.1 24
[R1-LoopBack0]

I think it work fine.

Wednesday, February 4, 2015

Find Command



Find Command:



# find /usr/share/icons -name .png (only .png search)

# find /usr/share/icons -name *.png (regular expression is used)

# find -user liton -not -group liton (user liton but group is not liton)

# find /home -user liton -o -user user2 (user liton or user user2)

# find /home -not \( -user liton -o -user user2 \) (not user liton or user  user2,must be space before - and after user name)

# find / -name "*.png" -not user root ( find those png file whose user is not root)

# find / -name "*.png" -user root -mtime 12

# find -perm 744 (Exact Match)

# find -perm +222 (Matches if anyone can write)

# find -perm -222 (Matches if everyone can write)

# find /usr -size 1024k (Exact 1024)

# find /usr -size +1024k (Greater than 1024)

# find /usr -size -1024k (Less than size 1024)

# find -size +102400k -ok gzip {} \; (find 100M file or Folder and then compress those file/folder)

# find -name "*.conf" -exec cp {} \mnt \;

Mysqladmin flush commands

  All mysqladmin flush commands.

# mysqladmin -u root -ptmppassword flush-hosts 
 
# mysqladmin -u root -ptmppassword flush-logs 
 
# mysqladmin -u root -ptmppassword flush-privileges 
 
# mysqladmin -u root -ptmppassword flush-status 
 
# mysqladmin -u root -ptmppassword flush-tables 
 
# mysqladmin -u root -ptmppassword flush-threads

  • flush-hosts: Flush all information in the host cache.
  • flush-privileges: Reload the grant tables (same as reload).
  • flush-status: Clear status variables.
  • flush-threads: Flush the thread cache.

How to set MySQL root password?



How to set MySQL root password?


To set MySQL server root user password,

start the server, then issue the following commands:

# /usr/bin/mysqladmin -u root password 'new-password'

# /usr/bin/mysqladmin -u root -h www.example.net password 'new-password'

Alternatively you can run:

# /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

How to create a MySQL Database in Linux ?



How to create a MySQL Database in Linux?


First login to your mysql server with your root credential


# mysql -u root –p
 Enter password:      (now type your root passwort)

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 705
Server version: 5.1.25-rc-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Now create database testdb1

mysql> create database testdb1;

Now show all databases.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test           |
| testdb1             |
+--------------------+
4 rows in set (0.00 sec)

How to change the MySQL root user password

How to change the MySQL root user password?

# mysqladmin -u root -pPresent password 'newpassword'
 
Example: 
 
# mysqladmin -u root -pcisco password 'juniper'
 
Now try to login by your new passowrd 
 
# mysql -u root -pnewpassword 
 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.25-rc-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Monday, February 2, 2015

How to display Apache web server status?


Linux Display Apache web server status?
Open your httpd.conf / or  apache2.conf file:

# vi httpd.conf

At the end of file append flowing  line that read as follows to allow access from 202.84.36.32 only:

<Location /server-status>
   SetHandler server-status
   Order Deny,Allow
   Deny from all
   Allow from 202.84.36.32
</Location>

You can also restrict access using a domain name:

<Location /server-status>
   SetHandler server-status
   Order Deny,Allow
   Deny from all
   Allow from w1.bigdata.logspot.com
</Location>

Save and close the file.

Restart web server:

# service httpd restart

Find a web browser and type the url http://your-server-ip/server-status or http://your-domain.com/server-status