Categories

expect,sshpass,pash

expect,sshpass,pash
rpm -qa expect

yum install expect -y

useradd mohan

echo 123456|passwd –stdin mohan

su – mohan

ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa >/dev/null 2>&1

yum install lrzsz -y

cat mohan_sshkey.exp
#!/usr/bin/expect
if { $argc !=2 } {
send_user “usage: expect mohan_sshkey.exp file host\n”
exit
}
#define var
set file [lindex $argv 0]
set host [lindex $argv 1]
set password “123456”
#spawn scp /etc/hosts root@10.0.0.142:/etc/hosts
#spawn scp -P52113 $file testserver@$host:$dir
spawn ssh-copy-id -i $file “-p 22 oldgirl888@$host”
expect {
“yes/no” {send “yes\r” ;exp_continue}
“password” {send “$password\r”}
}
expect cof
exit -onexit {
send_user “testserver say good bye to you!\n”
}
#script usage
#expect testserver-6.exp file host dir
#example
#expect mohan_sshkey.exp file host dir
#expect mohan_sshkey.exp ~/etc/hosts 10.0.0.41:~

 

expect mohan_sshkey.exp .ssh/id_dsa.pub 192.168.1.21

 

#!/bin/sh
. /etc/init.d/functions
for ip in 8 31 41
do
expect mohan_sshkey.exp ~/.ssh/id_dsa.pub 192.168.1.$ip >/dev/null 2>&1
if [ $? -eq 0 ];then
action “$ip” /bin/true
else
action “$ip” /bin/false
fi
done

mysqlcheck

[root@clusterserver1 software]# mysqlcheck mysql -uroot -p
Enter password:
mysql.columns_priv
error : Table upgrade required. Please do “REPAIR TABLE `columns_priv`” or dump/reload to fix it!
mysql.db OK
mysql.event
error : Table upgrade required. Please do “REPAIR TABLE `event`” or dump/reload to fix it!
mysql.func OK
mysql.general_log
error : Table upgrade required. Please do “REPAIR TABLE `general_log`” or dump/reload to fix it!
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc
error : Table upgrade required. Please do “REPAIR TABLE `proc`” or dump/reload to fix it!
mysql.procs_priv
error : Table upgrade required. Please do “REPAIR TABLE `procs_priv`” or dump/reload to fix it!
mysql.proxies_priv
error : Table upgrade required. Please do “REPAIR TABLE `proxies_priv`” or dump/reload to fix it!
mysql.servers OK
mysql.slow_log
error : Table upgrade required. Please do “REPAIR TABLE `slow_log`” or dump/reload to fix it!
mysql.tables_priv
error : Table upgrade required. Please do “REPAIR TABLE `tables_priv`” or dump/reload to fix it!
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
[root@clusterserver1 software]# mysqlcheck mysql -uroot -p
Enter password:
mysql.columns_priv
error : Table upgrade required. Please do “REPAIR TABLE `columns_priv`” or dump/reload to fix it!
mysql.db OK
mysql.event
error : Table upgrade required. Please do “REPAIR TABLE `event`” or dump/reload to fix it!
mysql.func OK
mysql.general_log
error : Table upgrade required. Please do “REPAIR TABLE `general_log`” or dump/reload to fix it!
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc
error : Table upgrade required. Please do “REPAIR TABLE `proc`” or dump/reload to fix it!
mysql.procs_priv
error : Table upgrade required. Please do “REPAIR TABLE `procs_priv`” or dump/reload to fix it!
mysql.proxies_priv
error : Table upgrade required. Please do “REPAIR TABLE `proxies_priv`” or dump/reload to fix it!
mysql.servers OK
mysql.slow_log
error : Table upgrade required. Please do “REPAIR TABLE `slow_log`” or dump/reload to fix it!
mysql.tables_priv
error : Table upgrade required. Please do “REPAIR TABLE `tables_priv`” or dump/reload to fix it!
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
[root@clusterserver1 software]#
[root@clusterserver1 software]#
[root@clusterserver1 software]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> REPAIR TABLE `columns_priv`;
ERROR 1046 (3D000): No database selected
mysql> REPAIR TABLE `columns_priv`
-> ;
ERROR 1046 (3D000): No database selected
mysql> quit
Bye
[root@clusterserver1 software]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use mysql;
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
mysql> REPAIR TABLE `columns_priv`;
+——————–+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+——————–+——–+———-+————————————————————————————-+
| mysql.columns_priv | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.columns_priv | repair | status | OK |
+——————–+——–+———-+————————————————————————————-+
2 rows in set (0.00 sec)

mysql> REPAIR TABLE `db`;
+———-+——–+———-+———-+
| Table | Op | Msg_type | Msg_text |
+———-+——–+———-+———-+
| mysql.db | repair | status | OK |
+———-+——–+———-+———-+
1 row in set (0.01 sec)

