Skip to content

Instantly share code, notes, and snippets.

View Faizanq's full-sized avatar

Faizan Qureshi Faizanq

View GitHub Profile
puttygen command to convert your .pem file to a .ppk file:
sudo puttygen pemKey.pem -o ppkKey.ppk -O private
puttygen command to convert a .ppk file into a .pem file:
sudo puttygen ppkkey.ppk -O private-openssh -o pemkey.pem
Step-1 Donwnload
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.4/elasticsearch-2.3.4.deb
Step-2 Install
sudo dpkg -i elasticsearch-2.3.4.deb
Step-3 Run
sudo update-rc.d elasticsearch default 95 10
sudo /etc/init.d/elasticsearch start
Step 1 - install
sudo docker pull docker.elastic.co/elasticsearch/elasticsearch:7.1.0
Step 2 - Run
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.1.0
@Faizanq
Faizanq / Composer install
Last active May 25, 2019 16:25
Composer install
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
@Faizanq
Faizanq / Node Version Install
Last active October 7, 2019 17:59
Node Version Install
Step 1 – Add Node.js PPA
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Step 2 – Install Node.js on Ubuntu
sudo apt-get install nodejs
Step 3
set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
or
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5000
For the fun of it, I tested the performance of the following:
1. json_decode('{}');
2. new StdClass();
3. (object)[];
https://jsfiddle.net/lesson8/HkEuf/1/
@Faizanq
Faizanq / php-html-css-js-minifier.php
Created January 27, 2019 07:10 — forked from skhani/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {