Enable apache mod_rewrite in Ubuntu 14.04 LTS

Enable apache mod_rewrite in Ubuntu 14.04 LTS

Ubuntu 14.04 LTS comes with Apache 2.4. This new version introduced different default config filenames and in general some differences. (DocumentRoot /var/www/html)

Activate the mod_rewrite module with

sudo a2enmod rewrite

and restart the apache

sudo service apache2 restart

To use mod_rewrite from within .htaccess files (which is a very common use case), edit the default VirtualHost with

sudo nano /etc/apache2/sites-available/000-default.conf

Below “DocumentRoot /var/www/html” add the following lines:

<Directory “/var/www/html”>
AllowOverride All
</Directory>

Restart the server again:

sudo service apache2 restart

PHP: Easily create PDF on the fly

PHP: Easily create PDF on the fly

Here, I will be writing about two pdf creation PHP Classes. They are FPDF and TCPDF. With these classes, you can quickly, easily and effectively generate PDF files.

FPDF is smaller in size compared to TCPDF. But, in functionalities, TCPDF wins. TCPDF has lots of features and functionalities.


If you want very advanced features in PDF creation then TCPDF is for you. And, if you want just minimal features of PDF creation and want a smaller in size class then FPDF is for you.

FPDF Library: The PDF generator

Here is what the FPDF website has to say about itself:-

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

FPDF has other advantages: high level functions. Here is a list of its main features:

– Choice of measure unit, page format and margins
– Page header and footer management
– Automatic page break
– Automatic line break and text justification
– Image support (JPEG, PNG and GIF)
– Colors
– Links
– TrueType, Type1 and encoding support
– Page compression

FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5

Example code to create PDF file

DEMO OF THE CODE ABOVE

DOWNLOAD FPDF || MORE TUTORIALS AND EXAMPLES

TCPDF – PHP class for PDF

Here is the introduction and main features of TCPDF:-

Started in 2002, TCPDF is now one of the world’s most active Open Source projects, used daily by millions o users and included in thousands of CMS and Web applications. TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF Supports UTF-8, Unicode, RTL languages, XHTML, Javascript, digital signatures, barcodes and much more.

Main Features

– no external libraries are required for the basic functions;
– all standard page formats, custom page formats, custom margins and units of measure;
– UTF-8 Unicode and Right-To-Left languages;
– TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
– font subsetting;
– methods to publish some XHTML + CSS code, Javascript and Forms;
– images, graphic (geometric figures) and transformation methods;
– supports JPEG, PNG and SVG images natively, all images supported by GD and all images supported via ImagMagick;
– 1D and 2D barcodes;
– Grayscale, RGB, CMYK, Spot Colors and Transparencies;
– automatic page header and footer management;
– document encryption up to 256 bit and digital signature certifications;
– transactions to UNDO commands;
– PDF annotations, including links, text and file attachments;
– text rendering modes (fill, stroke and clipping);
– multiple columns mode;
– no-write page regions;
– bookmarks and table of content;
– text hyphenation;
– text stretching and spacing (tracking/kerning);
– automatic page break, line break and text alignments including justification;
– automatic page numbering and page groups;
– move and delete pages;
– page compression (requires php-zlib extension);
– XOBject templates;

Example code to create PDF file

DEMO OF THE CODE ABOVE


DOWNLOAD TCPDF || MORE TUTORIALS AND EXAMPLES

You can use any one or both of them based on your requirements.

Thanks.

advantages and disadvantages of amazon web services

advantages and disadvantages of amazon web services

The AWS bouquet of services includes the following:

  • Simple Storage Service – This covers archiving of application programs and data and online backup. The service is low cost, high speed and scalable.
  • CloudDrive – This lets users utilize web-connected devices to access and upload photos, music, documents, and videos. They can also use their devices to stream music.
  • RedShift – The service is designed for analytic workloads connecting with business intelligence tools and standard SQL based clients. It is a data warehouse service that handles petabyte-scale data.
  • CloudSearch – is used for the integration of customized search capabilities and is a scalable search service.
  • Mechanical Turk – This lets developers incorporate human intelligence in remote procedure calls. It is an application program interface (API) that uses a human network to carry out tasks that computers are not suitable for.
  • Dynamo Database – is a NoSQL database which is fully managed and known for its scalability and low latencies.
  • ElastiCache – is protocol-compliant with Memcached, which alleviates database load by speeding up dynamic web applications. Memcached is an open source and high performing distributed memory object caching system. ElastiCache is a fully managed caching service.
  • Elastic Compute Cloud – can be used as an unlimited number of virtual machines and lets business subscribers run app programs.



change password of phpmyadmin in ubuntu

change password of phpmyadmin in ubuntu

If you know your current password, you don’t have to stop mysql server. Open the ubuntu terminal. Login to mysql using:

mysql -u username -p

