Skip to content

Instantly share code, notes, and snippets.

View Eishfaq's full-sized avatar

Eishfaq Ahmed Shafa Eishfaq

View GitHub Profile
sed -i '/^$/d' list.txt
It will overwrite the file with no blank lines.
@Eishfaq
Eishfaq / gist:b33d242365abad56fc3c602221dba465
Created July 18, 2019 12:06
RabbitMQ Installation and Execution
#================Install Composer & Rabbitmq client==================
"require": {
"php-amqplib/php-amqplib": ">=2.6.1"
}
}
composer update
#Install On Ubuntu 18.04
sudo apt update
@Eishfaq
Eishfaq / gist:27e9896fc0768bc73eafe76cb954da3c
Created July 18, 2019 12:05
Forking in Php pcntl_fork()
# Parallel process with pcntl_fork()
$data = array(
'142.12.34.21',
'75.34.21.34',
'98.34.23.11',
''97.23.12.33
);
foreach($data as $each){
$pid = pcntl_fork();
@Eishfaq
Eishfaq / LEMPenvSetup.txt
Last active July 16, 2019 15:20
LNMP Environment Creation
#Step-1: Install Nginx
#EPEL stands for Extra Packages for Enterprise Linux. Because yum as a package manager does not include the latest version of nginx in its default repository, installing EPEL will make sure that nginx on CentOS stays up to date.
#To install EPEL, open terminal and type in:
yum install epel-release
#To install nginx, open terminal and type in:
yum install nginx
#Send the project to server
scp portal.zip root@host.net:/usr/share/nginx/html
#Unzip the file
unzip portal.zip
@Eishfaq
Eishfaq / socketprog.txt
Last active July 11, 2019 07:00
Socket Programming ( Prodigyview)
#Installation
#The easy way to install the application is with composer. Start by running the require command in composer
composer require prodigyview/prodigyview
#sender script
use prodigyview\network\Socket;
use prodigyview\system\Security;
Security::init();
$socket = new Socket($ip, $port, array('connect' => true)); //Opening socket connection of the target server