Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Roman Valls Guimera brainstorm

🏠
Working from home
View GitHub Profile
View gist:814432
from oauth2 import Error
from django.utils.translation import ugettext as _
from tastypie.authentication import Authentication
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store, InvalidTokenError
@deckar01
deckar01 / transcend_wifi_sd_channel_config_root.md
Last active Nov 26, 2015
Rooting the Transcend WiFi SD card by injecting commands into the wifi channel config
View transcend_wifi_sd_channel_config_root.md

Other languages:

Rooting the Transcend WiFi SD card

by injecting commands into the wifi channel config

sd

This exploit requires opening the "Files" page of the card's web interface and escaping to the root of the file system.

View polling.py
class APIWrapper:
#snippet...
def poll_api(self, tries, initial_delay, delay, backoff, success_list, apifunction, *args):
time.sleep(initial_delay)
for n in range(tries):
try:
status = self.get_status()
if status not in success_list:
@dgutman
dgutman / xnat-base-setup.sh
Last active Dec 14, 2015
XNAT Ubuntu Install Script for 12.04 LTS
View xnat-base-setup.sh
## David A Gutman dgutman _at_ emory.edu
## This script walks through install an XNAT Ubuntu Virtual Machine for a VMware Host
## Note: this script can not be run as a single bash script.
# This is a fork/update of johnpaulett's guest setup script
# https://gist.github.com/johnpaulett/206346
## VMWARE Setup: I allocated 80GB for the main XNAT partition (using Thin Provisioning)
## Also I set up an additional disk as a standalone partition to actually store all my data
## Presumably you do not want to have your VM image with your database/XNAT/etc in the same VM as
## storage
@hatt
hatt / logstash-elasticache.pp
Last active Mar 13, 2017
Dynamically scoping Redis with AWS Elasticache to use the local availability zone. Batch writing is used for the shipper to reduce usage costs.
View logstash-elasticache.pp
$redis_host = $::ec2_placement_availability_zone ? {
'us-west-1a' => 'logging-redis-a.<redacted>.0001.usw1.cache.amazonaws.com',
'us-west-1b' => 'logging-redis-b.<redacted>.0001.usw1.cache.amazonaws.com'
}
logstash::output::redis { 'redis-shipper':
batch => true,
host => $redis_host,
key => 'logstash',
data_type => 'list'
@athoune
athoune / gist:5777474
Last active Aug 28, 2018
Pushing mails to Elastic Search for a Kibana analysis.
View gist:5777474
#!/usr/bin/env python
import sys
# Lamson is an application, but also the best way to read email without
# struggling with "battery include" libraries.
from lamson.encoding import from_string as parse_mail
from pyelasticsearch import ElasticSearch
from pyelasticsearch.exceptions import ElasticHttpNotFoundError
@dannguyen
dannguyen / EXAMPLE_WATSON_API_README.md
Last active Nov 23, 2020
Transcribing ProPublica podcast with Python and Watson Speech to Text API
View EXAMPLE_WATSON_API_README.md

Using IBM Watson Speech to Text API to translate a ProPublica podcast

An example of using the Watson Speech to Text API to translate a podcast from ProPublica: How a Reporter Pierced the Hype Behind Theranos

This is just a simpler demo of the same technique I demonstrate to make automated video supercuts in this repo: https://github.com/dannguyen/watson-word-watcher

The transcription takes just a few minutes (less if you parallelize the requests to IBM) and is free...but it isn't perfect by any means. It doesn't fare super well on proper nouns:

  • Charles Ornstein's last name is transcribed as Orenstein
  • John Carreyrou's last name becomes John Kerry Roo
View wpa3-project.md

Trying to deploy WPA3 on my home network

Introduction

Recently, news broke about a new possible offline attack on WPA2 using PMKID. To summarize the attack, WPA2 protected APs can end up broadcasting PMKID values which can then be used to offline-brute-force the password.

These PMKID values are computed this way:

PMKID = HMAC-SHA1-128(PMK, "PMK Name" | MAC_AP | MAC_STA)
@phred
phred / pedantically_commented_playbook.yml
Last active Jul 29, 2021
Very complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
View gist:10130454
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select