Skip to content

Instantly share code, notes, and snippets.

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

Luis Naia lnaia

🏠
Working from home
View GitHub Profile
@lnaia
lnaia / gist:d1399a626750b9a2eb39
Last active August 29, 2015 14:21 — forked from zachwaugh/gist:521133
Loading rails environment in a script placed anywhere
#!/usr/bin/env ruby
ROOT_PATH = File.expand_path File.dirname(__FILE__)
APP_PATH = "#{ROOT_PATH}/PATH_TO_YOUR_APP"
Dir.chdir APP_PATH
require File.join(File.dirname(__FILE__), *%w[config environment])
@lnaia
lnaia / Gruntfile.js
Created May 12, 2015 09:58
Gruntfile.js for edustorage project (integrated w/ rails)
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-template');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
var conf = {
@lnaia
lnaia / essential-javascript-links.md
Last active August 29, 2015 14:13 — forked from ericelliott/essential-javascript-links.md
# Essential JavaScript Links
@lnaia
lnaia / validate_ipv6.rb
Last active August 29, 2015 14:07 — forked from cpetschnig/validate_ipv6.rb
Regular Expression Validation for IPv6 addresses in Ruby
# Regular Expression Validation for IPv6 addresses in Ruby
#
# Inspired by (if not to say copied from): http://forums.dartware.com/viewtopic.php?t=452
# Thanks, Dartware!
IPV6_REGEX = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f
@lnaia
lnaia / jam.sh
Last active September 25, 2016 22:35
A fully functional general purpose WiFi Jammer, for research purposes. Use it at your own risk. Inspired by https://code.google.com/p/wifijammer/downloads/detail?name=wifijammer_0.1.sh and http://julianoliver.com/output/log_2014-05-30_20-52.
#!/bin/bash
# Targeted jammer
NIC=$1 # Your wireless NIC
BSSID=$2 # Your target BSSID
if [ "$NIC" == "" ]; then
echo "No NIC defined."
exit 1
fi
@lnaia
lnaia / glasshole.sh
Last active August 29, 2015 14:06
The below script will find and detect Google Glass on the local network and kick them off. Read the comments for more details.
# Taken from: http://julianoliver.com/output/log_2014-05-30_20-52
#!/bin/bash
#
# GLASSHOLE.SH
#
# Find and kick Google Glass devices from your local wireless network. Requires
# 'beep', 'arp-scan', 'aircrack-ng' and a GNU/Linux host. Put on a BeagleBone
# black or Raspberry Pi. Plug in a good USB wireless NIC (like the TL-WN722N)
# and wear it, hide it in your workplace or your exhibition.
#
@lnaia
lnaia / dataset.txt
Created September 9, 2014 21:25
Distribute a random amount of tests in several files, among N machines equally
# Example: ./file_path:number_of_tests_in_this_file
./file_path:50
./file_path:23
./file_path:7
@lnaia
lnaia / web-servers.md
Last active August 29, 2015 14:06 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@lnaia
lnaia / README.txt
Last active May 18, 2016 18:22
Send SMS using Tesco REST Service on http://www.tescomobile.ie/
Send SMS using tesco REST Service, on their mobile website
==========================================================
Mark both files as executables: chmod +x login.sh sms.sh
I have no idea what is their cookie session timeout, so just
run the login.sh every hour or so to ensure you have a valid session.
After you have the cookies.txt up to date, you can stard sending sms:
@lnaia
lnaia / calculate_income.rb
Created August 20, 2014 12:19
Calculate irish net income
=begin
Tax Income
20% up to 32,800€
41% above 32,800€
Universal Social Charge (USC)
2% first 10,036€
4% next 5,980€
7% on balance