Skip to content

Instantly share code, notes, and snippets.

View vaibhav9392's full-sized avatar

Vaibhav Saxena vaibhav9392

View GitHub Profile
1. Create a .htaccess file in your application root directory.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
</IfModule>
<IfModule !mod_rewrite.c>
@vaibhav9392
vaibhav9392 / cyfe
Last active April 12, 2020 19:04
Connecting cyfe with aws ec2 database
# By default aws does not allow remote connection to database
# So we will need to enable it to connect with cyfe
# **Step 1: Create new database user**
# For two reasons
# i. We don't want to give root access to any application
# ii. By default root has access from localhost only
# Don't define host for this user(wildcard)
# Step 2: Allow access from remote server
@vaibhav9392
vaibhav9392 / backup.php
Last active December 29, 2016 06:59
AWS EC2 automatic volume daily/weekly/monthly snapshots.
#!/usr/bin/php -q
<?php
date_default_timezone_set('UCT');
$dryrun = FALSE;
$volumes = array('');
$api_key = '';
$api_secret = '';
$ec2_region = 'us-east-1';
require 'aws/aws-autoloader.php';
@vaibhav9392
vaibhav9392 / my.cnf
Created October 4, 2015 20:40
Fix: Auto-stopping of mysql service on AWS micro instance
/* Error reason:
InnoDB: Fatal error: cannot allocate memory for the buffer pool */
/* Solution: Change below value in my.cnf file */
/*File Location:
CentOS: /etc/my.cnf
Ubuntu: /etc/mysql/my.cnf*/
[mysqld]