Skip to content

Instantly share code, notes, and snippets.

@arivero
arivero / telegram_alarm.py
Last active October 12, 2016 23:51
pokemon notification bot for Telegram/pkalarm somehow extended
#Setup Logging
import logging
log = logging.getLogger(__name__)
#Python modules
import io
import json
#Local modules
from ..alarm import Alarm
@arivero
arivero / Dualities.tex
Created August 18, 2017 12:22
M theory superstring dualities, tikz graph for latex
\usetikzlibrary{arrows}
\begin{tikzpicture}
\node (v1) at (-4,3) {IIA};
\node (v2) at (-4,-1) {IIB};
\node (v4) at (0.5,0) {I};
\node (v6) at (4.5,-1) {$H_{32}$};
\node (v3) at (0.5,2) {I'};
\node (v5) at (4.5,3) {$H_{E\times E}$};
\node (v8) at (-7,-0.5) {};
@arivero
arivero / PutBacks.sh
Created October 10, 2017 23:37
CGI para detectar e insertar citas a las paginas web
#!/bin/sh
######################################################################
# Nombre: PutBacks
# Descripcion: CGI para detectar e insertar citas a las paginas web
# Author: Alejandro Rivero (rivero@sol.unizar.es)
# Date: noviembre 1996
##########################################################################
# Usage:
# With CERN httpd (3.0 or near) add to the config file some lines
# indicating the directories to monitorize for backlinks
@arivero
arivero / embeddings_and_convs.py
Created February 23, 2018 15:23 — forked from pekaalto/embeddings_and_convs.py
Example of two equivalent methods of embedding categorical features on channel dimension
"""
Pekka Aalto 2017
This snippet tries to explain by example what deepmind means
in https://arxiv.org/abs/1708.04782
about embedding on channel axis being equivalent to
one-hot-encoding followed by 1x1 conv.
They write:
import numpy as np
from sklearn.datasets import make_moons
from sklearn.cross_validation import train_test_split
n_feature = 2
n_class = 2
def make_network(n_hidden=100):
@arivero
arivero / .bashrc
Created February 1, 2019 16:36 — forked from mGalarnyk/.bashrc
Function to append to the end of .bashrc file in linux to run PySpark on jupyter notebook for the blog post https://medium.com/@GalarnykMichael/install-spark-on-ubuntu-pyspark-231c45677de0#.qxguj5czj
function snotebook ()
{
#Spark path (based on your computer)
SPARK_PATH=~/spark-2.0.0-bin-hadoop2.7
export PYSPARK_DRIVER_PYTHON="jupyter"
export PYSPARK_DRIVER_PYTHON_OPTS="notebook"
# For python 3 users, you have to add the line below or you will get an error
#export PYSPARK_PYTHON=python3
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@arivero
arivero / abroHilo.py
Last active July 1, 2019 17:53
Comparacion de las pools de Hilos y de Procesos
import hashlib
import timeit
def slow(z,f,i):
s=hashlib.sha3_512(i.to_bytes(8,'big'))
for x in range(z): s.update(s.digest()*f)
return s.digest()
initcode="""
import concurrent.futures
from functools import partial
executorT = concurrent.futures.ThreadPoolExecutor()
$ apt-get update && apt-get upgrade --assume-yes
$
$ pip3 install frida-tools
$ pip3 install objection
$
$ sudo apt-get install android-tools-adb android-tools-fastboot
$
$ wget wget https://github.com/frida/frida/releases/download/12.7.0/frida-server-12.7.0-android-arm64.xz
$ unxz frida-server-12.7.0-android-arm64.xz