Wednesday, September 25, 2013

how to change root password mysql

# /etc/init.d/mysqld stop
# /usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
# mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD("your password here") WHERE User="root";
mysql> exit

# /etc/init.d/mysqld stop
# /etc/init.d/mysqld start

Friday, September 6, 2013

Cisco switch port in err disabled , how to recover

go to the specific port configuration mode.

disable port security , disable and enable

 
 
show port 0/19                          will show state
 
Port  Name               Status     Vlan       Level  Duplex Speed Type
----- ------------------ ---------- ---------- ------ ------ ----- ------------
0/19              errdisable   1 normal   auto  auto 10/100BaseTX
 


acc-sw-2960-48p-svr-(config-if)#no switchport port-security

acc-sw-2960-48p-svr-(config-if)#shutdown

acc-sw-2960-48p-svr-(config-if)#no shutdown

Sunday, June 16, 2013

Fix yum error CentOS linux : Error: file is encrypted or is not a database

Error: file is encrypted or is not a database             

[sameera@gemini test2]$ sudo yum clean
Loaded plugins: fastestmirror, refresh-packagekit, security
Error: clean requires an option: headers, packages, metadata, dbcache, plugins, expire-cache, rpmdb, all
[sameera@gemini test2]$ sudo yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base epel extras linuxtech-release rpmforge updates
Cleaning up Everything



Tuesday, April 16, 2013

PPTP VPN server Linux

Step 1. Install PPTPD
If your OS is CentOS/RedHat 5:
yum install ppp
cd /usr/local/src
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.rhel5.x86_64.rpm
rpm -Uhv pptpd-1.3.4-2.rhel5.x86_64.rpm
If your OS is CentOS/RedHat 6:
yum install ppp
cd /usr/local/src
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.el6.x86_64.rpm
rpm -Uhv pptpd-1.3.4-2.el6.x86_64.rpm
If you are using Ubuntu:
apt-get install pptpd
Step 2. Edit IP setttings in /etc/pptpd.conf
vi /etc/pptpd.conf
localip 192.168.0.1
remoteip 192.168.0.101-200
Step 3. Add user account in/etc/ppp/chap-secrets (assign username and password)
vi /etc/ppp/chap-secrets
usernameForuser1 *  setpassword1here  *
usernameForuser2 *  setpassword2here  *
Step 4. Optional settings in /etc/ppp/options.pptpd
vi /etc/ppp/options.pptpd
ms-dns 8.8.8.8
ms-dns 4.4.4.4
Step 5. Enable network forwarding in /etc/sysctl.conf
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
use the following command to apply the change:
sysctl -p
Step 6. Configure firewall
iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT
service iptables save
service iptables restart
If you are using CSF firewall, you may refer to this post on firewall settings.
Step 7. Start PPTP VPN server
If your OS is CentOS or Redhat, using the following command:
service pptpd restart
To start PPTP Daemon automatically when rebooting next time, use command:
chkconfig pptpd on

If your OS is Ubuntu, you just reboot your machine.
Now you can test the VPN server from any client: Windows PCs, Linux PCs, Android phones/tablets, or iPhone and iPad.
The log of the VPN server, by default, is combined with system log located at /var/log/messages.

Monday, April 8, 2013

Removing AD Domain Controller  by  Force

use   dcpromo /forceremoval  command

Wednesday, February 6, 2013

How to recover cisco switch port from err-disable state



Port is in err-disable state? And you don't know what to do?
switch01#show int G1/0/19
GigabitEthernet1/0/19 is down, line protocol is down (err-disabled)

Find out the main reason for err-disable state. In our case it is port security violation on port Gi1/0/19.
#show interfaces status err-disabled
Port      Name               Status       Reason
Gi1/0/19  SERVER01    err-disabled psecure-violation
Gi1/0/46                     err-disabled psecure-violation
Gi2/0/12                     err-disabled psecure-violation
Fix port configuration:
int G1/0/19
 no switchport port-security
 shut
 no shut

Wednesday, January 30, 2013