Skip to content

Instantly share code, notes, and snippets.

View itolosa's full-sized avatar
🎯
Focusing

Ignacio Tolosa itolosa

🎯
Focusing
View GitHub Profile
@itolosa
itolosa / codegen.py
Created September 6, 2013 22:17
PRNG - creates no repeated numbers
import random
import os
import time
import json
def calculateSeed():
return reduce(lambda x,y: x+y, map(int, list(str(11*((int(time.time()) << os.getpid()) >> int(time.time()/400000))/7))))
class CodeGen(object):
@itolosa
itolosa / opencv_osx_cameratest.cpp
Last active December 24, 2015 13:19
Test for camera using OpenCV in OS X
#include <iostream>
#include <highgui.h>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
#define CAMERA_OUTPUT_WINDOW_NAME "camera-output"
int main(int argc, char **argv)
{
@itolosa
itolosa / zshrc
Last active December 26, 2015 04:09
my zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pygmalion"
alias zshconfig="vim ~/.zshrc"
alias ohmyzsh="vim ~/.oh-my-zsh"
export UPDATE_ZSH_DAYS=14
CASE_SENSITIVE="false"
DISABLE_AUTO_TITLE="true"
@itolosa
itolosa / prendidos.sh
Created November 14, 2013 15:58
script para comprobar hosts prendidos en la red interna de la utfsm
set $(ifconfig | sed -En 's/inet[ \t\n\r\f\v]*([0-9.]+)[ \t\n\r\f\v]*netmask[ \t\n\r\f\v]*([a-zA-Z0-9.]+)[ \t\n\r\f\v]*broadcast[ \t\n\r\f\v]*([0-9.]+)[ \t\n\r\f\v]*$/ \1 \2 \3/p') && nmap -sP -PA22 $1/20 | sed -En 's/^Nmap scan report for ([a-zA-Z0-9.]+) [(]([0-9.]+)[)]$/\1|\2/p'
@itolosa
itolosa / router.rb
Created July 30, 2014 01:26
Script NUCOM R5000UN Admin CLI
#!/usr/bin/env ruby
require 'net/telnet'
def run_shell router
#r = router.cmd('help')
puts 'Welcome to router CLI'
print '> '
loop do
cmd_txt = gets
@itolosa
itolosa / enqueue.php
Created August 5, 2014 10:25
jdownloader crawljob enqueuer
<!DOCTYPE html>
<html>
<head>
<title>job enqueue</title>
</head>
<body>
<p>Sistemator 3000</p>
<form action="app.php" method="POST">
<label>Nombre del archivo</label><br>
<input type="text" name="name" value=""><br>
#!/usr/bin/env sh
git clone https://github.com/itolosa/vimfiles.git ~/.vim
sh ~/.vim/install.sh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
pushd /tmp
git clone https://gist.github.com/7090980.git zs
cp zs/zshrc ~/.zshrc
rm -rf zs
popd
chsh -s /bin/zsh
@itolosa
itolosa / password_of_the_day.py
Last active October 17, 2015 22:17
mi version del password del dia para Arris
#!/usr/bin/env python
# Version limpia del generador de: password-of-the-day
# ------------------------------------------------------------
# El generador se trata de cifrado desplazado del seed inicial
# considerando el seed total un string infinito circular
# que en realidad es el mismo seed repetido infinitas veces.
# para esto se utiliza el modulo del largo del seed. (index % largo)
#
# Los desplazamientos que se utilizan para cada caracter
@itolosa
itolosa / ufollow.js
Created December 26, 2014 04:36
ufollow.js
//unfollow twitter
boxes = document.getElementsByClassName('ProfileCard-content');
for (var i = 0; i < boxes.length; i++) {
box = boxes[i];
try {
r = box.getElementsByClassName('FollowStatus')[0].innerHTML;
if (!(r === "te sigue")) {
throw "failed";
}
} catch (err) {
@itolosa
itolosa / mulideal.rb
Created February 24, 2015 22:30
Mulideal download link fetcher
require 'selenium-webdriver'
require 'mechanize'
class LinkCrawler
def initialize
@driver = nil
end
def start
@driver = Selenium::WebDriver.for :firefox