Disappearing SSL certificates from IIS 7.0 Manager



Disappearing SSL certificates from IIS 7.0 Manager


Keep in mind that they are going to cost you much.

If you have two ssl certs for a domain.com and then a sub.domain.com, these two certs cannot be installed in IIS servers upto version 7.5.  IIS8 on Windows 2012 supports it though.

Note: you need to create the csr on the machine where you will be installing the ssl certificate. otherwise, the private key is not present and the ssl certificate is not installed properly.

Solution:

Got this below information from elsewhere...

JBrunelle
April 9, 2014 at 8:01 am
If anyone is still watching this thread… I came across this with a digicert cert as well. What I did was import it anyway into IIS. After adding it, but before it disappeared I right-clicked and selected view on the cert, went to the Details tab, and selected copy to file. Selected to export the private key, and assigned a password. Then I refreshed (cert was gone) and re-imported the now .pfx cert and entered the password.

Worked like a charm.

1. Import cert anyway

2. Right-click > View

3. Details tab > Copy to File

4. Export PK, assign password, export as .pfx

5. Import new .pfx





It didn't work for me, though. Because, I had created the csr from a Centos 7 linux server.

It is indicated that the certificate may not be installed and doesn't work if the private key is not part of the SSL certificate.

So, I copied the issued certificate to my Centos 7 server and then issued the following command to export it to .pfx format

openssl pkcs12 -export -out sub.domain.com.pfx -inkey sub.domain.key -in sub.domain.com.crt -certfile sub.domain.com-intermediate-cert.crt
Enter pass phrase for sub.domain.key:
Enter Export Password:
Verifying - Enter Export Password:

In the above, enter the pass phrase you keyed in during the creation of the certificate signing request.

The resultant .pfx file created may be used to install the SSL certificate in your IIS server.

After all this effort, if you are trying to install the two certificates on an IIS 7.5 web server or less, you are bound to be unsuccessful, because multiple certs for multiple domains are supported only in IIS 8+ onwards.

That is what we found the hard way. May be we should have researched better.

So, that's what we will be doing. Setting up the Windows 2012, IIS 8+ and install the certificates separately.

Will keep you updated.

A simple introduction to jQuery

jQuery - A small introduction

What is jQuery?


jQuery is a JavaScript library, one of many available in the market, which can be used to create actions on your web pages, based on user interactions.

All that can be done using jQuery can be done using JavaScript itself. But, it is going to be a big task, in terms of time spent and repetitive code content. By using jQuery, you avoid repetitive code blocks, while making code writing simple and making it easy to make corrections to your code.

What can I do with jQuery?


You can make highly interactive user interfaces, which create rich user experience for the end user.

Show me a simple example of jQuery

jQuery is used in tandem with HTML and JavaScript and BootStrap, usually. The steps involved are creating the HTML document, with the necessary lines to refer to the JavaScript and the BootStrap libraries.

Next, the HTML text is created, if required.

Finally, the jQuery code is written.

The code, given below, will show a message which informs the user "jQuery says Hello!".


The HTML + jQuery Code


<!DOCTYPE html>
<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

</head>

<body>
This is a sample HTML file created to demonstrate jQuery. Refresh this page to see again the message alert created through jQuery.
<script>
$(document).ready(function() {
alert("Hello from jQuery!");
});
</script>
</body>
</html>

The Explanation

What you need to notice is the statement $(document).ready();

That will be your default statement for all your html, if you want jQuery in your html. The above code tells the browser to execute the code within the function when the entire document has been loaded.

What we have done:

We have inserted a JavaScript function inside the ready() function and gave an alert() call with a greeting message.

function() {
alert("jQuery says Hello!");
}

The function; it is called an anonymous function, since we have not attributed a name to it, will be called right at the moment when the html document has finished loading.

Congratulations! You have just now completed your first jQuery program.

How do I calculate the fixed tax amount from the overall amount


