How-To: Create a Cron Job to start MySQL if it Stops

Sometimes server acts weird and stops some services due to any issue. I faced this issue with my iogoos.com WordPress demo sites server, where MySQL service stops after running the clean script to remove demo sites after three days. So I created a Cron Job on my GCP VM Ubuntu Droplet to check if and start MySQL service if it’s not running. I scheduled this to run the check every minute. Here’s the code and steps to set up this cron job.

NOTE: You must have ssh access to your server. GCP provides ssh access as soon as you create a droplet.

Creating Shell Script

Step 1: Open Terminal and login to your server as root via ssh.

Step 2: Create shell script file.

cd ~
nano mysqlfix.sh

This will let you create a shell script in the root directory for the root user. You can use any name as per your preferences for the .sh file.

Step 3: Write the script to check and restart MySQL and send an email alert.

#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
    echo "MySQL restarted" | mail -s "Email Subject" email@domain.com
    sudo service mysql start
fi

Make sure you change the Email Subject and email address.

Step 4: Once you are done with the script press CTRL + x and you will be asked to save the changes. Type Y and hit enter. You will be returned to the terminal and mysqlfix.sh file will be created in the root directory.

Step 5: Give this file executable permissions

chmod +x mysqlfix.sh

Testing the Script

Now our script is ready, let’s test if this runs fine.

Enter following commands in the terminal:

/usr/sbin/service mysql status

The terminal will print something like this:
mysql start/running, process 2409

/usr/sbin/service mysql stop

This will stop MySQL service, to verify run the status command again and it will print something like this:
mysql stop/waiting

~/mysqlfix.sh

This will run the script we created to check and restart the service. You should get an email with the subject and message to the email address you specified in the script.

Run the status command again and it should print
mysql start/running, process ####

If everything goes well in this step, let’s create the cron job to run our script every minute.

Create Cron Job

Step 1: Installing the cron job

Make sure you are logged into your server via ssh as root, then type the following command in terminal:

crontab -e

Once you see the crontab screen type the following line at the end of this file:

*/1 * * * * /root/mysqlfix.sh

Press CTRL + x and you will be asked to save the changes, press Y and hit enter. You will see the following line in terminal:
crontab: installing new crontab

Now our cron job is installed.

To test if it runs fine, Type following command:

/usr/sbin/service mysql stop

This will stop MySQL service on your server. Now you should wait for one minute and get an email with the subject and message we specified in the mysqlfix.sh file.

Hope you find this helpful.

WordPress Developer
contact us

Our Services

How to create an easy to remember but the super-strong password

Today we spend most of our time online, either on our personal computers, in-office work-station and most of the time on mobile phones. Today there’s a web or mobile app for almost everything and we use almost all of them in our daily routine.

Most of the applications store our information to personalize the content as per our profile and interests. To keep our data secure and hidden from others, they provide us with a form to create a username and password.

Do you use a super-strong password or just an easy one that you can remember and someone else can guess to hack into your account?

I couldn’t believe that most internet users use one of the passwords below to keep their accounts secure.

  1. 123456
  2. password
  3. 12345678
  4. abc123789

I hope you are not one of these people and actually have a really strong password. However, in this article, I am going to explain an easy way to create a super-strong password that you can easily remember.

A super-strong password must be alphanumeric and must contain capital letters and special characters. Now how can we create a password that contains everything so we don’t forget and get locked down from the applications we use.

What do you think of this password?

1l^^|<nW8106

Do you think it’s a super-strong password? Can you remember this every time you are asked to punch this password?

If you think you can’t, then let me explain how this password is created and make your life a lot easier and more secure.

I Love My Kids and Wife 1981 2006

Here’s a simple line that I can remember always. Of course, I love my kids and wife, and I was born in 1981 and got married in 2006 which is why I have a wife and kids 😉

Now let’s create a password out of it:

  1. I was replaced by 1
  2. L is in lower case
  3. M is replaced by ^^ (Shift + 6 twice)
  4. n for and
  5. W is uppercase as she’s important 🙂
  6. 81 is the YY format of my birth year
  7. 60 is the YY format of my anniversary

Combining all these characters makes this jumbled text a super-strong password.

NOTE: This is just an example and I request you, not to use this line for your password as a lot of people will read this post.

Be a little creative and think of phrases that you can not forget and try to replace the characters with symbols. Once done, do write your new password at least 10 times somewhere, and then destroy that file or paper to make sure you do remember what you have set and no one has access to it.

Now you have a super-strong password, so go on, enjoy the current technology and be SAFE. Do share this trick with your friends and family and help them avoid common mistakes and get webbed.

Our Services

WordPress crashed while updating plugins?

Recently I was updating my plugins on my local server and somehow the page got refreshed and my WordPress installation got stuck at the following message:

“Briefly unavailable for scheduled maintenance. Check back in a minute.”

You can easily bypass this message via the following steps:

  1. On your local or web server, browse to the main installation (root) directory for WordPress.
  2. On local if you have enabled hidden files, you will need to enable hidden files.
  3. You will see a file named .maintenance in the root directory.
  4. Simply delete this file to bypass the above mentioned message and you can access your WordPress dashboard and site as you normally do.
  5. You can choose to perform the upgrades again and make sure the page should not get refreshed. If it does again follow the step again.
contact us

Explore IOGOOS uitmate WordPress Development Services

PHP – Flatten or Merge a Multidimensional Array

Here’s a code snippet to flatten or merge a multidimensional array. This is useful when we need to find if a value exists in any of the nodes in a multidimensional array.

I use this function in my Paid Content Packages WordPress Plugin to find out if any of the packages have any page or post assigned.

PHP Function:

function flattenArray($arrayToFlatten) {

	$flatArray = array();

	foreach($arrayToFlatten as $element) {
		if (is_array($element)) {
			$flatArray = array_merge($flatArray, flattenArray($element));
		} else {
			$flatArray[] = $element;
		}
	}

	return $flatArray;
}

Example:

$array = array(
	'parent-one' => 'parent-one',
	'parent-two' => 'parent-two',
	'parent-three' => array(
		'child-one' => 'child-one',
		'child-two' => 'child-two',
		'child-three' => array(
			'kid-one' => 'kid-one',
			'kid-two' => 'kid-two',
		),
	),
);
print_r(flattenArray($array));

This code will print the following output.

Array
(
    [0] => parent-one
    [1] => parent-two
    [2] => child-one
    [3] => child-two
    [4] => kid-one
    [5] => kid-two
)
contact us

There are shorter versions of this function available, however, I like to use code that is clear and easy to read. Hope this helps you if you are finding a solution to this.

Our Services

Scroll Image within a DIV tag with CSS

How to Scroll Image within a DIV tag with CSS. Preview and download the code from codepen.

While your hunt for pre-built themes and templates, you must have seen this scroll effect on demo pages.

I’ve been working on something where I needed this functionality and I didn’t want to use Javascript for this so I created this effect in pure CSS.

HTML Code

<div class="image-scroll">
    &nbsp;
</div>

CSS Code

.image-scroll {
  width: 200px;
  height: 100px;
  background-image: url('IMG-URL-HERE')"; // or specify in HTML styles.
  background-size: 100%;
  background-position-x: 0;
  background-repeat: no-repeat;
  transition: all 2s ease;
  &:hover {
    background-position-y: 100%;
  }
}

If you have created this effect with some other css technique, please feel free to share the link in the comments.

WordPress Developer

Feel free to Contact Us.

How To: Find all links on a page with PHP

While working on a project, I needed to find all links on a given page. This code will list all links specified in an anchor tag on a given page URL.

$html = file_get_contents( '//website.com/page-in-question' );
$dom = new DOMDocument();

@$dom->loadHTML( $html );

$xpath = new DOMXPath( $dom );
$hrefs = $xpath->evaluate( "/html/body//a" );

for( $i = 0; $i < $hrefs->length; $i ++ ) {
	$href = $hrefs->item( $i );
	$url = $href->getAttribute( 'href' );
	echo $url . '
';
}

Once we have the list of the links, we can do whatever we want to do. In my case, I had to check if any of the links are broken on a WordPress page so I wrote a custom WordPress plugin for a client which checks first grab the links on a page and then check if the response status is 200 or 400 via wp_remote_get() call.

Another task was to find all images on a page, check the file size and if it’s large then crop the image and replace it with the new and improved version.

We can modify the above code to grab all image URLs on a page. All we need to do is change the DOM element from:

$hrefs = $xpath->evaluate( "/html/body//a" );

to

$hrefs = $xpath->evaluate( "/html/body//img" );

and

$url = $href->getAttribute( 'href' );

to