Then type your password. This will take you into the mysql console. Inside the console, type:

> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

Then flush privileges using:

> flush privileges;



Attach SSL certificate of domain on apache server ubuntu

Attach SSL certificate of domain on apache server ubuntu

Follow these instructions to generate a certificate signing request (CSR) for your Apache Web server. When you have completed generating your CSR, cut/copy and paste it into the CSR field on the SSL certificate-request page.

To Generate a Certificate Signing Request for Apache 2.x

  1. Log in to your server’s terminal (SSH).
  2. At the prompt, type the following command:
    openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

     Note: Replace yourdomainwith the domain name you’re securing. For example, if your domain name is coolexample.com, you would type coolexample.key and coolexample.csr.

  3. Enter the requested information:
    • Common Name: The fully-qualified domain name, or URL, you’re securing.
      If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.coolexample.com.
    • Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor’s name.
    • Organization Unit: If applicable, enter the DBA (doing business as) name.
    • City or Locality: Name of the city where your organization is registered/located. Do not abbreviate.
    • State or Province: Name of the state or province where your organization is located. Do not abbreviate.
    • Country: The two-letter International Organization for Standardization (ISO) format country code for where your organization is legally registered.

       Note: If you do not want to enter a password for this SSL, you can leave the Passphrase field blank. However, please understand there might be additional risks.

  4. Open the CSR in a text editor and copy all of the text.
  5. Paste the full CSR into the SSL enrollment form in your account.



After That

  1. Goto ssl certificate in your Godaddy Account
  2. Create New Certificate
    1. Paste your CSR text into CSR text box in your account
    2. Accept and Confirm
  3. if Your certificate is already generated for prev domain or server
    1. Select Re-Key
    2. Paste your CSR text into CSR text box in your account
    3. Accept and Confirm
  4. After waiting few minutes
  5. Download Generated file
  6. Save it on your server
  7. Goto /etc/apache2/sites-available/
  8. open file with sudo in nano editor file name –  default-ssl.conf
  9. type these two lines into this file
  10. SSLCertificateFile /var/www/html/cert/a64995d1bdfa903a.crt
    SSLCertificateKeyFile /var/www/html/cert/authorizedtech.pro.key
  11. as per your crt and key file path



Satta Matka 2018: भारत में बढ़ रहा है सट्टा मटका का क्रेज, ऑनलाइन खेलते हैं लोग

Satta Matka 2018: भारत में बढ़ रहा है सट्टा मटका का क्रेज, ऑनलाइन खेलते हैं लोग

भारत में Satta Matka लगाने का क्रेज लोगों के बीच बढ़ता जा रहा है। पुलिस और प्रशासन के लगाम लगाने के बावजूद लोग चोरी छिपे सट्टा मटकाखेलते हैं। पुलिस से बचने के लिए आजकल कई लोग Online Sattaखेलते हैं। इससे उनके बारे में किसी को पता नहीं चलता है।



गैरकानूनी लॉटरी गेम है सट्टा मटका 
सट्टा मटका एक तरह की Lottery Game है इसकी शुरुआत अमेरिका में हुई थी लेकिन भारत में भी यह काफी लोकप्रिय हो चुका है। यह एक तरह का सट्टा गेम है। इसे मटका इसलिए कहा जाता है क्योंकि पुराने समय में मटके में नंबर डाले जाते थे। भारत में सट्टा मटका खेलना गैरकानूनी है लेकिन लोग फिर भी इसे खेलते हैं।

कैसे खेलते हैं सट्टा मटका
सट्टा मटके में कई नंबर होते हैं जिसमें से एक यूनिक नंबर पर ही लॉटरी निकलती है अगर आपका वो नंबर निकल गया तो आप मालामाल हो जाएंगे अगर नहीं निकला तो सारे पैसे गंवा देंगे।

ऑनलाइन भी खेलते हैं सट्टा मटका
टेक्नोलॉजी के विस्तार के कारण अब कई तरह के Satta Matka 2018 ऑनलाइन खेले जाते हैं यहां तक कि इसके कई ऐप्स भी मौजूद हैं। पुलिस से बचने के लिए लोग इसे खेल को ऑनलाइन भी खेलते हैं क्योंकि इसमें पकड़े जाने के चांस बहुत कम होते हैं।



कई तरह के होते हैं सट्टा मटका गेम्स
भारत में कई तरह के सट्टा मटका गेम्स खेले जाते हैं जैसे कल्याण मटका, कुबेर मटका, दी पी बॉस, मैन मुंबई मटका, इंडियन मटका, वाली मटका, सुपर डे मटका, बॉस मटका, कुबेर मटका, मधुर मटका, ब्लैक सट्टा, गली दिसावर, गुरु दिल्ली, मायापुरी, दिल्ली किंग, मुंबई मॉर्निंग आदि।