How do I calculate the fixed tax amount from the overall amount


This was a task that came to me today. One of our colleagues wanted to calculate the tax payable to the government. 

Most businesses, especially when doing business in known circles are given only a rounded amount for services rendered or products purchased.

So, if the product is 1200 + taxes, the customer will only pay 1200 nett.

The onus is on the seller, to calculate the actual amount of tax payable.

Now, I wanted to find out what will be my tax amount, that is the amount I will have to pay the government as tax, from the 1200 i received from my customer.

The tax percentage is 28.75. I need to find out x, which will be the value I will retain and 1200 -x will be the tax amount payable.

My equation for the solution was this.

1200 =x + (x * 28.75/100)

I wanted a quick answer. My algebra was rusty due to years of disuse. It was then mathpapa.com came to my rescue, with its algebra calculator that gave me the simplified equation.

Mathpapa Algebra Calculator

It is a simple algebra calculator, which enabled me to calculate the tax amount from the overall amount.

So, when I filled in the formula in the text box, the site calculated the formula and the value of x for me; which is 1200/1.2875

So, there you are!

Formula to calculate the fixed tax amount from the overall amount

Tax amt payable = Overall amount / 1.(Tax percentage x 100)

Parse error: syntax error, unexpected '=' in path/to/filename.php on line


Parse error: syntax error, unexpected '=' in path/to/filename.php on line xxx

It is usual to get cryptic error messages when executing php code. It is not intentional but essentially it tells us that the code is not right in just about the indicated area. 

Take a look at the sentence given below.

variable ="select item from my_images where id =$key";

We will have to look a little ahead and a little behind the "=" symbol, in this case.

At first glance, everything seems to be in order. This is true, especially, when one is in an agitated condition.

But, if you analyse the php program statement carefully, you will notice that you have forgotten to place the mandatory $ sign, which indicates that the word is a php variable.

This is a common error in php. 

Place the $ sign before the variable name and all things seem okay.

As to the question of why you need the $ in the first place, it is to declare that this specific word will store some information within.

It provides more clarity to the code and the habit is continued from other programs such as Perl, where a $ is prefixed to define a variable as well.

Chennai shuts down for Cyclone Vardah's visit

Chennai is devastated, would probably be an understatement. Well, it might be an exaggeration, but closer to the truth.

Vardah is closing in

Cyclone vardah nearing Chennai
Cyclone Vardah 173kms/94nm from landfall

The morning started normally in Chennai; it had started raining the previous night. And, I was keeping track of its progress through windytv, which showed the progress of the cyclone continuously. And, it looked like Chennai is going to be real close to the eye of the storm.

By the way, Chennai has not directly been attacked by a cyclone, at least not from memory. If you ask the experts, they would tell you like "this reminds us of 1972, when something like Cyclone Vardah happened"!

We decided to attend office and started around 10. Traffic was lean and the warnings on TV helped the cause. It was windy with occasional gusts, though it didn't rain much; only a constant drizzle.

Couldn't enter the road where our office is located because a tree had fallen across the road. Found a place under a fairly young tree who looked like he could withstand the powerful winds. Walked the rest of the way to office (the road was wet and water level rising). By this time, power had been shutdown throughout the city. 
Our inverter was switched on and we checked the status of the progress of the cyclone Vardah on the web.

Vardah crossing Chennai



Chennai was too close to the epicenter from the looks of it and we feared that this again would be another bad first in recent times for Chennai.

And what a big bad it turned out to be!!! In just a matter of few hours, between 11am and 2pm, about hundred trees were down in Adyar, courtesy Vardah, on the streets, inside houses and on the main roads.

The services people were quick to attend, but probably short staffed. The trees on the main roads were being  attended to on priority late in the evening.

We decided to go back home, when there was a lull in the storm at about 3pm. By this time, our road was inundated and yet another tree had fallen to Vardah. We waded through knee deep water till the the nearest junction, where the vehicle was parked covered fully in twigs and leaves, truly a green automobile.

