Skip to content

Instantly share code, notes, and snippets.

View pi0's full-sized avatar
🎯

Pooya Parsa pi0

🎯
View GitHub Profile
Infix to Postfix Translation with Parentheses
Algorithm for Method processOperator to Include Parentheses
if the operator stack is empty OR the current operator is '('
Push the current operator onto the stack
else
Peek the stack and let topOp be the top operator.
while the stack is non-empty AND
precedence of the current operator is less than or equal to the topOp
package AP2014.sql.storage.cell;
public class DataCell extends AbstractCell{
public DataCell(String paramName,Object value,int maxValue,CellType type) {
super(paramName, value ,maxValue,type);
}
public boolean equals(MetaCell metaCell){
#!/bin/bash
#TODO : install setup.run to /opt ...
ALTERA_PATH=/opt/altera/*/
#32bit_deps
sudo dpkg --add-architecture i386
sudo apt-get update
@pi0
pi0 / Core files
Created April 19, 2015 15:56
Google translate Offline Language Files
https://dl.google.com/translate/offline/v3/r1/c.zip
https://dl.google.com/translate/offline/v3/r1/profiles.txt
@pi0
pi0 / squid_builld.sh
Last active January 10, 2017 10:12
squid build
./configure --prefix=/usr \
--localstatedir=/var \
--libexecdir=${prefix}/lib/squid \
--srcdir=. \
--with-openssl \
--datadir=${prefix}/share/squid \
--sysconfdir=/etc/squid \
--with-default-user=proxy \
--with-logdir=/var/log \
--with-pidfile=/var/run/squid.pid
@pi0
pi0 / gen_ssl.sh
Created August 15, 2015 11:01
Generate SSL
# Private server key
sudo openssl genrsa -des3 -out server.key 2048
# Create certificate signing request
sudo openssl req -new -key server.key -out server.csr
# Remove the Passphrase
sudo cp server.key server.key.org
sudo openssl rsa -in server.key.org -out server.key
rm server.key.org
@pi0
pi0 / bug474.cpp
Last active September 26, 2015 20:05
Windows 10 Buffer overflow Exploit
/*
* Windows 10 kernel buffer overflow in NtGdiBitBlt PoC
* compile:
* cl.exe bug474.cpp user32.lib gdi32.lib shell32.lib
*/
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
#include <time.h>
@pi0
pi0 / User.php
Last active June 26, 2016 21:58
Laravel Mongo User Model
<?php
namespace App;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Foundation\Auth\Access\Authorizable;
@pi0
pi0 / docker-clean.sh
Created July 6, 2016 11:40
Cleanup Docker Storage
# http://stackoverflow.com/questions/30604846/docker-error-no-space-left-on-device
## Delete the orphaned volumes in Docker
docker volume rm $(docker volume ls -qf dangling=true)
## Remove all the unused Images.
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
@pi0
pi0 / docker-nginx-export.sh
Last active July 9, 2016 21:36
Export Docker Compose Nginx Logs
docker logs nginx_nginx_1 | grep -Po "(?<=nginx.1 \|.....).*" | pv > ~/nginx.log