$url = $href->getAttribute( 'src' );

and we will get all the links in the src attribute of the images used on the page. Once I have the URLs, I used the PHP filesize function to determine the size and then wrote a script to crop the image, reduce file size and replace the same in its location.

I hope this code will help you if you are working on a similar task.

Jump over to the link to know more about PHP Development Services.

Role of Artificial Intelligence in Everyday Life

Since the Year 2000 or probably even a couple of years before it, the world experienced a boost in terms of economy, lifestyle, and technology due to globalization. From the technological point of view, one could easily call the years that followed ‘The Technology Age’. The technological advances made in this phase were and are still considered to be impeccable. It started with chunky mobile cellular devices, which have now been thinned out to a slice of cheese; and televisions which were huge blocks of plastic have now been utilized to the utmost even bringing out virtual reality by Artificial Intelligence.

The latest such development in this side of the world was the introduction of Artificial
Intelligence to our lives. Interestingly, when we speak about Artificial Intelligence or AI, we
generally think of a multi billionaire’s pe robot Jarvis, or even utterly popular OS One from the
movie Her, but peeking behind these norms, one can notice intimate relations and interactions
we have with AI.

Little do we care, or rather know, that our everyday lives, from waking up to reading the
morning news, everything is powered through AI. In today’s day and age, the importance of cell phones overpowers any other form of inclinations we push ourselves to. Everything you see or go through on social media platforms is powered by artificial intelligence. The complex
calculations form out an algorithm based on your likes and dislikes. The algorithm or the
“entity” feeds on your taste, studies it, and offers you exclusive content. For example, one of
the best algorithms out there, Spotify, literally feeds on your like, your music habits, and your
taste to give you specially curated playlists. Even Facebook and Google maintain algorithms to
understand their customer base to provide them with content, posts, and pages or news of
similar interest.

Advertisements for products you like, videos based on your watch history, music based on your
recent listens, social content based on your activities, everything with your intention is
powered by artificial intelligence.

Artificial Intelligence to a certain extent is the fire of the modern generation. I say that because
this ‘entity’ or ‘intelligence’ is not going to stop anytime soon. The interesting and at the same
time, concerning thing of AI is the fact that not only is it easy for AI to read you, but also
subconsciously it feeds on you to manipulate your tastes in accordance. No matter what, AI is
here to stay, and who knows it might bring us bigger advancements to our livelihoods someday.

Signup.

Textrics Software comes up with the AI Machine Learning Tool that recognizes sentiment from text, detect abusive language, emotion detection from text, Named Entity Extraction, and much more beyond your thinking. Textrics deliver the ultimate experience to its users.

Website Design Services Trend that Must be Followed

In today’s world, technological innovation happens in a short amount of time. The use of the online platform, as well as expanding visual aspects and upgrades. Today, not only SEO Experts are leading the way in terms of innovation, but website designing services appear to be providing useful high technology resources to help them enhance their businesses.

User experience has advanced considerably over the years and has risen exponentially. This industry now comprises a number of innovative tools and strategies that customers want to use to improve their industries.

Let’s check what the new web design services techniques have entered into the world of website designing:

 

Scrolling

Because no one wants to fix their attention on a casual swipe all the time, scrolling pretty damn comes with a deep understanding of a page. As a result, the trendiest and most popular style in web design is a scroll that is maintained to a minimum. A brief duration of browsing, on the other hand, is ideal for quickly capturing all of the available points. Today, many long-scrolling websites have been converted to use the short-scrolling technique!

 

Card Design

The card-styled layout is more appealing to people nowadays. Pinterest was the first to use this design. Card-styled page layouts make new waves in the online design world, and they’re also compact and convenient because they present information in little chunks. The cards appear to be content containers since they express information in the shape of a rectangle, allowing consumers to quickly grasp the idea.

 

Attractiveness

It is critical to make your page visually appealing in order to capture the attention of visitors. The use of high-definition visuals in web pages is the latest technological trend. Adding the piece of information and making use of photographs is also becoming more significant, and has been identified as the year’s fastest-rising trend. In addition, emphasizing the pattern with clearer and stronger hues in various forms such as typefaces, images, and animations substantially improves attractiveness.

Iconography

It is not new for web design companies to include icons on their websites, but it has become increasingly common in recent years. Now, site designers from website designing services are experimenting with a variety of large-sized icons in SVG formats, making the page look more appealing and inviting.

contact us

Animation that buzzes

The majority of today’s websites are almost expressive and imaginary. It will be quite difficult until you can tell the difference between actual and animated shapes. As we all know, web design is continually evolving, making it possible to change the website’s structure according to the preferences and needs of users. In website designing services, visual also includes the task of producing graphics that appears to be real but is not.

Designs that are responsive

It has become a necessary component of making your website design responsive. Engaging web pages are thought to fulfill the objective of developing a link between users and your company in the world of website designing services. You may provide value to the end-user by using these types of sites. Small notifications, email alerts, or a light beep are all examples designed to evaluate that can help users connect not just with your brand but also with the gadget.

Font rendering

Font Typo is efficiently heading in this direction, thanks to the reduced interfaces. Vivid, strong, and massive typography is truly ruling the web design this year since its visual appeal blends in nicely with other aspects on the page. It also has the function of communicating with visitors more specifically and making the message more understandable.

Developing Design in Small Sections

Instead of developing the complete page, professional web designers are now adopting the practice of partitioning design into discrete modules and components. These little modules outline how the site’s navigation will work and how the search function will work. It has emerged as one of the year’s most popular industry trends, to which web designers are progressively reacting.

Further reading=>> Affordable SEO Services for all business industry

Avail Benefits of Local SEO for Small Business by Local SEO tips

In an online world, every user executes searches locally with their mobile phones before a visit to the business area. 50% of users are local intent. It’s time to give priority to local organic search. Get insight into Local Search Engine Optimization (SEO). Local SEO for small business gives a facelift to online eyeshot in SERP.

Local SEO for small business is all about specific business location component like:

  • barber near me
  • plumber near me
  • Coffee shop near me

Organic and Local SEO is different. Organic SEO has major components like On-site optimization, Technical SEO, and link building. But for Local SEO for small business, all you need to work on Google free tools i.e., Google My Business (GMB) that attract local search. Local SEO leads to people come to your store or business place. Brick and mortar store is facing challenges in comparison to online shopping.

To make position on Top Local search itself, Google work on certain points like:

  • Social presence signals
  • Reviews
  • Citation
  • Link Signal

search ranking factors

An additional plus point of Local SEO is:

  • Search engine ranking and enhancement in sales.
  • Build-in brand image.
  • Passive customer interaction.
  • Bring you closer to your customers.

Now the question is who has to influence Local SEO?

The simple answer is Company or local store or small business with a physical location. Examples:

  • Bars, Restaurants, & Caterers
  • Skilled trades (plumbers, electricians, carpenters, etc.)
  • Daycare centers
  • Real estate firms
  • Auto dealerships
  • Hospitals
  • Stationary food trucks
  • Kiosks & ATMs
  • Gas stations

Businesses that have not local can go to an online store.

I think the basic of Local Search Engine Optimization has been cleared. Now, it’s time to make a Plan of action that would be of great assistance in making rank locally for small business

local seo example

1. Claim and verify your Google My Business listing

In simple terms, Google My Business is the foundation of SEO strategy. Let us start with claiming business at GMB. This step is on high priority because the 35% to 40% ranking signal comes from GMB. Few highlights of GMB that reflect your business:

  • Local Search Visibility
  • Online consistency
  • First impression and first sight
  • Helps in SEO
  • Easy to use
  • Easily showcase your business hours, products, and more.

A business owner can manage business very efficiently.

=>> Steps to create GMB profile:

I. Visit https://www.google.com/business/.

II.  Enter your business name.

III. Choose a category that fits your business.

IV. Register your business’s location.

V. Add your business details like phone number and website.

And it’s that easy.

Once the GMB account is verified, the listing will appear on maps.

Google My Business

2. Add your business on citation or directories

Citations are just a process to add a business on various business listing sites. There are many well-renowned citations are:

  • Foursquare
  • Trip Advisor
  • Bing
  • Yellow Pages
  • Facebook

Submitting your business on various citations shows the popularity of the business.

3. NAP (Name, Address, and Phone) Details

Name, address, and phone number are the business details that will be filled in every directory. Fallacious details lead to loss.

4. Stimulate end-user to list a review

Most of the customer rely on review because this is personal suggestion or words. Optimistic feedback make freedom from suspicion and becomes more ethical. And ultimately navigate to expand traffic and sale. There are some free tools through which you can gather feedback from customers like Yelp, Facebook, and more. Google My Business has an inbuilt feature that anyone can submit their review.

Ask or suggest your near customer mention their actual opinion about the service through SMS, E-Mail or website. Be active to say in response to feedback. This goes well with customer self-gratification. If anyone posted a negative review, make them positive by clarifying.

list review

Last but not least

5. How to optimize Local SEO for small business in the right way?

In respect of Local SEO for small business, the best approach is to consider existing SEO practices. It means that the URL must be short, gripping meta title and description, longtail optimized keyword plan, and many more. Add photos and content repeatedly. Highlight your company by adding service.

Add content like FAQ section, Discounts, special offers. Use of H1 and focused keywords within the first 100 words of your content.

contact us

Overall to conclude, SEO is evolving rapidly. Keep eye on updated SEO trends and strategies. Come out of myths related Cheap SEO Services are not good. You need to know the authentic facts. Put your investment in youthful companies that work actually for your business. Cheap or Affordable SEO Services provide service at a cost-effective rate that every business owner can afford. Make ready your business to show online. Contact us online or call us at (+91) 9540007839, (+1)315 215 0919.

Explore more about:

>> How Affordable SEO Services helps in the business expansion?

>> Choose WordPress Development Services Company from the list.

Explore strong point before choosing Cheap SEO Services

Nowadays Digital experts cast an eye over SEO. In the online marketing world, online strategists strongly suspect that SEO is dead. IOGOOS Solution briefly explained why investment in Cheap SEO Services is vital? Stop doubting on it that SEO is demised. It is just a piece of gossip. Change your thought that “SEO is not a cost; it is a healthy investment”. With extensive exposure in Digital Marketing, I am going to share a piece of briefing details about the positive influence of spend money on the best and Cheap SEO Services that will surely worthwhile.

Initially, the points cover finding an Affordable SEO Company. Every entrepreneur/middleman/trader wants to save unnecessary expenses of promotion. Website owners or businessmen hire SEO Experts to get assistance to grow business in the long-term with apt escalation. Now it comes to the point that how much expenditure requirements for the service? Is it effective to get Cheap SEO Services? By using the “Cheap” word, it not becomes negative. Cheap SEO Services don’t need to include Black hat practices or using low-quality content. “Take cheap term in sense of economical or Affordable”.

Now it comes to compete with your competitor. Try to get to the bottom of a competitor so that you get help from the target audience. If SEO Experts have a powerful built-in applying strategy, the small-scale industry can be a competitor against large businesses. Getting a sky-scraping rank in SERP does not make money until it is applied effectively.

Cheap SEO Services

Now it’s time to make goals that work in long term. SEO Expert and website holder plan to invest in a long-term strategy that entices your business. Once for all every website owner pay for SEM or paid marketing like Google AdWords. But this is only for the short term. It is much better to put money into SEO that gives much ROI in long term. Google attentively focuses on domain linking to your site which is high authority. All you need you need have self-restraint.

Users of the 21st century want fast results with a single click on Google. It becomes essential to show your business up in SERP so that users or visitors find your business. In this fast-paced world, the user of the internet searches for everything online. The website which is designed by the professional and top website designing services company is well organized and useful to attract website visitors. Implement preferable utilization of SEO Tool for proper keyword research, marketing techniques, and Internet platform that helps to captivate users.

In the end, it is concluded that whatever service you are going to take is all for profit growth. Proper achievement of SEO and a proposed action plan are important to increase profits. IOGOOS Solution is the Top and Affordable SEO Company with a complete digital solution.

Contact Us

Enquiry Now

When We Work Together

We can create something incredible

arrow
HQ INDIA
HQ INDIA
C-31, Milap Nagar,
Uttam Nagar, New Delhi,
Delhi 110059
USA
USA
6715 Backlick Rd Suite 202
Springfield,
VA 22150, USA
AUSTRALIA
AUSTRALIA
2/51, Lane Cres,
Reservoir, VIC
3037, Australia
CANADA
CANADA
61 Payzant Bog Road, Falmouth, NS, B0P 1P0, CANADA
UK
UK
3rd Floor, 131 City Road, London, EC1V 2NX, United Kingdom
UAE
UAE
Boutik Mall, Al Reem Island - Abu Dhabi, UAE
X

Let Us Call You Back

  • India+91
  • United States+1
  • United Arab Emirates+971

Your phone number is kept confidential
and not shared with others.