The relief of finding the vehicle unharmed transformed into disappointment, when we realised that we were trapped when Vardah sir told us "Hey! I am the boss for today! Why don't you leave the vehicle here tonight at my mercy and walk home".

So, we found a safe place without any trees around, parked the vehicle. Luckily, a friend who stays nearby, lent their Honda Activa and we reached home by about 7pm.
Winds were getting stronger by then, even though it didn't rain (it was drizzling continuously though).


Cyclone Vardah - the aftermath


Today's morning reports tell us more trees have fallen. There is still water on the roads in many areas.

Fallen trees on the main roads have been mostly cleared or in the process. Power has not been restored yet except in some places.

A drive around the town has revealed that four wheelers are better avoided if you need to use the side roads, most of them resembling forest bushes with fallen trees everywhere. Right now, two wheelers are the best for transportation.

There is one thing that all the people of Chennai agree, which is that there has never been as devastating a cyclonic storm in Chennai before Vardah.

A few pictures of Cyclone Vardah that we clicked and others

Vardah, the beginning
Cyclone Vardah in destructive mode



























Vardah the wild

Cyclone Vardah in fury

Cyclone Vardah in action

Database connection failed...Error: 2003 Can't connect to MySQL server on '127.0.0.1' (13 "Permission denied")


Database connection failed...Error: 2003 Can't connect to MySQL server

When trying to connect through my web application in php, I encountered the above error message.

The solution seems obvious. You just need to assign permissions properly to the user.

But, I have already assigned permissions to the user and it works when I connect through the mysql command line.

When I use the command
/usr/bin/mysql -u alkrie -p mydb
I get prompted for the password and when I key it in, I get the MySQL prompt promptly.

mysql>

So, the MySQL connection is established when connecting through the command line, but generates "Database connection failed...Error: 2003 Can't connect to MySQL server" error, when connecting through the browser.

I looked around for a solution and homed in on a solution. This issue seems specific to a version of Linux. My server is a Centos 7

Find out your Redhat version using the command
cat /etc/redhat-release

Solution to Database connection failed...Error: 2003 Can't connect to MySQL server

It would seem that we have use the command setsebool for the permissions you want the server to allow or deny.

Use either of the following commands to allow http to connect to the database. Use the second command to make the setting permanent. Making it permanent means the setting will be remembered after a restart.

setsebool httpd_can_network_connect_db=1
allows network to connect to the database temporarily


setsebool -P httpd_can_network_connect_db on 
will allow network to connect to the database and enable it permanently

Note:
You may use 
/usr/sbin/getsebool -a|grep httpd|less
to find out the status of the network requests that are allowed [on/off]

Safe guarding your electronic transactions

Safe guarding your electronic debit card or credit card data

A little while ago, I was going through an article titled "Six seconds! That's how long hackers need to guess your credit card details"

It elaborates on how ingenious crackers can steal your card information and make purchases in short time.

From my experience, there are a few precautions one may take, to prevent or minimise our credit card or debit card data being stolen or misused.


Keep two Debit Cards but transact on one

Always, have two debit cards on you. And use only one card regularly for all your transactions. Also ensure that the balance in the card that you use for electronic transactions is as low as you can afford it to be. When it depletes, you can always transfer amount from your other main account.

This shields your main account from hackers and your other card details, even if it is misused, will not bother you too much, since the balance is always kept at a certain minimum.


Beware of software installs

If you use a computer at home, do not install unknown or unnecessary software on your computer; this advise is aimed at people who are not too tech savvy and may be easily misled by the installing software.

For example, if you install a certain software, it also installs a browser toolbar as an add-on, when you install with the default features. So, if you are unsure, get a trained computer technician to do it.

Use only computers that you trust. Do not use computers that are used by people other than you; using a computer in a browsing center is not advised, because there may be suspicious software that might have been intentionally or unintentionally installed on the device; using a publicly available wifi network is also a bad idea.