डिस्क्लेमर: इस खबर का उद्देश्य सिर्फ आपको खबरों से अपडेट रखना है। हम किसी भी तरह से सट्टा/ जुआ या इस तरह की गैर-कानूनी गतिविधियों को प्रोत्साहित नहीं करते हैं।

Useful command for apache2 for http and https

Useful command for apache2 for http and https

Disable the default Apache virtual host:

sudo a2dissite 000-default.conf

Enable the site:

sudo a2ensite example.com.conf

Restart Apache:

sudo service apache2 restart



Configuration and Useful Commands for SSL enable in ubuntu server

Configuration and Useful Commands for SSL enable in ubuntu server

Configuration and Useful Commands

Install Apache2

Required to use SSL/TLS certificates:

sudo apt-get install apache2

Enable SSL Module

  1. Replace ‘default-ssl’ with the real site name you set up in /etc/apache2/sites-available/.
    sudo a2enmod ssl
  2. Once the site listed in the command above is enabled, the site appears in /etc/apache2/sites-enabled.

Apply SSL Module to Site

sudo a2ensite default-ssl
sudo /etc/init.d/apache2 restart



How to increase Maximum Execution Time for WordPress site

How to increase Maximum Execution Time for WordPress site

You may receive a message such as “Maximum execution time of 30 seconds exceeded” or “Maximum execution time of 60 seconds exceeded”. This means that it is taking to longer for a process to complete and it is timing out. There are a number of ways to fix this error.

Method 1: Edit file  wp-config.php:

Add the following to wp-config.php:

set_time_limit(300);

 

Method 2: Edit file .htaccess:

Make sure you back up .htaccess before you edit it. 

Add the following to .htaccess:

php_value max_execution_time 300

 

Method 3: Editing php.ini

Add the following to php.ini:

max_execution_time = 300You may receive a message such as “Maximum execution time of 30 seconds exceeded” or “Maximum execution time of 60 seconds exceeded”. This means that it is taking to longer for a process to complete and it is timing out. There are a number of ways to fix this error.

Method 1: Edit file wp-config.php:
Add the following to wp-config.php:

set_time_limit(300);

Method 2: Edit file .htaccess:
Make sure you back up .htaccess before you edit it.

Add the following to .htaccess:

php_value max_execution_time 300



Method 3: Editing php.ini
Add the following to php.ini:

max_execution_time = 300

5 Situations Where Your Train Ticket Refund Can Be Rejected

5 Situations Where Your Train Ticket Refund Can Be Rejected

5 Situations Where Your Train Ticket Refund Can Be Rejected

You may have booked a train ticket through IRCTC website or from the railway ticket counter but you later had a change of plan and decided to cancel the ticket. If you haven’t received the refund, here are 10 such situations that may be the reason for rejection of refund request by IRCTC. Note that these are applicable on e-tickets or i-tickets only.

1. Tatkal ticket

Tatkal ticket provision allows passengers to book a train journey ticket just 24 hours prior to the date of the journey at a higher price. These were introduced for last minute bookings for people travelling due to various emergency reasons

However, no refund is provided to the user on cancellation of a confirmed tatkal ticket. If your ticket was on the waitlist or incase of contingent cancellation, you will get a partial refund from the department as per the prescribed rules. Partial cancellation of Tatkal e-tickets is allowed.

2. Confirmed ticket on the day of journey

You will not be receiving any refund if you cancel a confirmed ticket less than 4 hours prior to the train’s scheduled departure. If a confirmed ticket is cancelled more than 48 hrs before the scheduled departure of the train, flat cancellation charges shall be deducted at Rs.240 for AC First Class/Executive Class, Rs.200 for AC 2 Tier/First Class, Rs. 180 for AC 3 Tier/AC Chair car/ AC 3 Economy, Rs.120 for Sleeper Class and Rs.60 for Second Class.

Cancellation charges are per passenger. If a confirmed ticket is cancelled within 48 hrs and up to 12 hours before the scheduled departure of the train, cancellation charges shall be 25% of the fare subject to the minimum flat rate mentioned in the above clause.

3. RAC ticket on the day of journey

Any refund will not be given by the Indian Railways on a RAC (reservation against cancellation) e-ticket if the cancellation is not filed up to 30 minutes before the scheduled departure of the train.

4. Party tickets

In case, on a party e-ticket or a family e-ticket issued for travel of more than one passenger, some passengers have confirmed reservation and others are on RAC or waiting list, full refund of fare (minus clerkage), shall be admissible for confirmed passengers also subject to the condition that the ticket shall be cancelled online or online TDR shall be filed for all the passengers up to thirty minutes prior to the scheduled departure of the train.

5. Lost I-ticket

If you lose your ticket, make sure you inform the authorities immediately about the loss. The passenger can be issued a duplicate ticket in such a case  to be able to travel on the reservation made but a refund cannot be granted on the grounds of loss of ticket.