Skip to content

Instantly share code, notes, and snippets.

View diegslva's full-sized avatar
🎯
Focusing

Diego S diegslva

🎯
Focusing
  • GDFX Asset Management
  • Paraná, Brazil
  • X @diegbtc
View GitHub Profile
@diegslva
diegslva / transfer.fish
Created January 15, 2016 18:13 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@diegslva
diegslva / JSRat.ps1
Created January 24, 2016 20:34
Fileless JavaScript Reverse HTTP Shell
<#
Author: Casey Smith @subTee
License: BSD3-Clause
.SYNOPSIS
Simple Reverse Shell over HTTP. Execute Commands on Client.
@diegslva
diegslva / iptables.sh
Created March 16, 2016 10:21 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP
@diegslva
diegslva / server.sh
Created May 9, 2016 23:11 — forked from cnicodeme/server.sh
This script automatically set up a new *Debian* server with Apache, Mysql, Php and ProFTPd, and secures all of the previous + SSH.
#!/bin/bash
#
# --------------------------------------------------------------------
# This is a free shell script under GNU GPL version 3.0 or above
# Copyright (C) 2005 ReFlectiv project.
# Feedback/comment/suggestions : http://www.reflectiv.net/
# -------------------------------------------------------------------------
#
# This script automatically set up a new *Debian* server (IMPORTANT : Debian!), by doing these actions :
#

Keybase proof

I hereby claim:

  • I am diegslva on github.
  • I am diegslva (https://keybase.io/diegslva) on keybase.
  • I have a public key whose fingerprint is 8D40 D3B8 9CF0 26EF B853 3114 BDC2 D0F4 2780 23FD

To claim this, I am signing this object:

@diegslva
diegslva / optimal_strategy.py
Created November 8, 2016 05:19 — forked from lukovkin/optimal_strategy.py
Compute optimal trading strategy for the algorithm described in http://arxiv.org/abs/1508.00317
import numpy as np
import pandas as pd
def compute_market_prices(prices):
"""Compute market prices according to the trading competition recipe.
Parameters
----------
prices : DataFrame
@diegslva
diegslva / multi-ts-lstm.py
Created November 8, 2016 05:21 — forked from lukovkin/multi-ts-lstm.py
Time series prediction with multiple sequences input - LSTM - 1
# Time Series Testing
import keras.callbacks
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dense, Dropout
from keras.layers.recurrent import LSTM
# Call back to capture losses
class LossHistory(keras.callbacks.Callback):
def on_train_begin(self, logs={}):
self.losses = []
@diegslva
diegslva / mem-ts-RNN.py
Created November 8, 2016 05:23 — forked from lukovkin/mem-ts-RNN.py
Memory-efficient training of RNNs (modified example) - see https://groups.google.com/forum/#!topic/keras-users/vnGMtKPu1Xc for the discussion
# Code for Jupyter/IPython Notebook environment
from keras.models import Sequential
from keras.layers.core import TimeDistributedDense, Activation, Dropout
from keras.layers.recurrent import GRU
import numpy as np
from keras.utils.layer_utils import print_layer_shapes
%matplotlib inline
import matplotlib.pyplot as plt
@diegslva
diegslva / CATCH_Keras_RL.md
Created November 8, 2016 22:34 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example