-
Put
maintenance.htmlinto your root directory -
Open
.htaccessfile -
Insert this block in the first line of the file
ErrorDocument 503 /maintenance.html <IfModule mod_rewrite.c>
RewriteEngine On
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |
| #!/bin/bash | |
| function s3du(){ | |
| bucket=`cut -d/ -f3 <<< $1` | |
| prefix=`awk -F/ '{for (i=4; i<NF; i++) printf $i"/"; print $NF}' <<< $1` | |
| aws s3api list-objects --bucket $bucket --prefix=$prefix --output json --query '[sum(Contents[].Size), length(Contents[])]' | jq '. |{ size:.[0],num_objects: .[1]}' | |
| } | |
| s3du $1; |
| # force HTTPS and www. | |
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR] | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L] | |
| # alternative way | |
| RewriteCond %{HTTP_HOST} !^$ | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] |
| #!/bin/bash | |
| # Checks active, non-spot, EC2 instances against the list reserved instances | |
| # in order to determine which availability-zone/instance-type combinations | |
| # are paying for on-demand prices (that could benefit from reserved instance | |
| # purchase), or current reservations that aren't being used. | |
| # | |
| # Dependencies: | |
| # * awscli (http://aws.amazon.com/cli/) | |
| # * jq (http://stedolan.github.io/jq/) |
This guide is only representative from my point of view and it may not be accurate and you should go on the official AWS & GCP websites for accurate and detailed information. It's initially inspired by AWS in simple English and GCP for AWS professionals. The idea is to compare both services, give simple one-line explanation and examples with other software that might have similiar capabilities. Comment below for suggestions.
| Category | Service | AWS | GCP | Description | It's like |
|---|---|---|---|---|---|
| Compute | IaaS | Amazon Elastic Compute Cloud (EC2) | Google Compute Engine | Type-1 virtual servers | VMware ESXi, Citrix XenServer |
| PaaS | AWS Elastic Beanstalk | Google App Engine | Running your app on a platform |
Generate your CSR This generates a unique private key, skip this if you already have one.
sudo openssl genrsa -out etc/ssl/yourdomain.com/yourdomain.com.key 1024Next generate your CSR (Certificate Signing Request), required by GoDaddy:
This is a step by step instruction on how to create a cluster that has three Solr nodes running in cloud mode. These instructions should work on both a local cluster (for testing) and a remote cluster where each server runs in its own physical machine.
This was tested on Solr version 5.4.1 and Zookeeper version 3.4.6
curl -O http://archive.apache.org/dist/lucene/solr/5.5.3/solr-5.5.3.tgzmkdir /opt/solr| #!/bin/bash | |
| # file: ttfb.sh | |
| # curl command to check the time to first byte | |
| # ** usage ** | |
| # 1. ./ttfb.sh "https://google.com" | |
| # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.