Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
@Couto
Couto / browser_detection.js
Created February 11, 2014 15:04
Mootools' browser detection
var browser = (function () {
var ua = navigator.userAgent.toLowerCase(),
platform = navigator.platform.toLowerCase(),
UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/) || [null, 'unknown', 0],
mode = UA[1] === 'ie' && document.documentMode,
name = (UA[1] === 'version') ? UA[3] : UA[1],
version = mode || parseFloat((UA[1] === 'opera' && UA[4]) ? UA[4] : UA[2]),
browser;
return {
@Couto
Couto / restore_console.js
Created March 6, 2014 18:04
Little bookmarklet to restore the console on those websites that disable it (netflix)
javascript:(function () {
var iframe = document.createElement("iframe"),
console;
iframe.src = "about:blank";
iframe.style.display = "none";
document.body.appendChild(iframe);
console = (iframe.contentWindow || iframe.contentDocument).console;
iframe.parentNode.removeChild(iframe);

Basecamp was under network attack

The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).

Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.

Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people

#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select

Keybase proof

I hereby claim:

  • I am couto on github.
  • I am couto (https://keybase.io/couto) on keybase.
  • I have a public key whose fingerprint is 738C 0B7D 9345 9AB2 2A0B 4E09 9AE2 F73E 5DA7 2BDF

To claim this, I am signing this object:

0 info it worked if it ends with ok
1 verbose cli [ '/home/couto/.nvm/v0.10.28/bin/node',
1 verbose cli '/home/couto/.nvm/v0.10.28/bin/npm',
1 verbose cli 'install' ]
2 info using npm@1.4.9
3 info using node@v0.10.28
4 verbose readDependencies using package.json deps
5 verbose install where, deps [ '/var/www/private',
5 verbose install [ 'resourceful',
5 verbose install 'passport',
@Couto
Couto / config
Last active August 29, 2015 14:00
SSH Configuration to allow multiple SSH keys for deployment
Host projectname github.com
Hostname github.com
IdentityFile /home/{{username}}/.ssh/deploy_key_projectname
#User username-on-remote-machine
Host projectname2 bitbucket.org
Hostname bitbucket.org
IdentityFile /home/{{username}}/.ssh/deploy_key_projectname2
#User username-on-remote-machine
.drop-area {
width: 150px;
height: 150px;
border: 5px dotted #CCC;
border-radius: 10%;
transition: all 0.3s linear;
}
.dragging {
width: 200px;
@Couto
Couto / books.txt
Created August 1, 2014 01:29 — forked from dscape/books.txt
Beyond Budgeting
Creativity Inc
Good to Great
Surviving & Thriving in a Relationship with an Entrepreneur
Predictable Revenues
Pricing with Confidence
Flow: The Psychology of Optimal Experience
Further Up The Organization
Nail It Then Scale It
7 Habits Of Highly Effective People

Flashing Flame Devices with Firefox OS

If you have a Flame reference device and wanna try out alternate versions of Firefox OS apart from the stock one, but not willing to build from source, then follow this mini-manual.

Get the build

You can download the packages from the Nightly Build directories of Mozilla FTP. You specifically need the following two files:

  • b2g-XX.0a1.en-US.android-arm.tar.gz (XX is the version number)
  • gaia.zip