Skip to content

Instantly share code, notes, and snippets.

View zatarra's full-sized avatar

David Gouveia zatarra

View GitHub Profile
@zatarra
zatarra / DynDnsUpdater.vb
Last active October 18, 2019 14:14
Simple DynDns Updater Class written in VB.NET
' .Net DynDNS client class by David Gouveia - me[_@_]davidgouveia.net
' Feel free to use it as long as you don't remove the credits :o)
Imports System.Net
Imports System.IO
Public Class DynDnsUpdater
Private _username, _password, _host, _ip As String
Public Enum UpdateStatus
SUCESS
@zatarra
zatarra / jks-certificate-expiry-checker.sh
Last active February 12, 2023 07:16
Small script to check the expiry of all the certificates inside a java keystore.
#!/bin/sh
########################################################
#
# Check certificates inside a java keystore
#
########################################################
TIMEOUT="timeout -k 10s 5s "
KEYTOOL="$TIMEOUT keytool"
THRESHOLD_IN_DAYS="30"
@zatarra
zatarra / url_checker.pl
Last active December 19, 2015 10:19
Simple URL checker. All it does is check a predefined url to see if it has changes over the time. If it did , then it sends you an e-mail. It is useful when your are waiting for something on a website to change!
#!/usr/bin/perl -W
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Encode qw(encode_utf8);
my $link = [URL TO BE CHECKED];
my $email_from = [FROM EMAIL];
my $email = [TO EMAIL];
#!/usr/bin/env php -q
<?php
/*
* StravaMerger © David Gouveia - http://www.davidgouveia.net
* Simple script to merge tracking data from Strava's exported GPX files.
* The backtrack_limit is there because some files could not be parsed due to their size.
* Feel free to raise the limit but be carrefull not to cross the limit.
* Instead of using regex, I could have used a XML cursor to overcome the backtrack limit
* but either I would have to use the php_xml extension or build my own parser.
*/
@zatarra
zatarra / kickstarter.php
Last active October 6, 2016 06:59
Kickstarter new project notifier
<?php
date_default_timezone_set("Europe/Lisbon");
##############################################################
# KICKSTARTER CRAWLER
# Author: David Gouveia
# Email: david.gouveia [_AT_] gmail.com
#
# This is a very simple script which allows you to crawl
# kickstarter projects and trigger some alerts. I find
@zatarra
zatarra / brain.py
Last active April 25, 2020 23:10
Python script to parse data from Mindflex headband and convert it into a powerfull EEG device
#!/usr/bin/python
import serial
import sys
latestByte = ('c')
lastByte = ('c')
inPacket = False
myPacket = []
PLENGTH = 0
@zatarra
zatarra / uid_smartcard_reader.py
Created December 16, 2014 11:52
Read UID from HID iClass cards
from smartcard.CardType import AnyCardType
from smartcard.CardRequest import CardRequest
from smartcard.util import toHexString, toBytes
from smartcard.CardMonitoring import CardMonitor, CardObserver
from smartcard.util import *
import urllib2
import time
# a simple card observer that prints inserted/removed cards
class printobserver( CardObserver ):

Keybase proof

I hereby claim:

  • I am zatarra on github.
  • I am davidgouveia (https://keybase.io/davidgouveia) on keybase.
  • I have a public key whose fingerprint is E71B EC62 49A5 E7D0 B13F 605E 02CF 172F 3E10 CA4B

To claim this, I am signing this object:

@zatarra
zatarra / esp8266_relays.py
Created July 18, 2016 15:27
ESP8266 Relay controller using MicroPython
import machine
import socket
import ure
RELAYS = [machine.Pin(i, machine.Pin.OUT) for i in (12, 13, 14, 15)]
def getPinStatus():
return RELAYS
def setPin(pin, value):
@zatarra
zatarra / cloud_metadata.txt
Created August 16, 2018 07:06 — forked from jhaddix/cloud_metadata.txt
Cloud Metadata Dictionary useful for SSRF Testing
## AWS
# from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-categories
http://169.254.169.254/latest/user-data
http://169.254.169.254/latest/user-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/iam/security-credentials/[ROLE NAME]
http://169.254.169.254/latest/meta-data/ami-id
http://169.254.169.254/latest/meta-data/reservation-id
http://169.254.169.254/latest/meta-data/hostname
http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key