This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import gmpy | |
import curve25519 | |
from struct import pack | |
from hashlib import sha256 | |
from binascii import hexlify, unhexlify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Install ISPConfig3 on Ubuntu 16.04 64Bits | |
## Author: Nilton OS blog.linuxpro.com.br | |
## Updated: Seti the Dragon - chibi.pl | |
## old: http://blog.linuxpro.com.br/posts/instalando-ispconfig3-no-ubuntu-1404.html | |
## old: http://www.howtoforge.com/perfect-server-ubuntu-14.04-apache2-php-mysql-pureftpd-bind-dovecot-ispconfig-3-p2 | |
## | |
## new: https://www.howtoforge.com/tutorial/perfect-server-ubuntu-16.04-with-apache-php-myqsl-pureftpd-bind-postfix-doveot-and-ispconfig/ | |
apt-get update | |
c_default="\e[37m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar CsExpression; | |
options { | |
language=CSharp3; | |
TokenLabelType=CommonToken; | |
output=AST; | |
ASTLabelType=CommonTree; | |
} | |
@lexer::namespace{ExpressionParser} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# based on https://www.felix021.com/blog/read.php?2187 with some fixes to really compile the project | |
sudo apt install -y libssl-dev libev-dev libjansson-dev libmpdec-dev libmysqlclient-dev libcurl4-gnutls-dev libldap2-dev libgss-dev librtmp-dev libsasl2-dev | |
# librdkafka: 0.11.3+; DO NOT INSTALL BY APT: version too old (0.8.x); | |
# if you do, remove them by: sudo apt remove librdkafka1 librdkafka-dev | |
wget https://github.com/edenhill/librdkafka/archive/v0.11.3.tar.gz -O librdkafka-0.11.3.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
/** Sources are MIT, they were generated by DataTables builder **/ | |
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function will execute the job, but return the value from it when at least `timeout` amount of milliseconds passed | |
* @param {() => Promise<T>} job | |
* @param {number} timeout | |
* @returns {Promise<T>} | |
*/ | |
export async function TimeAttackMitigator<T>(job: () => Promise<T>, timeout = 700): Promise<T> { | |
return new Promise<T>((resolve, reject) => { | |
let canResolve = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BadRequestException, CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common'; | |
import { ValidationError } from 'class-validator'; | |
import { catchError, Observable, throwError } from 'rxjs'; | |
@Injectable() | |
export class BadRequestInterceptor implements NestInterceptor { | |
intercept(context: ExecutionContext, next: CallHandler): Observable<any> { | |
return next | |
.handle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BadRequestException, CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common'; | |
import { ValidationError } from 'class-validator'; | |
import { catchError, Observable, throwError } from 'rxjs'; | |
@Injectable() | |
export class BadRequestInterceptor implements NestInterceptor { | |
intercept(context: ExecutionContext, next: CallHandler): Observable<any> { | |
return next | |
.handle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Transform } from 'class-transformer'; | |
export const ToArray = () => { | |
const toPlain = Transform( | |
({value}) => { | |
return value; | |
}, | |
{ | |
toPlainOnly: true, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Transform } from 'class-transformer'; | |
export const ToInteger = () => { | |
const toPlain = Transform( | |
({value}) => { | |
return value; | |
}, | |
{ | |
toPlainOnly: true, | |
} |