Cheat them thermal imaging devices

When we key in our debit card pin, our body heat gets transferred to the card authentication device's key pad. This can be easily captured by these thermal imaging devices. Once they have these 4 digits, it is only a matter of time before our pin is identified.

You may be surprised to know that certain devices are smart enough to identify not only the buttons pressed but the order in which they were pressed, using the difference in the heat signature on the keys.

The solution is to rub our fingers all over the keypad, while waiting for the response from the bank, thereby confusing them snooping devices.

Understand phishing attempts

You may receive an authentic looking mail from your bank, asking you to update your card details and change your secret pin. And that your card will be invalidated if you do not update your details. It looks so authentic that we fail to see that the mail is not at all from our bank.

Do not be overawed by such threats. And do not click on any links to visit your bank website. Instead, type in the address of your bank, in your browser's address bar.


Other precautions

Try and use cash wherever possible. Do not share your pin numbers. If you do, change the pin at the earliest possible instance. Do not write down your pin numbers and keep them in your wallet. Use the OTP feature that is provided by most of the banks to authenticate every online transaction.

An incident at a nationalised Bank - Demonetisation



Counter staff refuses to allow withdrawal of more than Rs.10,000/-

There was this alleged incident, which happened recently at a nationalised bank in Chennai, where an account holder was refused withdrawal of Rs.30,000/- which he was entitled to withdraw, within the weekly limit of Rs.50,000/- imposed by the central government of India.

The sequence of events is as follows:

  • The account holder goes in with a self cheque.
  • At the counter, duty staff rudely says he can withdraw only Rs.10,000/-
  • Customer asks why
  • Staff says, "Go and see the manager".
  • Customer refuses, saying he will not budge until he gets his money.
  • Hearing the commotion, the bank manager comes out.
  • Enquires with the customer; customer refuses to speak to the manager.
  • Tells him to get details from his staff.
  • Manager discusses with employee and then comes back to the customer.
  • Tells him the problem; there is a shortage of cash
  • Please take the Rs.10,000/- and get the rest afterwards [tells him a time]
  • Customer comes later and collects it.

Whatever happens, it seems pathetic customer service in India seems be a norm rather than an exception, leaving a lot to be desired.

Enable ssh VPN tunnel to access phpmyadmin on google cloud


If you are looking to enable ssh VPN tunnel to access phpmyadmin on google cloud, here is a possible solution

This hint is especially good if you are trying to connect to your MySQL database server using phpMyAdmin.

It is assumed that you have already setup your Google Cloud server, installed Apache, MySQL and phpMyAdmin.

Opening up phpMyAdmin for access from any machine (global access) is not a safe thing to do. It is insecure and not advised. Of course, you may add your IP address to the phpMyAdmin.conf file. But again, adding your IP to the phpMyAdmin.conf everytime is not advisable either.

Browser screen when accessing phpmyadmin before creating the ssh tunnel
Result when accessing phpmyadmin before creating SSH tunnel

The best thing to do is to create a VPN tunnel connection to your server, using the following instructions.

When you access phpmyadmin before creating the tunnel, shows you an error message similar to the one on the left.

So, we open the Cloud SDK Shell.



Then we create the VPN tunnel using the following command.

gcloud compute ssh <NAME-OF-INSTANCE-FOR-THE-TUNNEL
--zone <ZONE-WHERE-YOUR-INSTANCE-IS-LOCATED--ssh-flag="-L" --ssh-flag="8888:localhost:80"

eg., gcloud compute ssh myCentos-1 
--zone us-central1-b --ssh-flag="-L" --ssh-flag="8888:localhost:80"

Note: You will be replacing the words in bold above with your relevant server name and zone name.
phpmyadmin login screen is shown when accessing phpmyadmin after creating the ssh tunnel
phpMyAdmin Login Screen shows after successful creation of ssh tunnel


