This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Colors Git and shows branch | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddSecurityStringToOrder < ActiveRecord::Migration | |
def self.up | |
add_column :orders, :security_string, :string | |
end | |
def self.down | |
remove_column :orders, :security_string | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Product.best_sellers | |
'SELECT `products`.*, COUNT(*) AS total FROM `products` INNER JOIN order_items ON order_items.product_id = products.id INNER JOIN orders ON orders.id=order_items.order_id WHERE ((orders.payment_state=3) GROUP BY products.id ORDER BY total DESC' | |
# Yay! | |
> @store.products.best_sellers | |
'SELECT `products`.*, COUNT(*) AS total FROM `products` INNER JOIN order_items ON order_items.product_id = products.id INNER JOIN orders ON orders.id=order_items.order_id WHERE (`products`.store_id = 464) AND (orders.payment_state=3) GROUP BY products.id ORDER BY products.name ASC' | |
# Nooo!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s3_config = YAML.load_file(RAILS_ROOT + "/config/amazon_s3.yml") | |
s3_config = s3_config['staging'].to_options | |
@s3 = RightAws::S3.new(s3_config[:access_key_id], s3_config[:secret_access_key]) | |
@s3_interface = RightAws::S3Interface.new(s3_config[:access_key_id], s3_config[:secret_access_key]) | |
to_bucket = @s3.bucket(<bucket_name>) | |
to_bucket = @s3.bucket(<bucket_name>) | |
keys = from_bucket.keys('prefix' => 'background_images') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'unicode' | |
class String | |
def to_permalink | |
str = Unicode.normalize_KD(self).gsub(/[^\x00-\x7F]/n,'') | |
str = str.gsub(/[^-_\s\w]/, ' ').downcase.squeeze(' ').tr(' ', '-') | |
str = str.gsub(/-+/, '-').gsub(/^-+/, '').gsub(/-+$/, '') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# needed to get spork/rspec running under snow leopard | |
# edit line 12 of rspec-1.2.8/lib/spec/runner/drb_command_line.rb | |
# was | |
# DRb.start_service("druby://localhost:0") | |
# should be | |
DRb.start_service("druby://127.0.0.1:0") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//exploit search | |
$Lversion = php_uname(r); | |
$OSV = php_uname(s); | |
if(eregi('Linux',$OSV)) | |
{ | |
$Lversion=substr($Lversion,0,6); | |
$millink="http://milw0rm.com/search.php?dong=Linux Kernel ".$Lversion; | |
$stormlink="http://www2.packetstormsecurity.org/cgi-bin/search/search.cgi?searchvalue=Linux+Kernel+".$Lversion; |