How do I recover MySQL root password?

Recover MySQL root password in 5 Steps

In the rush of things, we sometimes fail to remember some important information such as wife's birthday or your MySQL password. 

Here are the steps that you may use to reset you MySQL password. For the problem of remembering wife's birthday, you will have to find your own solution. There's a solution to improve your memory, but that post will come later.

This assumes that you already have access to the computer but have misplaced your MySQL admin password.

These are the steps I followed to to reset the MySQL database server password.
Login as superuser, as root.

1. Stop the MySQL server process.
# /etc/init.d/mysql stop

Output:
Stopping MySQL database server: mysqld.

2. Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for a password.

Start the MySQL server w/o password:
# mysqld_safe --skip-grant-tables &

Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

3. Connect to the MySQL server as the root user, using the MySQL client.

# mysql -u root

Output:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

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

mysql>

4. Set a new root password.

mysql> use mysql;
mysql> update user set password=PASSWORD("YOUR-NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Note: It is important that you give password("Your new root password") and not just the "NEW-PASSWORD", which is a common mistake that happens.

5. Exit and restart the MySQL server.

Stop the MySQL server:
# /etc/init.d/mysql stop

Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended

[1]+  Done                    mysqld_safe --skip-grant-tables

Start the MySQL server and test it:
# /etc/init.d/mysql start
# mysql -u root -p

Calendar template for a bird's eye view of events

A bird's eye view of events in a calendar template

I wanted a calendar template that would show me a list of events that we have scheduled for the month, for our internal use.

I am okay with jQuery, Javascript and all, but why take the effort to re-create a wheel when it is available readily.

So, I jumped into the Google ocean and looked around for this Calendar shrimp. There were many available, but this particular module from CodexWorld.com seemed appropriate.

It is based on php, jQuery and Javascript, which is my development environment as well. It has all the requisite code in a single, simple, easy to understand piece of php file.

You would need to provide the database credentials in the file dbConfig.php. 
There is a function getCalender() in the php file functions.php, where you can make changes in the section [id="calender_section_bot"], to change cell colours and to show additional information as you find appropriate.

I made some changes to the table structure and the script to customize it to suit my requirement.

Note that you have to link to the bootstrap css, jquery js files and the custom style sheet to make it display properly.

If you do not link to bootstrap css, the alignment of the calendar will misfire.

Here is the link to the calendar template.

Build event calendar using jquery ajax php

PHP - Error 500 - Centos 7





Error 500 Internal Server Error in PHP


I have a Google Instance running Centos 7.

I had this strange Error 500 message whenever I upload a piece of php code.

When accessing through the browser, it comes up with the error message, which was loading without issues in my local machine.


 

Internal Server Error


The error was something like this.
HTTP request sent, awaiting response... 500 Internal Server Error
2016-10-18 11:28:33 ERROR 500: Internal Server Error.
I searched around and found a solution probable solution.

Somebody suggested that I execute the following command to make it right.

sudo chcon unconfined_u:object_r:httpd_config_t:s0 myfile.php

It did work though I do not know why. My guess is that it could be something to do with the newline and return values.

Notepad plus, which is the editor that I used for this purpose, has the options, Windows, Unix and Old Mac under "Edit", "EOL Conversion". My guess is that choosing "Unix/OSX format" when saving you code in Notepad plus might be another method to solve the problem.


Here is another instance where the 500 Internal server error may occur. Let us suppose you have a symbolic link to a folder that is present elsewhere in the disk. You are referring to a specific file, it may be a config file which you want to include in your php code. This error is thrown because Centos has a problem accessing the file due to non availability of rights. As you know, every object in Unix is accessible based on rights only.

How to find the exact problem for Internal server error

Our system was Unix/Centos


We can find the exact problem by looking at the httpd server logs that are created in the Apache server or Nginx or any server that you may be running.

So, what is the Centos error log file location?

In Centos, the Centos error log file path would be  /var/log/httpd/-error_log

So, if your domain is google.com and you are running your webserver in a Centos machine, then the path to your error log file would probably be  /var/log/httpd/google.com-error_log

An example error_log file would look something like this.

[Tue Oct 18 11:35:28.950158 2016] [:error] [pid 15013] [client 172.xx.xx.49:33929] PHP Warning:  include(/home/ghost/rider/tajmahal.php): failed to open stream: Permission denied in /home/ghost/rider/opendata.php on line 3
[Tue Oct 18 11:35:28.950188 2016] [:error] [pid 15013] [client 172.68.146.49:33929] PHP Warning:  include(): Failed opening 'tajmahal.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/ghost/rider/opendata.php on line 3


If you look in the above log, it becomes obvious where the error lies. 

Hope it helped. 

The Perils of ECR Chennai

The East Coast Road!

It is advertised as a route with scenic splendour. It can take you from Chennai to Pondicherry in no time. It can also take you from road to heaven (or hell or wherever) in no time too.

Especially during the nights. The markers are showing their age. It is obvious that whoever is maintaining them are not too worried about a few counts lesser in the population. The government can afford a few thousands to the family of the deceased, with the chance to be in the news offering condolences to the bereaved families.

The road is dotted with invisible road blocks that are veritable death traps during the night.

These are the problems I saw during my recent travel on the ECR.
  • Reflective road paint are covered with sand and dust at most places, making the road borders invisible
  • No advance notification of road blocks ahead, which might take you by surprise/shock, leading to instant heaven or hell or whatever, according to your religious inclination. In some cases, the road blocks are setup at curves (Imagine the intelligence and road sense of whoever did it). And these road blocks do not carry reflective paint or stickers on them. These road blocks are also completely opaque, which means, you do not see the vehicles coming in the opposite direction, even during the day (unless yours is a bigger vehicle).
  • Deteriorating road quality, unsatisfactory maintenance
  • Reflective road markers that do not reflect, leading to insufficient visibility
In essence, you may wish NOT TO TRAVEL BY THE ECR DURING THE NIGHT.

If you still want to drive, do not exceed the speed of 80 kilometres per hour. It might take a little longer, but it will take you where you want to go.

STOP! Don't forward that eMail!

Today I received another one of those special mails! Chain mails, I mean. This was about how instant noodles cause cancer in you. It told me in no uncertain terms, to stop eating instant noodles. It told me that Instant noodles contain wax that is not easily expelled from your body. It is also carcinogenic and so on. It claimed that many people had died after eating instant noodles, (not instantly, I think).

I did some preliminary search and found that this particular email has been doing rounds since 2002. Imagine, a simple mail going around and around for 5 years now.

These kinds of letters come in all flavours; religious, business, medical, political, philanthropical and what not!

Irritating though they are, one still wonders how gullible and naive our readers can be that believe them. Probably, the concern that they have for others is taken advantage of. And, in any case, I do not lose anything when I forward just this one mail. Or does it affect somewhere?

One should ask oneself. How many people are using email everyday all over the world? And, if one mail is forwarded by everyone every week, just how much of bandwidth is consumed? How much of your friend's time is wasted in reading that particular mail, which he/she could use spending with the family. We could probably use that bandwidth better. And certainly not be a part of spreading misinformation and spam.

So, beware. Before you forward that next mail, try to do a little research yourself. Or, if you aren't so sure, just ignore it. You are not here to save the world. God (or if you are agnostic, Nature) will take care of it.

For some insight into the various ways that people get baited, I suggest you follow the below :
http://www.breakthechain.org

Happy surfing!

The Game called Cricket!

Cricket! It used to be called the Gentleman's game, in the days of yore. Is it anymore?

If you are a gentleman, you would give back the excess change you got at the store. If you are a gentleman, you would smile and tolerate short change given to you at the store. May be you will ask once, but if the storekeeper insists, you would walk away.

This is neither a store, nor are we gentlemen. It is a matter of victory in war. All's fair in love and war.

I am referring to the Symonds's incident last night. There used to be a time when cricketers felt ashamed about such a thing happening on the ground. But, times have changed. It is alright to be dishonest; and admit it. In fact, it is hip. "It is my day. I was given not out anyway".

Little does he realise that there are kids out there looking at him. Kids, to whom he is a role model. Kids, who emulate him, and tell themselves, its okay to be dishonest.

Thats bad for cricket, and in general.

Not surprising when this happens to be Australia. This is a team that almost disowned Adam Gilchrist, when he walked without waiting for the umpire's decision (more than once), in 2004. May be the australians have, as a team, agreed to "never walk, unless the umpire tells you".

Could have been different in different times, when there weren't any action replays, slow motions, snickometers et al. Come to think of it, how did the umpire miss the noise? Had it been in India, it could be said that the noise of the crowd drowned the noise of bat grazing the ball.

Flipping the other side of the coin, we see the player thinking, "I could be dropped, if I walked". "Then, I will lose my endorsements, my wife will divorce me". "And, ...".

A lot more seems to be at stake, these days. So what would you do? Walk or Stay?

By the way, does Adam Gilchrist walk these days?

---

Who's honest? An incomplete list. Add your suggested name too, to make it complete.

Gary Sobers
Brian Lara
Sachin Tendulkar
Adam Gilchrist
Sunil Gavaskar
Courtney Walsh
Kapildev
Clive Lloyd
G R Viswanath
Jonty Rhodes

How do I protect my computer from the Interne(t)Devils?

People keep wondering how to keep their computers free from viruses and worms and other Internet (d)evils. I have tried to put in some information for those who would be seeking answers to the questions regarding Internet Defence in this document.

The Internet is no more a safe place. You are vulnerable the moment you are connected to the Internet. As a regular Internet user, you would be advised to follow some basic rules to distance yourselves from the threats that are impossible to avoid completely.

I assume that you are using a Windows machine (such as XP or Windows 2000).

If you are not very familiar in using the computer, ask your computer technician to
1. Install a personal firewall and configure it
2. Install an antivirus utility
3. Install Firefox browser
4. Install Ad-aware
5. Install Spybot S&D
6. Download Process Explorer and Hijackthis

After installation, your computer has to be checked once for viruses and spyware, immediately.

Alternately, you could prefer to do it yourself. Follow the instructions below.

1. Install a personal firewall

There are free software firewalls (hardware firewalls are expensive and are not oriented towards individual machines) available such as Comodo (http://www.personalfirewall.comodo.com) which are quite good. Others like Zone Alarm, Kerio are also offer adequate protection. Some of them might expect you to make a payment before you could use them.

2. Install antivirus

You need an anti-virus tool that would keep you informed in case your computer is infected by a virus, trojan or similar malicious application. AVG is one that is available free of cost for personal use. You can download it from http://free.grisoft.com. AVG has a small footprint (which means it doesn't consume too much memory and is not a load on your computer) and protects you from most viruses.

3. Install Firefox browser

There is a general perception that the Internet Explorer is less safer on the Internet. If you are using the Internet Explorer, I recommend that you download and install the latest version of Firefox browser ( available from http://www.mozilla.com/firefox/ )

According to wikipedia, Spyware is computer software that is installed surreptitiously on a personal computer to intercept or take partial control over the user's interaction with the computer, without the user's informed consent. More information on spyware may be found in http://en.wikipedia.org/wiki/Spyware

There are certain things that you should avoid when you are online. Those are visiting crack sites, sites that contain pornographic content, sites that offer you free software, hacking sites etc., It doesn't mean that all such sites are malicious, but for the unaware and uninitiated, it means treading dangerous waters.

To protect you from Spyware, you should install tools that check your computer frequently for other malicious content (such as spyware) that could reside in your computer. These get installed/saved on your computer as a result of using the browser and visiting sites.

4. Install Ad-aware

Download and install, Ad-aware from the following link ( http://www.lavasoftusa.com/products/ad_aware_free.php )

5. Install Spybot S&D

Download and install "Spybot - Search & Destroy" from the following link
http://www.safer-networking.org/en/index.html

When all the above have been done, you can breathe a little easily now that you have done the first part of the job.

The other and most important part, is to be reviewing your security frequently, say every two days. Run your virus scanner, Ad-aware and Spybot S&D, every alternate day or once in three days, or atleast once in a week.

Note down any incidents. There may be a situation where your virus scanner may not be able to clear the virus.

In that case, you may search the WWW for methods to clean it.

The mantra is to update your virus scanner and other tools with the latest updates and frequently check your machine for any suspicious activity.

Run the tools Ad-aware and Spybot S&D frequently, or immediately after you close your browser.

6. Download Process Explorer and Hijackthis

Process explorer tells you the processes that are currently executing on your windows operating system presently. This is preferred over your windows task manager, since malicious software may be hidden from the windows task manager's view.

Download procexp.exe from sysinternals.com (incidentally, the company now has been bought over by Microsoft) http://download.sysinternals.com/Files/ProcessExplorer.zip

Hijackthis is an application that shows the windows registry keys that contain actions that will be executed during the time the operating system is booting (the steps involved before you get your windows desktop). You can go through them and look for suspicious looking files [some of them may contain the extension .exe]

Download hijackthis.exe from http://216.180.233.162/~merijn/programs.php#hijackthis or http://www.spywareinfo.com/~merijn/programs.php#hijackthis

Now that you are more knowledgeable, I hope that you would try these tools that would arm you to protect your computer from hostile invasions.

PS: One other thing that you could do, is to ask the Internet fellow to install a router (assuming yours is a DSL like connection) and configure the IP to the router and not to the machine, which means your computer is not directly connected to Net and is protected from Direct Attack.

Visual Ads vs. Text Ads: Why Pictures Usually Steal the Show for Better Ad Performance

Are you ready to read convincing information on this topic? Hey. Let's have a quick chat about something super important for anyone want...

Most Popular

Copyrighted.com Registered & Protected DWYE-NHTO-NBNH-7FFM