mysql> REPAIR TABLE `proc`;
+————+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+————+——–+———-+————————————————————————————-+
| mysql.proc | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.proc | repair | Warning | Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘modified’ at row 1 |
| mysql.proc | repair | Error | Invalid default value for ‘modified’ |
| mysql.proc | repair | status | Operation failed |
+————+——–+———-+————————————————————————————-+
4 rows in set (0.00 sec)

mysql> REPAIR TABLE `procs_priv`;
+——————+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+——————+——–+———-+————————————————————————————-+
| mysql.procs_priv | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.procs_priv | repair | status | OK |
+——————+——–+———-+————————————————————————————-+
2 rows in set (0.00 sec)

mysql> REPAIR TABLE `proxies_priv`;
+——————–+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+——————–+——–+———-+————————————————————————————-+
| mysql.proxies_priv | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.proxies_priv | repair | status | OK |
+——————–+——–+———-+————————————————————————————-+
2 rows in set (0.00 sec)

mysql> REPAIR TABLE `slow_log`;
+—————-+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+—————-+——–+———-+————————————————————————————-+
| mysql.slow_log | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.slow_log | repair | status | OK |
+—————-+——–+———-+————————————————————————————-+
2 rows in set (0.01 sec)

mysql> REPAIR TABLE `tables_priv`;
+——————-+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+——————-+——–+———-+————————————————————————————-+
| mysql.tables_priv | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.tables_priv | repair | status | OK |
+——————-+——–+———-+————————————————————————————-+
2 rows in set (0.01 sec)

mysql> REPAIR TABLE `columns_priv`;
+——————–+——–+———-+———-+
| Table | Op | Msg_type | Msg_text |
+——————–+——–+———-+———-+
| mysql.columns_priv | repair | status | OK |
+——————–+——–+———-+———-+
1 row in set (0.00 sec)

mysql> REPAIR TABLE `event`;
+————-+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+————-+——–+———-+————————————————————————————-+
| mysql.event | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.event | repair | Warning | Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘modified’ at row 1 |
| mysql.event | repair | Error | Invalid default value for ‘modified’ |
| mysql.event | repair | status | Operation failed |
+————-+——–+———-+————————————————————————————-+
4 rows in set (0.00 sec)

mysql> REPAIR TABLE `general_log`;
+——————-+——–+———-+————————————————————————————-+
| Table | Op | Msg_type | Msg_text |
+——————-+——–+———-+————————————————————————————-+
| mysql.general_log | repair | Note | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.general_log | repair | status | OK |
+——————-+——–+———-+————————————————————————————-+
2 rows in set (0.00 sec)

mysql> quit
Bye
[root@clusterserver1 software]# mysqlcheck mysql -uroot -p
Enter password:
mysql.columns_priv OK
mysql.db OK
mysql.event
error : Table upgrade required. Please do “REPAIR TABLE `event`” or dump/reload to fix it!
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc
error : Table upgrade required. Please do “REPAIR TABLE `proc`” or dump/reload to fix it!
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK

 

CENTOS 7 MySQL 5.7

CENTOS 7 MySQL 5.7

 

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

yum install -y mysql-community-server

 

systemctl start mysqld.service

[root@clusterserver1 software]# systemctl start mysqld.service
[root@clusterserver1 software]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>update mysql.user set authentication_string=password(“test123″) where user=”root” and Host=”localhost”;
mysql>flush privileges;
mysql>quit;

systemctl restart mysqld;

 

vi /etc/my.cnf

 

[mysqld]

skip-grant-tables

skip-networking

 

[root@clusterserver1 software]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use mysql;
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
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘test123’ WITH GRANT OPTION;
mysql> select host, user from user;
+—————————+——+
| host | user |
+—————————+——+
| 127.0.0.1 | root |
| ::1 | root |
| clusterserver1.rmohan.com | |
| clusterserver1.rmohan.com | root |
| localhost | |
| localhost | root |
+—————————+——+
6 rows in set (0.00 sec)

 

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

 

vi /etc/my.cnf

 

