Skip to content

Instantly share code, notes, and snippets.

View imran-parray's full-sized avatar
🏠
Working from home

imran parray imran-parray

🏠
Working from home
View GitHub Profile
@imran-parray
imran-parray / PHP-CURL-GET-POST.md
Last active June 24, 2021 07:06
How to make Curl GET and POST request using CURL in PHP

HTTP GET

function httpGET($url,$headers)
{
   	$curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($curl);
    curl_close($curl);
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'example1';
$dbuser = 'user';
$dbpass = '';
$dbhost = 'localhost';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
cat temp.txt| while read line ; do echo "QUIT"|openssl s_client -connect $line:443 2>&1|grep 'server extension "heartbeat" (id=15)' || echo $line: safe; done
import re
import sys
urls=[]
try:
file_name=sys.argv[1]
replacement=sys.argv[2]
except:
print("[!] Enter urls file name")
giturls()
{
while read line; do echo $line | cut -d/ -f1-3;echo $line | cut -d/ -f1-4;echo $line | cut -d/ -f1-5;echo $line | cut -d/ -f1-6;echo $line | cut -d/ -f1-7;echo $line | cut -d/ -f1-8;echo $line | cut -d/ -f1-9;echo $line | cut -d/ -f1-10;echo $line | cut -d/ -f1-11;echo $line | cut -d/ -f1-12;echo $line | cut -d/ -f1-13;echo $line | cut -d/ -f1-14;echo $line | cut -d/ -f1-15;echo $line | cut -d/ -f1-16;echo $line | cut -d/ -f1-17;echo $line | cut -d/ -f1-18;echo $line | cut -d/ -f1-19;echo $line | cut -d/ -f1-20;echo $line | cut -d/ -f1-21;done | grep -v '?' | grep -v "\...$" | grep -v "\....$" | grep -v "\....$" | sort -u
}
data=['http://google.com?param1=value1',
'https://hello.com?param2=1&param3=3',
'https://hello.com?param1=1&param2=2&param4=4']
final_params=[]
all_prms=[]
for line in data:
all_prms.append(line.split('?')[1:][0].split('&'))
for line in all_prms:
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker*
# install dependencies 4 cert
#include<stdio.h>
#include<stdlib.h>
struct Node
{
int data;
struct Node *link;
};
typedef struct Node node;
node *first;
@imran-parray
imran-parray / 7-[DS2]-Multiple stack in Single Array.c
Last active September 13, 2017 06:45
7-Multiple stack in Single Array
#include<stdio.h>
#define max 12
int st[max],n,top[5],tos[5],buttom[5],ch,sn,ele,i,size,item;
void main()
{