After doing the above, open phpMyAdmin from your browser by typing the address
http://localhost:8888/phpmyadmin/

Voila, you get the login screen!


Provide upload rights to a user to a www directory


How to provide upload rights to a user to a www directory?

If you have a Google Cloud instance running Centos-7, have setup SFTP on your machine and are now wondering how to provide access to the www folder to your www admin, here are the steps to follow.

Step 1 is to create a unique group, or use an existing group like "apache"

Next, add the group name to the folder you want to share, using 
sudo chgrp -R apache

Step 3 is to add rwx permissions [read, write, execute] to the group, on the shared folder.
You can do that with the command
sudo chmod -R g+rwx

Finally, add the user with whom you want to share the folder to the group, using the command
usermod -a -G apache

After this is done, your user will be a part of the apache group, which will have read, write and execute permissions to the www folder.

You can add additional users to the group apache, which will allow them access to those folders, automatically.

Ref:
Here is a link on allowing a group read write access to a directory
allowing-a-group-read-write-access-to-a-directory

Here is a detailed explanation on how to add a user to a group
add-a-user-to-a-group-or-second-group-on-linux

வாழ்க்கை இரகசியம்


வாழ்க்கை இரகசியம்


சும்மா இரு என்று
முன்னர் கூறிய
குருவை வணங்குகின்றேன்

வாழ்க்கை இரகசியம்
என்னவென் றுணர்த்திய
குருவை வணங்குகின்றேன்

குருவே சரணம்
குருவே சரணம்
குரு திருவடி சரணம்

செய்வன திருந்த
செய்யென கூறிய
குருவை வணங்குகின்றேன்

நம் அனுபவம் செயலின்
பலனென உணர்த்திய
குருவை வணங்குகின்றேன்

குருவே சரணம்
குருவே சரணம்
குரு திருவடி சரணம்

நன்மை செய்து
பழகென கூறிய
குருவை வணங்குகின்றேன்

செயல் போல் வாழ்வென
நிறைவாய் உணர்த்திய
குருவை வணங்குகின்றேன்
 
குருவே சரணம்
குருவே சரணம்
குரு திருவடி சரணம்

Omens and their Interpretation, Interpreting Omens! - Part 2


Omens and their Interpretation - Part 2

It has been a long time since I wrote that first part on Omens and their interpretation.

I am writing this as a continuation to that content, as I wish to share a few more thoughts, based on new learnings acquired over the years.

When it comes to interpreting things that happen to us, we have to take it that Nature or the Cosmos is in constant communication with us, bombarding us with inputs, which we fail to receive; or if we receive, then fail to understand; or if we understand, we fail to take advantage of these signs and omens in everyday life.

There are two types of inputs that an individual receives; one from the inner self or the subconscious; and the other from the unlimited Intelligence that surrounds us, the message from the cosmos.

The inner self, for example, reminds you not forget your id card, your purse and so on, when you are in a hurry and going to attend your all important finals. Your bag or shirt getting stuck in the door latch when you exit, or you stumbling on your way out are all simple examples of your sub-conscious communicating with you.

Come back, sit for a minute and you will recall that you forgot such and such a thing during that time. When one does not pay heed to the information the subconscious tells loudly, we find that we remember that we forgot our purse and watch only halfway into the travel.

The second type of communication is about matters that we are not aware of; those which our subconscious cannot warn us of, because it does not have any knowledge about it.

This is the cosmic knowledge which is transmitted to us through external factors. I would like to share an incident with you, which happened many years ago. 


An Omen that prevented an accident


A group of friends were going on a pilgrimage to Pondicherry, with the purpose of visiting various samadhis [final resting place or a memorial] of various spiritual guides. By the way, Pondicherry has a lot of such samadhis to visit.

It was about sundown when a few locals got into an altercation with the group as they parked the car in a place, which the locals objected to. One fellow suddenly leaned inside the driver's side of the car, removed the keys from the ignition and walked away.

