Skip to content

Instantly share code, notes, and snippets.


Faraz Fallahi fffaraz

View GitHub Profile
View gcd_prob.cpp
#include <iostream>
#include <random>
#include <bits/stdc++.h>
using namespace std;
int main()
std::random_device m_device{};
std::mt19937 m_generator{m_device()};
View telegram_emojis.cpp
#include <QCoreApplication>
#include <QFile>
#include <QDataStream>
#include <QDebug>
#include <iostream>
namespace Ui {
namespace Emoji {
constexpr auto kPostfix = 0xFE0FU;
class One {};
while true; do git pull; sleep 30; done

Keybase proof

I hereby claim:

  • I am fffaraz on github.
  • I am fffaraz ( on keybase.
  • I have a public key ASB--MPs8LCDbwPJOxCnVZ0kxuv-x93mHx4oo3bBLS9hIwo

To claim this, I am signing this object:

View FileAlterationMonitor.php
class FileAlterationMonitor
private $scanFolder, $initialFoundFiles;
public function __construct($scanFolder)
$this->scanFolder = $scanFolder;
fffaraz / bomb.php
Created Jul 5, 2017
How to defend your website with ZIP bombs
View bomb.php
// dd if=/dev/zero bs=1M count=10240 | gzip > 10G.gzip
$agent = lower($_SERVER['HTTP_USER_AGENT']);
//check for nikto, sql map or "bad" subfolders which only exist on wordpress
if (strpos($agent, 'nikto') !== false || strpos($agent, 'sqlmap') !== false || startswith($url,'wp-') || startswith($url,'wordpress') || startswith($url,'wp/'))
fffaraz / gof.html
Created Jul 4, 2017
Conway's Game of Life
View gof.html
<!-- saved from -->
<title>Conway's Game of Life</title>
<style type="text/css">
body{ font-family: serif; font-size:1.00em; text-align: center; margin: 10px 0 30px 0; virtical-align: middle }
<script type="text/javascript">
var cells = new Array(40);
var tmpCells = new Array(40);
fffaraz /
Created May 22, 2017 — forked from azadkuh/
Catch Unix signals in Qt applications

Unix signals in Qt applications

It's quite easy to catch unix signals in Qt applications. you may like to ignore or accept them.

#include <QCoreApplication>

#include <signal.h>
#include <unistd.h>
fffaraz /
Created Nov 25, 2016
Python YouTube Playlist Link Collector
from bs4 import BeautifulSoup
import requests
def getPlaylistLinks(url):
sourceCode = requests.get(url).text
soup = BeautifulSoup(sourceCode, 'html.parser')
domain = ''
for link in soup.find_all("a", {"dir": "ltr"}):
href = link.get('href')
if href.startswith('/watch?'):
fffaraz / portscanner.c
Last active Aug 25, 2022
Port scanner code in c
View portscanner.c
#include "stdio.h"
#include "sys/socket.h"
#include "errno.h"
#include "netdb.h"
#include "string.h"
#include "stdlib.h"
int main(int argc , char **argv)
struct hostent *host;