Skip to content

Instantly share code, notes, and snippets.

@manishjaingit
manishjaingit / subdomaincreatenginx.sh
Created October 17, 2019 10:32
create subdomain on nginx
first setup A record on your domain registar
sub.yourdomain.in 1800 IN A 13.232.209.111
for this you can refer this link https://www.godaddy.com/help/create-a-subdomain-4080
record type: A
host: sub
point to : your ip address of the server.
now
then create one directory /var/www/sub.domain.com
then create one empty file sudo nano /etc/nginx/sites-available/sub.domain.com
@manishjaingit
manishjaingit / changeURL.sql
Created February 13, 2019 10:38
change base url in wordpress
please execute this query for change base url
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@manishjaingit
manishjaingit / installation.sh
Created October 7, 2018 09:48
ubuntu 16.04 install php + postgres + nginx
# https://www.circuidipity.com/php-nginx-postgresql/
sudo apt install php php-fpm php-apcu php-curl php-cli php-pgsql php-gd php-mcrypt php-mbstring php-fdomdocument php-intl
# Improve security by editing /etc/php/*/fpm/php.ini and modifying pathinfo to 0 …
# cgi.fix_pathinfo=0
sudo systemctl restart php7.0-fpm
# 1. Nginx
@manishjaingit
manishjaingit / setup-lets-encrypt-apache.sh
Created October 6, 2018 19:20
setup lets encrypt in Ubuntu 16.04 on apache
### To apply ssl certificate free via lets encrypt in apache ###
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
sudo certbot --apache -d lifeconnect.app
sudo certbot --apache -d lifeconnect.app -d www.lifeconnect.app
@manishjaingit
manishjaingit / setupletsencrypt.sh
Created October 6, 2018 18:47
setup lets encrypt in Ubuntu 16.04
### To apply ssl certificate free via lets encrypt. ###
Step 1
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo nano /etc/nginx/sites-available/default
# change serverName yourdomainname.com
sudo systemctl reload nginx
@manishjaingit
manishjaingit / gist:5069f7ae26f81d136d1926be540131fc
Created September 9, 2018 11:33 — forked from kathangeorg/gist:2225375
Typo3 Multi Domain BASE URL
//TypoScript
# Multi Domain Configuration
[globalString = ENV:HTTP_HOST=example1.de]
config.baseURL = http:// www.example1.de/
[global]
[globalString = ENV:HTTP_HOST=www.example2.de]
config.baseURL = http:// www.example2.de/
[global]
<?php
/*$date = new DateTime('2017-12-21T01:30:00.0000000', new DateTimeZone('Asia/Kolkata'));
echo "Indian time:". $date->format("Y-m-d H:i:s P");echo "<br>";
$date->setTimeZone(new DateTimeZone('America/New_York'));
echo date('Y-m-d H:i:s', strtotime('2017-12-21T01:30:00.0000000') + (5.5 * 3600));*/
/*$a = function() {
echo 'hello world';
};
<?php
/*$date = new DateTime('2017-12-21T01:30:00.0000000', new DateTimeZone('Asia/Kolkata'));
echo "Indian time:". $date->format("Y-m-d H:i:s P");echo "<br>";
$date->setTimeZone(new DateTimeZone('America/New_York'));
echo date('Y-m-d H:i:s', strtotime('2017-12-21T01:30:00.0000000') + (5.5 * 3600));*/
/*$a = function() {
echo 'hello world';
};
@manishjaingit
manishjaingit / howto-s3bucket.md
Created November 4, 2017 15:02 — forked from ogt/howto-s3bucket.md
HOWTO - Create an amazon s3 bucket with its own domain, access keys

Assume that we want to create a bucket called foo.mydomain.com, and you have already mydomain.com

1. Create the bucket.
  - go to AWS console, s3, select the s3 region that you want.
  - name the bucket foo.mydomain.com
  - save and then select -> click actions-> properties 
  -> in properties click permissions -> add permissions add VIEW for EVERYBODY (s3 files are unguessable urls)

2. Create the CNAME
@manishjaingit
manishjaingit / redirectbyMetaTag.html
Created September 16, 2017 07:30
redirect page by meta tag
<html>
<head>
<meta http-equiv="refresh" content="2;url=http://example.com" />
<title>Page Moved</title>
</head>
<body>
This page has moved. Click <a href="http://www.example.com">here</a> to go to the new page.
</body>
</html>