This file contains 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
#!/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 |
This file contains 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 'connection_pool' | |
class ReactRenderer | |
mattr_accessor :pool | |
def self.setup! | |
size = ::Rails.configuration.react.max_renderers || 10 | |
timeout = ::Rails.configuration.react.renderer_timeout || 20 #seconds | |
@@pool ||= ConnectionPool.new(:size => size, :timeout => timeout) { ReactRenderer.new } |
This file contains 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
# widget#custom_css is a string containing CSS or SCSS code | |
def custom_css | |
respond_to do |format| | |
format.css { | |
# I cant believe there isnt a better way to just compile a sass string. Sheesh. | |
sprockets_env = Rails.application.assets | |
opts = sprockets_env.context_class.sass_config | |
ctx = sprockets_env.context_class.new(sprockets_env, "inmemory", Pathname(sprockets_env.root+"/app/assets/stylesheets")) | |
opts = opts.merge( :syntax => :scss, | |
:load_paths => [Rails.root.join("app/assets/stylesheets")], |
This file contains 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
import javax.xml.crypto.*; | |
import javax.xml.crypto.dsig.*; | |
import javax.xml.crypto.dom.*; | |
import javax.xml.crypto.dsig.dom.DOMValidateContext; | |
import javax.xml.crypto.dsig.keyinfo.*; | |
import java.io.FileInputStream; | |
import java.security.*; | |
import java.security.cert.*; | |
import java.util.Collections; | |
import java.util.Iterator; |
This file contains 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
# Shim for running Torquebox apps under MRI Ruby | |
# http://www.rigelgroupllc.com/blog/2013/01/28/torquebox-shims-for-mri/ | |
if ENV["INSIDE_TORQUEBOX"] == "true" | |
Rails.logger.info "[TorqueBoxInitializer] Inside TorqueBox" | |
else | |
Rails.logger.info "[TorqueBoxInitializer] NOT inside Torquebox, shimming TB functions..." | |
module TorqueBox | |
module Messaging | |
class MessageProcessor | |
attr_accessor :message |
This file contains 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
server.log.2012-12-13:09:11:48,360 sso_token:$6$uZVjf/PkecNFitqhPF+8yVaam9WQI9vanwSCSpFAeX4h/BHaQ=;$6$ZOrZJ/DHoZBC3gyX7QnLI1hxn6bsRydMH3TsNKotAEHxEPYycR5Hnk4mkJul/X8Y0VWUHNlmIKaMN2Xw2WogsxcLSUVg== | |
server.log.2012-12-13:09:11:50,315 sso_token:$6$uZVjf/PkecNFitqhPF+8yVaam9WQI9vanwSCSpFAeX4h/BHaQ=;$6$ZOrZJ/DHoZBC3gyX7QnLI1hxn6bsRydMH3TsNKotAEHxEPYycR5Hnk4mkJul/X8Y0VWUHNlmIKaMN2Xw2WogsxcLSUVg== | |
server.log.2012-12-13:09:11:50,942 sso_token:$6$uZVjf/PkecNFitqhPF+8yVaam9WQI9vanwSCSpFAeX4h/BHaQ=;$6$ZOrZJ/DHoZBC3gyX7QnLI1hxn6bsRydMH3TsNKotAEHxEPYycR5Hnk4mkJul/X8Y0VWUHNlmIKaMN2Xw2WogsxcLSUVg== | |
server.log.2012-12-13:09:11:51,560 sso_token:$6$uZVjf/PkecNFitqhPF+8yVaam9WQI9vanwSCSpFAeX4h/BHaQ=;$6$ZOrZJ/DHoZBC3gyX7QnLI1hxn6bsRydMH3TsNKotAEHxEPYycR5Hnk4mkJul/X8Y0VWUHNlmIKaMN2Xw2WogsxcLSUVg== | |
server.log.2012-12-13:09:11:52,388 sso_token:$6$uZVjf/PkecNFitqhPF+8yVaam9WQI9vanwSCSpFAeX4h/BHaQ=;$6$ZOrZJ/DHoZBC3gyX7QnLI1hxn6bsRydMH3TsNKotAEHxEPYycR5Hnk4mkJul/X8Y0VWUHNlmIKaMN2Xw2WogsxcLSUVg== | |
server.log.2012-12-13:09:11:53,748 |
This file contains 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
console.log "Working" |
This file contains 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
def after_create(model) | |
orig_tenant = (Tenant.current rescue Kexception::TenantNotFoundError) | |
Tenant.current = model.tenant | |
... | |
ensure | |
Tenant.current = orig_tenant | |
end |
This file contains 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
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
# Are you tired of not having your ~/.bash* stuff work the way you expect? | |
# | |
# Symlink all of the following to this file: | |
# * ~/.bashrc |
This file contains 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 'parallel' # gem install parallel (https://github.com/grosser/parallel) | |
# Monkey patch to Sprockets::StaticCompiler, a class provided by actionpack | |
# that's used by the assets:precompile task. This patch uses the Parallel gem | |
# to parallelize asset compilation in the simplest way possible. | |
# | |
# Parallel wraps Process.fork to handle things like inter-process communication | |
# via pipes and determining the maximum number of processes to run based on | |
# your system's total logical processors. So far only tested on MRI 1.9.3 on OS X. | |
module Sprockets |