[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci

 

mysql> status;
————–
mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper

Connection id: 5
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ”
Using delimiter: ;
Server version: 5.7.19 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 3 min 28 sec

Threads: 1 Questions: 44 Slow queries: 0 Opens: 56 Flush tables: 1 Open tables: 49 Queries per second avg: 0.211
————–

 

Improvements in health, education and trade are essential for the development of poorer nations. However, the governments of richer nations should take more responsibility for helping the poorer nations in such areas.

The development of any nation lies in the improvement of the health, education and trade of that country. Keeping good health keeps you mentally and physically fit which is essential for people to contribute towards their country.  It is said that the stronger the foundation, the stronger will be the building. Similarly education forms the base on which many talents have to be nourished. So an education with strong values and principles will form the groundwork, and shape a path for many able and genius scholars. Furthermore the trade is essential to keep up with the basic economic requirements of any country. The flourishing of business activities is directly proportional to the development of any nation.

Richer nations play a vital role in cultivating and prospering the poorer nations. Instead of giving grants and loans they can directly help the poorer nations in educating, training and developing business with them.  For Instance Cuba a small country is known for its world class health services. Strong network of health services in Cuba ensures that not only the citizens can reach the doctors anytime, but the doctors also visit every citizen for checkup twice a year.

When talking about education, Finland’s free and equal education for everybody is a typical example which demonstrates how any government can strengthen its education system. In addition to it, if you remember, Japan was devastated after Hiroshima & Nagasaki bombing.  Japan has emerged from a wrecked nation and built a world-class best public transport services, which has been the backbone of the trade in the country.

To conclude, the richer nations should act like a mentor and strengthen up the process of developing the poorer nation.

Most people in what are known as the developed nations have homes full of gadgets and labor-saving devices, from vacuum cleaners and dishwashers to the latest in computer technology. Some people claim that despite all these labor-saving devices, we seem to have less free time. In your opinion, has technology improved the quality of life or made it more complicated? Support your arguments with reasons and/or examples from your own experience and observations.

Most people in what are known as the developed nations have homes full of gadgets and labor-saving devices, from vacuum cleaners and dishwashers to the latest in computer technology. Some people claim that despite all these labor-saving devices, we seem to have less free time. In your opinion, has technology improved the quality of life or made it more complicated? Support your arguments with reasons and/or examples from your own experience and observations.

 

Over the last few decades, the technology has evolved at a pace like nothing has ever progressed before. Our day to day life is dependent and influenced by gadgets all the time. A few years back, most of the houses would have a computer, a calculator, a camera, a common telephone. All these things are now replaced by a single device – the mobile phone. The advancement in technology has brought the whole world to the small hand-held device.

With the advent of technology available to build applications on top of the available operating system and easy access to computers at low cost has brought in a revolution of sort. The way we communicate has now moved from the traditional talks to instant messaging, icons, emoticons, pictures and videos. Applications like WhatsApp, SnapChat, Skype, Facebook etc. has brought world together and much more connected that ever before.

On the other hand, along with real-time means of communication and share things, the information that was confined in books and within small groups are now available at the click of a button. There is live broadcasting of current affairs and the happenings around the world. The flood of information from all directions has, on the contrary, to connected, disconnected an individual from the people around us. People now spend more time on mobile devices and less time looking around and talking to people sitting next to them. This disconnected connect has actually brought in depression because not everyone can do everything that others are doing.

Citing both the views, I would say it while the technology has brought in devices and connections in the virtual world, people have moved away in the real life. Time wasted being on the devices has actually made less time available for the people around us.

 

 

 

Violence portrayed on TV and in the movies leads to an increase in crime in our society. People who watch violent movies are more likely to become criminals. Do you agree or disagree?

Violence portrayed on TV and in the movies leads to an increase in crime in our society. People who watch violent movies are more likely to become criminals. Do you agree or disagree?

 

Since the time the television was invented in the 1940’s, it has been the foremost form of entertainment for the young and the old alike. The amount of information and entertainment available on TV was unparalleled till date. The television has always been a part of a families entertainment time.

The with the advancements in technology and easy access to low-cost equipment, there is far more variety of programmes available, from drama to comedy, from sports to adventure, and from food to fighting. Among other things, there is loads of violence and sex programmes and films available to watch at all times. As television is watched by people of all ages, including children and the access to all this content, television is a dangerous place. The children are too innocent to decipher between the right and the wrong. They easily get influenced by the violence shown on TV.

The way a villain’s lives is depicted as adventurous, attractive and full of fun, kids get influenced by the way the fictional character walk, talk and interact with others in film’s and programmes. The kids see the act of smoking, consuming alcohol, and tottering guns and fighting, as a way of life. Long exposure of such content to a child leads to the imitation of such behaviour. To add to all this is the little time parents spend with children due to long work hours. This lack of attention from parents and no one to correct their behaviour at an early stage leads to a negative prejudice mind.

To conclude the topic, I would like to suggest that it is mandatory that the government should bring law’s that deal with restriction of content. Also, set parameters to regulate the quality of content that is allowed on television. The unrestricted content has made adults and young once take up crime and lead to an overall depletion of the society.

Pros and Cons of extreme/adventure sports

Sporting activities like bungee jump, sky-diving, wing-suit surfing etc. are known as extreme sports. These activities, when done provide an adrenaline rush like nothing else. Over the past few years, there has been a significant growth in the number of people indulging in such activities, turning it into a multi-billion dollar industry. But along with excitement comes the risk of losing once life as well.

To begin on a positive note, I see these activities as a way to concur once fears, a mean to gain confidence, and learn to appreciate the life’s difficulties. When an individual indulges in extreme sporting activities, it not provides the person with a short boost of excitement but gives the person the energy and exhilaration to achieve every task better in the day to day life. A person is motivated to go above and beyond his limits. Do things which the person previously thought were not something he could perform and conquer. A person afraid of heights when goes on to do sky-diving, his phobia ceases to exist. A person afraid of water when goes on to do scuba diving, his fear diminishes.

On the other hand, over the past years, there are hundreds of reports of people losing their life while taking part in such activities. Due to lack of following safety measures, or just due to the failure of equipment has claimed many lives. In a recent case, a woman doing tandem sky-dive lost her life along with the instructor due to equipment failure.

To paraphrase the above, I feel everything we do and take part in has both, the negative and the positive face. It depends on a person to take this risk or not.

DO YOU THINK ENGLISH WILL REMAIN AS THE DOMINANT INTERNATIONAL LANGUAGE THROUGH GLOBALISATION?

Over the last few decades, there have been significant advancements in the fields of sciences, technology and medicine. The main reason behind each is the improvements in the field computer technology. Today the world is a global village with farthest corners of the world connected to each other at the click of a button. The mobile communication has opened far more and greater channels of being connected and communicate. Just like same technology everywhere to connect, there is a need for a common language as well.

Between the 17th to the 20th century, the British ruled almost the entire world. While moving from one part of the world to another, the most significant thing that they took along was their language, English. As the empire expanded to the far corners of the world, so did the language. Over time, several countries have adopted English as their primary official language along with the native language. If not for English today, each country would be in silos and will not able to grow as part of the global economy.

Due to the English language, a person sitting in China can communicate with a person living in France and able to do efficient business. Even young students are able to migrate to western countries for higher and better education, followed by some amazing career options. English is a primary language requirement in the case of permanent immigration as well.

While Chinese Mandarin is the most spoken language around the world, but having been confined within the country, it can never have an impact as much as English has on the world. Saying so I believe that English is, and will remain the dominant language through globalisation.

Television has two roles: to inform and to entertain. Explain which of these roles you see as more important. To what extent do you think that TV today performs each of these roles in an effective way? Support your point of view with details from your own experiences, observations or reading.

Television has two roles: to inform and to entertain. Explain which of these roles you see as more important. To what extent do you think that TV today performs each of these roles in an effective way? Support your point of view with details from your own experiences, observations or reading.

Television when invented in the 1960’s, was primarily for the purpose of entertainment. People liked to spend time watching the dramas or information programs together with the whole family. Earlier there was little else to engage into.

Over the decades, the content on the television has had a dramatic change. With the advancements in technology and sciences, there is more information available. The availability of equipment to discover new places, and invent things, has lead to a race to know more about the world. This has eventually lead to a lot more information being made available on the television. In current times, along with family dramas and information, the meaning of entertainment is not only restricted to family drama’s and film’s but know about the things, nature, the world around is equally a type of entertainment. Channels like Discovery, TLC, BBC provide holistic infotainment.

Similarly, use of technology in broadcasting live events, like from a war zone, a music concert, a sports event etc., has brought in real time information being available to watch. To know about what is happening around the world, the current issues, the natural disasters or medical emergencies plaguing various places. This information being shown on television has lead people to engage themselves in activities that can prevent such happening in future. Or just go ahead and help in various rescue operations.

To conclude, given the various examples above I would say the television has played the role of providing entertainment and information very well. This has also lead to people being more aware and encouraging them to take up various social causes. Which overall is beneficial for the society.

“In a war of ideas, it is people who get killed”. Does a common man suffer from a group’s ideology? Express your opinion, and support the same with reasons and examples?

 “In a war of ideas, it is people who get killed”. Does a common man suffer from a group’s ideology? Express your opinion, and support the same with reasons and examples?

 

While reading the statement there are lot of things that can be said on war of ideas” first of all I will clear this statement that war of ideas means the decision which is made on spot. I am partially agreed with statement and give my viewpoints in upcoming paragraphs.

Firstly elaborating, it can be said that there are lot of steps  taken by politicians such as Russia that threw bombs on Yemen to kill members of terrorist group “lakshar-e-Taliban”, so by these steps peace cannot be maintained and it would not be good for mankind. Numerous countries join the international meeting against the terrorists in USA.

Secondly if discussing about cons of this statement are that some countries that give orders to attack on other countries to kill terrorists like America and Russia, but in some situation’s record shows that innocent people were killed. So it is too dangerous for the growth of country and individuals. Moreover war is the root cause of disease. For instance: – Japan in 2nd world war.

 

Finally, from my point of view that this statement have both values but the steps which are taken by politicians should be non violent and should be safe for masses.

Page 4 of 159« First...23456...102030...Last »