Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
🏠
Working from home

Md. Sumon Islam sumonst21

🏠
Working from home
View GitHub Profile
@sumonst21
sumonst21 / LICENCE SUBLIME TEXT
Created August 28, 2018 16:20
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@sumonst21
sumonst21 / php-style-guide.md
Created October 12, 2018 18:23 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@sumonst21
sumonst21 / Wordpress Plugin
Created December 11, 2018 13:32 — forked from swapnil-webonise/Wordpress Plugin
Simple wordpress plugin for inserting form details into database using ajax and usual form submit.
Download and copy jquery library in directory.
In this plugin jquery-1.8.3.js is used.
@sumonst21
sumonst21 / http-redirect-target.php
Created March 24, 2019 15:20
Get HTTP redirect destination for a URL in PHP
<?php
// FOLLOW A SINGLE REDIRECT:
// This makes a single request and reads the "Location" header to determine the
// destination. It doesn't check if that location is valid or not.
function get_redirect_target($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
@sumonst21
sumonst21 / perms.md
Created March 26, 2019 00:49 — forked from stefanbc/perms.md
Set proper permissions on /var/www/

HOWTO

To set up permissions on /var/www where your files are served from by default:

sudo addgroup webmasters
sudo adduser $USER webmasters
sudo chown -R root:webmasters /var/www
sudo find /var/www -type f -exec chmod 664 {} \;
sudo find /var/www -type d -exec chmod 775 {} \;
@sumonst21
sumonst21 / pidoa.php
Created April 11, 2019 10:59 — forked from tzi/pidoa.php
Pidoa - Rename TV shows files automatically
<?php
function usage( $argv ) {
echo PHP_EOL .
'Pidoa' . PHP_EOL .
'------------' . PHP_EOL .
'This script allow you to rename tv shows easily' . PHP_EOL .
PHP_EOL .
'Usage: php ' . $argv[ 0 ] . ' <folder_path> <pattern>' . PHP_EOL .
'Example: php ' . $argv[ 0 ] . ' ./ "Babylon 5 S%Sx%E %V"' . PHP_EOL .
@sumonst21
sumonst21 / README.md
Created April 11, 2019 19:09 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@sumonst21
sumonst21 / codeiginter-server-config.md
Created May 10, 2019 20:58 — forked from yidas/codeiginter-server-config.md
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@sumonst21
sumonst21 / SSLXampp.md
Created May 17, 2019 12:22 — forked from nguyenanhtu/SSLXampp.md
Guide to configure SSL in XAMPP for Windows

How to test 'https' in XAMPP for localhost ? I will guide you

Menu

  • Create certificate
  • Config Apache to access https instead of http
  • Config mod rewrite to generate SSL url
  • Config Virtual host to test site

Step 1 : Create certificate

  • Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
@sumonst21
sumonst21 / nginx-tuning.md
Created May 27, 2019 14:18 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.