Nobody suspected a thing on why this incident happened. An hour or so had passed by the time a compromise was reached and the journey resumed. Later, an hour into the journey, the friends saw a traffic cop regulating traffic around a car which seemed to have been involved in an accident some time ago.

It was then that it occurred to the group that if there had not been that delay due to that incident with the locals, it could have been this car that would have been involved in what was a major accident. The interpretation was that the delay was the divine omen or nature's interception that saved their lives.

Even though this may seem like an isolated incident, it happens to everyone of us, in one way or another. Because, we have been brainwashed into thinking that such thoughts are superstitions, most of us do not give a second thought to it.


A missed flight that saved his life!

In another incident, I remember a friend who missed his flight because he forgot his laptop in his hotel, and check-in was closed by the time he went back to the hotel and came back with the laptop.

The lady at the counter was adamant in not letting him go through. Later on, when they learnt that the flight was involved in a major crash, she came to him and said, "You owe me one".

The way the cosmos works is not immediately clear to us, because we are not party to the entire story; we are players who come to play a single game, go back and come again for another game.

It occurs to me now that nature gives us two guides, one internal and another external. To make use of our personal guides and play a fair game, seems to be the purpose of life. 

How we interpret them, what we call them, Omens or the work of spiritual guides and guardian angels, is immaterial.

Part 1 of this article may be found here

P V Sindhu is now the 3rd non-chinese that wins the Chinese open women's singles

P. V. Sindhu wins 2016 Chinese Open

P. V. Sindhu has won the Chinese Open BWF Super Series final, against Sun Yu of China, with the final score reading 21–11, 17–21, 21–11.

Sindhu was agile, nimble and mostly attacking with quite a few hard smashes to surprise Sun Yu and got to a 11-5 lead in the first 8 minutes of the game.
 
Sindhu's judgement was precise in the first game which saw only one rally, which Sun Yu won. For the most part, both were in attack mode, with Sindhu prevailing over Sun Yu.

The second set was a tight contest, till the score was reading 17-17, with one interesting long rally for the 12th point with Sun Yu winning it. Both were in their thinking mode with a few intelligent drops and placements by both the players. Sun Yu won the second set with some aggressive body smashes to boot, enabled by Sindhu's somewhat defensive play in the latter part of the 2nd set.

The third game saw Sun Yu hitting beyond the line a few times making unforced errors, while Sindhu was on her own aggressive self, winning 21-11 comfortably.

P. V. Sindhu and Saina Nehwal are the only non-chinese who have won the China Open badminton tournament,  since the first tournament in 1986.

Wong Mew Choo, who won the women's singles title in 2007 is Chinese too, even though from Malaysia.
 
So, essentially, only India has won the Chinese open other than the Chinese.

Interesting statistics about the China Open

A total of 26 people have won it in the past 30 years.

The following 5 players have won the China Open twice
Li Xuerui in 2012, 2013
Jiang Yanjiao in 2008, 2009
Zhang Ning in 2005, 2006
Zhou Mi in 1999, 2001
Li Lingwei in 1987, 1988

P. V. Sindhu, Saina Nehwal from India and Wong Mew Choo of Indonesia, are the only non-Chinese who have won the Chinese open till 2016.

magic solution for bloating and stomach gas

Some of us know how green leafy vegetables are beneficial to the body. Many of us know that ginger, when consumed does incur a few benefits on the body. We are going to see one such solution recipe, where both ginger and a green leaf called betel, when consumed together works magic on the body in a certain way. Here goes.

The wondrous magic of chewing betel leaf with ginger


Yes, it works!

A colleague was suffering from a bloated stomach due to gas. Someone was commenting that eating fibrous foods may result in gas problems.

He was suffering from this problem for over a week.

Another friend, who was overhearing the conversation, interjected and said, "Hey, I told you about eating a betel leaf with a piece of ginger last month, didn't I?".

