Skip to content

Instantly share code, notes, and snippets.

View LeonanCarvalho's full-sized avatar
🏠
Working from home

Leonan LeonanCarvalho

🏠
Working from home
View GitHub Profile
@LeonanCarvalho
LeonanCarvalho / hidronf.json
Created July 29, 2020 20:12
Bacia Hidrográfica Nova Friburgo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeonanCarvalho
LeonanCarvalho / hidronf.json
Created July 29, 2020 20:12
Bacia Hidrográfica Nova Friburgo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//FROM gameserver/server.jar!/l2/gameserver/network/l2/c2s/CharacterSelected.class
protected void runImpl() {
//...
if (Config.ALT_LIMIT_HWID_WINDOW != 0 && !StringUtils.isEmpty(var1.getHwid())) {
//You could simple check if the account is premium and byypass here...
int hwidCount = 0;
Iterator AllPlayers = GameObjectsStorage.getAllPlayersForIterate().iterator();
while(AllPlayers.hasNext()) {
Player tPlayer = (Player)AllPlayers.next();
@LeonanCarvalho
LeonanCarvalho / ip_block.txt
Last active July 5, 2019 14:08
L2j DDoS Servers List
netsh advfirewall firewall add rule name="IP Block AmericaNorte" dir=in interface=any action=block remoteip=104.129.192.0/20,104.131.0.0/16,104.154.0.0/15,104.196.0.0/14,104.232.128.0/19,104.236.0.0/16,104.237.0.0/20,104.237.128.0/19,104.244.72.0/21,104.245.68.0/22,104.248.0.0/16,104.32.0.0/14,104.40.0.0/13,107.170.0.0/16,107.172.0.0/14,107.191.32.0/19,107.191.96.0/19,108.184.0.0/15,108.58.0.0/16,12.125.0.0/16,128.199.0.0/16,134.209.0.0/16,138.197.0.0/16,138.68.0.0/16,139.59.0.0/16,142.93.0.0/16,146.185.144.0/21,159.65.0.0/16,162.243.0.0/16,162.244.80.0/22,165.227.0.0/16,167.99.0.0/16,178.128.0.0/20,178.128.144.0/20,178.128.192.0/20,184.104.0.0/15,184.154.0.0/16,188.166.224.0/20,189.224.0.0/12,198.108.0.0/14,198.199.64.0/18,206.189.0.0/16,208.157.144.0/21,209.97.128.0/18,216.218.128.0/17,24.159.0.0/16,24.30.0.0/18,24.30.64.0/19,37.139.8.0/20,45.55.0.0/16,46.101.128.0/17,68.183.0.0/16,75.146.48.0/20,76.96.0.0/17,96.64.0.0/19,97.72.0.0/15,97.75.64.0/18,98.0.0.0/12,98.160.0.0/11
netsh advfirewall firewall add ru
@LeonanCarvalho
LeonanCarvalho / form.php
Created July 2, 2019 15:14
ReCaptcha v3 php
<?php
/**
* Created by PhpStorm.
* User: Leonan Carvalho
* Date: 02/07/2019
* Time: 10:44
*/
//Valida se o método é post e se na requisição há o token do recaptcha
if ($_SERVER['REQUEST_METHOD'] === 'POST' && array_key_exists("g-recaptcha-response", $_REQUEST)) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeonanCarvalho
LeonanCarvalho / ckan.service
Created February 21, 2018 14:17
systemd ckan service
[Unit]
Description=CKAN Service
Requires=solr.service postgresql.service
After=solr.service postgresql.service
[Service]
User=ckan
Group=ckan
Type=forking
TimeoutSec=0
<?php
namespace Application\WebServices;
/**
*
* @author LeonanCarvalho <j.leonancarvalho@gmail.com>
*/
abstract class AbstractSoapClient {
<?php
namespace Application\Tasks;
/**
* AsyncTaskAbstract allows to fork a php process running at PHP-FPM to do AsyncTasks
* (Not tested with php-cgi, and probaly will not work with Apache mod_php and php-single-worker)
* @requeriment PCNTL Process Control http://php.net/manual/pt_BR/book.pcntl.php
* @requeriment POSIX http://php.net/manual/pt_BR/book.posix.php
* @requeriment Semaphore, Shared Memory and IPC http://php.net/manual/pt_BR/book.sem.php
@LeonanCarvalho
LeonanCarvalho / cache-service-worker.js
Last active April 7, 2021 05:37
Cache service worker
/* global caches, Promise */
//Arquivo apenas para facilitar a edição do javascript, deve ser colado no .php// Não minificar
importScripts('serviceworker-cache-polyfill.js');
// While overkill for this specific sample in which there is only one cache,
// this is one best practice that can be followed in general to keep track of
// multiple caches used by a given service worker, and keep them all versioned.
// It maps a shorthand identifier for a cache to a specific, versioned cache name.