Skip to content

Instantly share code, notes, and snippets.

View ssoto's full-sized avatar
🏹
I'm an archer!

Sergio Soto ssoto

🏹
I'm an archer!
View GitHub Profile
# add the ubuntu sources
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
#install the oracle java7
apt-get update
apt-get install oracle-java7-installer
#update alternatives
update-alternatives --config java
@ssoto
ssoto / gettingELK.md
Last active August 29, 2015 14:11
Getting ELK stack using Vagrang

Install ELK stack virtualbox VM using Vagrant

First of all, you need get installed VirtualBox and Vagrant

If you use Ubuntu 14.04 you can get both of them executing:

sudo apt-get install vagrant virtualbox
@ssoto
ssoto / ciberseguridadMalaga.md
Last active August 29, 2015 14:11
Jornadas Ciberseguridad Málaga

Programa

Track 1: Cyber ataques

Ponente: Roberto Peña (roberto.peca@aconsait.com) Responsable seguridad de Aconsait, seguridad orientada a Banca. Su twitter @wolfinside

Experiencia en seguridad en organismo de ministerio de defensa Orientación de la charla con caracter práctico. Auditoria de seguridad de caja negra En la charla nos centraremos en atacar para hacer daño humano, físico y digital

@ssoto
ssoto / notes.md
Created April 14, 2015 16:15
Seminarios de Seguridad Informática (Quivir Research Group)
@ssoto
ssoto / random_syslog.sh
Created June 24, 2015 14:01
Random syslog message sent each random seconds
#!/bin/bash
POS=2
LEN=16
SECONDS_MAX=10
while true; do
str1=$( echo -n `date +\"%s\"` | md5sum | md5sum )
@ssoto
ssoto / falcon_wrapper.py
Created July 21, 2016 14:38
Falcon dynamic service creation
# -* coding: utf-8 *-
import json
import traceback
import falcon
class Resource(object):
def __init__(self):
@ssoto
ssoto / benchmark.py
Created March 21, 2017 15:59
Python time profiling
#!python
# -*- coding: utf-8 -*-
import importlib
import os
from timeit import default_timer as timer
import logging
from my_module import config
class benchmark(object):
import datetime
import json
PROJECT = 'sparta'
KIBANA_URL = 'http://elastic:9200/{}-'.format(PROJECT)
def send_to_kibana():
headers = {'Content-Type': 'application/json',
'Accept': 'text/plain'}
today = data['out'].strftime('%Y.%m.%d')
@ssoto
ssoto / Ussage.py
Last active October 11, 2017 14:45
Benchmark decorator
from usefull_decorators import command_decorator
logger = logging.getLogger('Command')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
# decorator needs a logger object
@command_decorator(logger)
def f_example(a):
print("managing proces... with args: %s" %(a))
@ssoto
ssoto / example.py
Last active June 6, 2018 15:28
Python typing function exampel
def foo_function(a: int, b: int) -> int:
return a + b
# First ussage example
result_a = foo_function(4, 10)
type(result_a)
>>> int
print(result_a)
>>> 14