"Oh yes, you did". "Now, I remember". I will definitely try tonight.

Luckily, there were two betel leaves and a piece of ginger at home.

Consuming the betel leaves and ginger


After having dinner, he shaved off the skin from the piece of ginger. The ginger piece could be a centimetre or half long. Then he removed the petiole (leaf stalk) and the base of the leaf. Next, he flipped the betel leaves and proceeded to scrape the veins of the betel leaves using his long fingernails.

It is said that the veins of the betel leaf should not be consumed as they damage the constitution.

He then folded the ginger piece in the leaves and proceeded to put it in his mouth and chew.

Ref: He could feel a difference within a few minutes of consuming this astringent and warm tasting preparation.

Bloating and stomach gas solved



By morning the next day, the stomach felt fresh and no symptoms of gas were found. Thus, he swears that this is a proven remedy for stomach gas.

Hope this solution for bloating and stomach gas works for you.


Redirect to a related page after an enquiry


Redirect to a new page using jQuery

You have a few related websites that garner quite a few visitors every day. You find that visitors to one website may also be interested in your other related portal.

So, you decide to redirect all those visitors who have posted an enquiry on your portal 1 to portal 2.

This is your original page

jQuery.ajax({
type: "POST",
url: "inquiry.php",
data: data,
success: function (html) 
{
jQuery("#thankyoupage").css("display","block");

}
});

You display a thank you message and after sometime you redirect the user to another page, transparently. The jQuery timeout function is used to achieve the required result.

When you add the following code just below the jQuery() call, the visitor is redirected to your other portal, after the "Thank you" message is displayed for 10 seconds.

// redirect to another page after 10 seconds
var ADDRESS ='https://www.myotherdomain.com/?source=ENQPG';
var delay = 10000; //delay in milliseconds
setTimeout(function(){ window.location = ADDRESS; }, delay);

The final code looks like this:

jQuery.ajax({
type: "POST",
url: "inquiry.php",
data: data,
success: function (html) 
{
jQuery("#thankyoupage").css("display","block");
// redirect to another page after 10 seconds
var ADDRESS ='https://www.myotherdomain.com/?source=ENQPG';
var delay = 10000; //delay in milliseconds
setTimeout(function(){ window.location = ADDRESS; }, delay);
}
});

The Benefits

There are two benefits to be accrued from this technique. One, all your serious visitors are introduced to your other portal resulting in more visibility. Your other site also gets increased number of visitors and moves up in search engine rankings.

mysqli_query() expects parameter 1 to be mysqli_result


mysqli_query() expects parameter 1 to be mysqli_result

See the above message. Then,

Study the script below carefully. There is an error in it. At first glance, it may not be so obvious, especially if you are new to database handling.

$updateQry ="update TABLE set approved=$value where id=$id";
$updQryResult =mysqli_query($conn, $updateQry);
if (!($updQryResult)) {
   $updateResult =0;
}
else {
   $updateResult =mysqli_affected_rows($updQryResult);
}

if ($updateResult) {
   echo 'Rejected';
}
else {
   echo "Update failure";
}

Okay, the error is in line 7. Yes, easy wasn't it? It is always easy when we know the answer.

How did I miss it?

Let me explain for those who did not see it.

The correct statement in line 7 of the above code should have been
$updateResult =mysqli_affected_rows($conn);

Most of us commit this mistake, at some point or other of the learning curve in MySQL and PHP.

By way of habit, we pass the result set handle to the function mysqli_affected_rows(), which will result in a cryptic message, "mysqli_query() expects parameter 1 to be mysqli_result"

You need to present the database handle as the parameter for mysqli_affected_rows(), mysqli_num_rows() etc.,

The day when Google slipped


Yes, I agree; it is a misleading title.

It should have actually been "The day when Google slipped from its towering pedestal in our minds".

Most of us have high regards for Google, as a company, for its high standards and its blazing growth over the past decades; no doubt.

