Skip to content

Instantly share code, notes, and snippets.

View alvinlai's full-sized avatar

Alvin Lai alvinlai

  • Mountain View, CA
View GitHub Profile
@alvinlai
alvinlai / bash_horizontal_line.sh
Created February 10, 2014 20:53
bash horizontal line
# Put this in your ~/.bash_profile
function hr {
if [[ -n $1 ]]; then
space_character=$1
else
space_character='='
fi
@alvinlai
alvinlai / gist:9082523
Created February 18, 2014 23:13
mysql homebrew
gem install mysql2 -v 0.3.15 -- --with-mysql-config=/usr/local/Cellar/mysql55/5.5.30/bin/mysql_config
@alvinlai
alvinlai / .bash_profile
Created March 12, 2014 00:57
boot2docker port mapping
function dfwd {
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$1,tcp,127.0.0.1,$1,,$1"
}
function ddfwd {
VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port$1"
}
gem install nokogiri -- --with-xml2-dir=/usr --with-xslt-dir=/opt/local --with-iconv-dir=/opt/local

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

((d, s, id) ->
js = undefined
fjs = d.getElementsByTagName(s)[0]
return if d.getElementById(id)
js = d.createElement(s)
js.id = id
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"
fjs.parentNode.insertBefore js, fjs
) document, "script", "facebook-jssdk"

Keybase proof

I hereby claim:

  • I am alvinlai on github.
  • I am alvin (https://keybase.io/alvin) on keybase.
  • I have a public key whose fingerprint is 6591 436D 1204 D8F6 3637 0B86 5B31 C344 3D9A B050

To claim this, I am signing this object:

module ReadMarkable
extend ActiveSupport::Concern
included do
has_many :read_marks
def touch_read_at
update_column(:read_at, Time.now)
end
gem install nokogiri -- --with-xml2-dir=/usr --with-xslt-dir=/opt/local --with-iconv-dir=/opt/local

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages: