Skip to content

Instantly share code, notes, and snippets.

View webmechanicx's full-sized avatar
🎯
reinventing

Farhadur Rahim webmechanicx

🎯
reinventing
View GitHub Profile
@webmechanicx
webmechanicx / gist:2639b65dec0595aa661ed3bb5a62b1df
Created April 2, 2025 08:41
Git error: "Host Key Verification Failed" known_hosts
Please contact your system administrator.
Add correct host key in /Users/user_name/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/user_name/.ssh/known_hosts
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@webmechanicx
webmechanicx / stripe-credit-card-numbers.md
Created December 12, 2020 16:26 — forked from rymawby/stripe-credit-card-numbers.md
Stripe test credit card numbers for use in development

#Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

@webmechanicx
webmechanicx / readme.md
Last active February 4, 2020 16:55
Setup AWS Cronjob

Setup Cronjob in Amazon AWS

Step:1

$ crontab -e

Step:2

Press i
@webmechanicx
webmechanicx / aws-multi-site.md
Last active January 27, 2020 15:51
Host Multiple Sites on a Single Amazon EC2 Instance

Assign a Static IP Address

The first thing you should do, if you haven’t already, is assign a static IP address to your EC2 instance. You can do this in the Amazon EC2 control panel (go to Elastic IPs -> Allocate New Address). Assign the IP address to your instance, and write it down for later.

Point the URLs to Your EC2 IP Address

So, the next step is to go ahead and point your URL at your EC2 IP address. Log into your domain hosting account. In this case, I’ll describe how to do it for Go Daddy. Launch the Domains control panel and click the first domain that you want to point to your EC2 server.

  1. Click the tab that says “DNS Zone File”. You will be editing the A record of the zone file to point to the EC2 IP address.
  2. Click the Edit button
  3. Click on the IP address in the “@” row at the top. Write it down, just in case you need to revert back to it.
  4. Replace the IP address with the IP address of your EC2 instance.
@webmechanicx
webmechanicx / htaccess.md
Last active January 23, 2020 18:50
How do I redirect HTTP traffic to HTTPS on my Classic Load Balancer in ELB
@webmechanicx
webmechanicx / aws-linux-ami-2018030-hvm-ssd.md
Last active May 6, 2020 15:42
LAMP (Linux, Apache, MySQL, PHP) web server on an Amazon EC2 Linux instance

Install and start the LAMP web server

Step1:

First thing you have to connect to ssh using macos or putty for windows by added the downloaded key file. Run the following command:

sudo yum update -y

The above command ensure that all of your software packages are up to date.

Step2: Now install packages in your current instance.

@webmechanicx
webmechanicx / aws-lamp-ubuntu-18_0_4.md
Last active April 7, 2021 14:27
How To Install LAMP On Ubuntu 16.04 or 18.04 – EC2 Instance

How To Install LAMP On Ubuntu 16.04 – EC2 Instance

Anyone who knows a little bit about the Linux and UNIX platforms, he/she must be heard about the LAMP Stack. LAMP Stack is the group of services that work together in order to serve the dynamic websites and web apps. The LAMP stack can be installed and configured on almost all Linux variants such as Amazon Linux, Ubuntu, Red Hat, and Fedora. In this tutorials, we will explain how to install LAMP on Ubuntu 16.04 EC2 instance. Generally, LAMP stack consists of the following components:

  • L= Linux as the operating system platform.
  • A= Apache as the Web server
  • M= MySQL as the database server
  • P= PHP as the supportive language
@webmechanicx
webmechanicx / gist:894ab24d6bb71718a21a78de6df1d781
Created May 12, 2017 18:00
Remove of index.php in your Joomla! URLs
## To remove the /index.php/ part from all URLs, add two lines after the RewriteEngine statement:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L]
## You can also add two lines to remove the .html suffix if it has been turned on before:
RewriteEngine On
RewriteCond %{REQUEST_URI} \.html$
RewriteRule (.*)\.html$ /$1 [R,L]
@webmechanicx
webmechanicx / index.html
Last active May 3, 2017 19:04
Select an option by its text, If you need to check if a selectbox has an option whose TEXT is a specific value. Example JIT site
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Textbox Value to Switch Selectbox</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
</head>
<body>
<input id="textvalue" type="text" value="Boy">
<select id="mySelect">
@webmechanicx
webmechanicx / jomloader.php
Created March 24, 2017 16:17
Load the Joomla! Framework in a PHP Script
<?php
define( '_JEXEC', 1 );
// JPATH_BASE should point to Joomla!'s root directory
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/' ) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$user =& JFactory::getUser();