Skip to content

Instantly share code, notes, and snippets.

@buccolo
buccolo / FixBorder.rb
Last active October 3, 2015 07:37
Sortbits
class FixBorders
def go_horse!
all_images = load_image_list
all_images.each do |image|
# download original
# convert different sizes
# upload to S3
end
end
@buccolo
buccolo / gist:2640901
Created May 9, 2012 01:06
Password frequency from latest Twitter hacked accounts
# cat pwd.txt | cut -d : -f 2 | sort | uniq -c | sort -f -r
freq password
1270 315475
487 123456
176 123456789
68 102030
59 123
50 12345
44 1234
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-precise64-chef"
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.4.4.box"
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.hostname = "detroit"
config.vm.provision :chef_solo do |chef|
# Executes nginx recipe.
include_recipe "detroit::nginx"
# Creates deploy directory with correct permissions.
directory "/data/www" do
owner "nginx"
group "nginx"
mode "755"
end
worker_processes 3;
http {
server {
listen 80;
location / {
root /data/www;
}
}
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-precise64"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box"
# Sets the ip we'll use to access the box
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.hostname = "detroit"
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-precise64"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box"
# Sets the ip we'll use to access the box
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.hostname = "detroit"
# apt-get update; could be optimized to not run every time
bash "updates packages" do
code "apt-get update"
end
# apt-get install git
package "git"
# Executes nginx recipe.
include_recipe "detroit::nginx"
worker_processes <%= node[:nginx][:worker_processes] %>;
events {
worker_connections 1024;
}
http {
server {
listen 80;
#!/usr/bin/env ruby
require 'scraperwiki'
require 'rubygems'
require 'active_support/time'
require 'nokogiri'
class Scraper