Skip to content

Instantly share code, notes, and snippets.

View gyanendragiri's full-sized avatar
🎯
Focusing

Gyanendra Giri gyanendragiri

🎯
Focusing
View GitHub Profile
@gyanendragiri
gyanendragiri / Website Uptime Monitor with Automatic Google Cloud VM Restart.md
Created January 19, 2025 12:01
A Bash script to monitor website uptime and automatically restart a Google Cloud VM if the website is down. The script uses a locking mechanism to prevent concurrent executions, waits for the VM to reach desired statuses, and restarts the Apache HTTP server upon VM startup. Includes instructions for setting up a cron job to run the script at reg…

Website Uptime Monitor with Automatic Google Cloud VM Restart

This guide explains how to use a Bash script to monitor website uptime and automatically restart a Google Cloud VM if the website is down. The script also restarts the Apache HTTP server (httpd) on the VM after it has started.

Prerequisites

  1. Google Cloud SDK:
    Ensure the Google Cloud SDK is installed and configured on your system.
@gyanendragiri
gyanendragiri / docker-cheatsheet.md
Created January 18, 2025 12:27
Essential Docker commands and concepts, designed to simplify containerization tasks. Perfect for quick reference and mastering Docker workflows efficiently.

Docker Image library: Docker Hub
Practice Online: Docker Play Ground

Container and Image: Core building blocks

Volumes: Storing Data

Networking: Communication with other Containers

Docker Compose: Multi Container Application

@gyanendragiri
gyanendragiri / godaddy-india
Created January 18, 2015 10:45
Godaddy India contact details
Godaddy India Contact Details:-
Toll Free Phone Number:- 1800-121-0111
Toll Phone Number:- 040-49187600
Email Address:- [email protected]
Email Address:- [email protected]
For more info, log on to www.godaddy.com
@gyanendragiri
gyanendragiri / remove-version.php
Created January 17, 2015 15:54
Remove WordPress Version number
<?php
// Remove WordPress Version number
function remove_wordpress_version_number() {
return '';
}
add_filter('the_generator', 'remove_wordpress_version_number');
?>
@gyanendragiri
gyanendragiri / post-from-a-category.php
Last active August 29, 2015 14:13
Show all posts from a category
<?php
// Arguments
$args = array(
'cat' => 5 //where 5 is category id.
)
// Query
$the_query = new WP_Query( $args );
@gyanendragiri
gyanendragiri / wp-query-ref.php
Last active August 29, 2015 14:13 — forked from luetkemj/wp-query-ref.php
WP_Query detailed Query reference
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@gyanendragiri
gyanendragiri / box-height-php
Last active August 29, 2015 14:12
Box height by wp head method
add_action('wp_head', 'css_function');
function css_function() {
echo '<style>
.content-box .item {
padding-top: 10px !important;
padding-bottom: 10px !important;
}</style>';
@gyanendragiri
gyanendragiri / box-height
Created December 29, 2014 15:52
A box height adjustment
.content-box .item {
padding-top: 10px;
padding-bottom: 10px;
}