This piece is not about that. It is about the one area of customer service, which is taken for granted by all or most Indian companies; and Google seems to me as no exception, as the story narrated below will convey.

I signed up for the Google Cloud trial for 60 days. Activated the account, added a card for payment, create an instance and migrated all my domains into the new instance.

All well for 60 days. A few days before expiry, Google started sending me reminders about the expiry, which unfortunately did not come to my notice, since I had used a rarely used account for the subscription.

On the day of expiry, it was around 1030 am, when accessing my domain returned an error. That was because Google automatically stopped the instance, when the trial period was over.

But, that is not the problem. Perfectly right on Google to shut the server down. What happened next was unbelievable!

I got wind of it and immediately, we got to revive the account. Within the next few minutes, we made the payment and upgraded the service, only to be greeted by a blank dashboard. All the instances that I created during the trial period were GONE!!!

I also remember seeing a message which communicated something like "you canceled your subscription" or something to that extent.

I do not remember having cancelled the subscription.

But,should not there be a double check, when a user wants to cancel a subscription? Would Google not look at the traffic and activity on that instance over the past 60 days and find that there have been activity in that instance and warn the user against cancelling the subscription?

To get a clarification, we decided to call Google.

If you had encountered the call centre of any service provider in India, which are mostly useless and not at all worth calling in an emergency, you would know what a pain in the neck they are.

Funnily, we could not find a number where I could call and get a clarification. There is no number you can call for any doubts that you may have during the trial period. If there is one, it is not publicised prominently.

So, I tried calling the generic Google number once, but the executive just transferred the call to an extension, without bothering to find out if the extension is being attended to. Guess they had left for the day. So, after a full ring, the call got disconnected. The weekend was a goner, with the next few days being Diwali holidays.

We did not bother to call the Google call center again; not interested in listening to parrots on the other side.

Tolerant as we Indians are, we created another account in Google Cloud and recreated the instances again. Lost a few days' data and a lot of credibility in my organisation.

Didn't expect this googly from Google, though.

Update:
Google has since revived the account. But, I still stand by my words. Customer support is pathetic in India.

Error when setting up _ installing MCrypt PHP Extension on Redhat 7 Enterprise x64

Error when setting up/installing MCrypt PHP Extension on Redhat 7 Enterprise x64

I knew that mcrypt was not installed when my call to phpmyadmin threw me a warning regarding the mcrypt extension.

Like so:
Cannot load mcrypt extension. Please check your PHP configuration.

So, I got on to setting up mcrypt on my Redhat server in the Google cloud, using yum install php-mcrypt.

I got an error during the installation of mcrypt on my Redhat server in the Google cloud.

Error returned when installing mcrypt:
--> Finished Dependency Resolution
Error: Package: php-mcrypt-5.3.3-1.el6.rf.x86_64 (rpmforge)
Requires: php-api = 20090626
Installed: php-common-5.4.16-42.el7.x86_64 (@rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-21.el7.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-23.el7_0.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-23.el7_0.1.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-23.el7_0.3.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-36.el7_1.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-36.1.el7_2.1.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64
Available: php-common-5.4.16-36.3.el7_2.x86_64 (rhui-rhel-7-server-rhui-rpms)
php-api = 20100412-64

I searched around for a solution. There were many, but none that matched my error.

I then addressed my problem by using the following commands and solved the error that popped up while installing mcrypt in Redhat 7 Enterpise

$ cd /tmp/
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ ls *.rpm
$ sudo yum install epel-release-latest-7.noarch.rpm 
$ sudo yum search php-mcrypt
$ sudo yum info php-mcrypt
$ sudo yum install php-mcrypt
$ sudo systemctl restart httpd

Hope it works for you!

Note: The line in italics is optional.

Imagen 3: A New Era of AI Image Creation?

  Google has just unveiled Imagen 3, the latest iteration of their Gemini AI. They're making bold claims about enhanced image quality, ...

Most Popular

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