Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use Benchmark qw(:hireswallclock timethese);
use Test::MockObject;
use FindBin::libs;
use HTTP::Router::Declare;
my $router = router {
@masaki
masaki / gist:103040
Created April 28, 2009 09:17
gitosis
# install
cd /tmp
wget http://download.fedora.redhat.com/pub/epel/5/SRPMS/gitosis-0.2-6.20080825git.el5.src.rpm
rpm2cpio gitosis-0.2-6.20080825git.el5.src.rpm | cpio -i gitosis-0.2.tar.gz
tar zxvf gitosis-0.2.tar.gz
cd gitosis-0.2
./setup.py build
sudo ./steup.py install
# post-install
@masaki
masaki / etc_xinetd.d_git-daemon
Created May 8, 2009 09:18
git-daemon w/ xinetd
# default: off
# description: The git daemon allows git repositories to be exported using the git:// protocol.
service git
{
disable = no
type = UNLISTED
port = 9418
socket_type = stream
wait = no
@masaki
masaki / python-urllib-noproxy.patch
Created May 21, 2009 12:31
yum enable NO_PROXY (proxy=_none_)
diff --git a/urllib.py b/urllib.py
index 802d9b7..d13ddb7 100644
--- a/urllib.py
+++ b/urllib.py
@@ -35,7 +35,7 @@ __all__ = ["urlopen", "URLopener", "FancyURLopener", "urlretrieve",
"localhost", "thishost", "ftperrors", "basejoin", "unwrap",
"splittype", "splithost", "splituser", "splitpasswd", "splitport",
"splitnport", "splitquery", "splitattr", "splitvalue",
- "splitgophertype", "getproxies"]
+ "splitgophertype", "getproxies", "getnoproxies"]
Autotest.add_hook :initialize do |at|
# Version Control
%w[ .svn .git .hg ].each { |exception| at.add_exception(exception) }
# Temporary files
%w[ \.DS_Store #$ ].each { |exception| at.add_exception(%r%#{exception}%) }
# Rails
%w[ log tmp vendor db ].each { |exception| at.add_exception(exception) }
# Reporting
%w[ coverage ].each { |exception| at.add_exception(exception) }
%w[ spec/.+\.opts spec/.+\.html ].each { |exception| at.add_exception(%r%#{exception}%) }
--colour
--format specdoc
--format html:spec/spec_report.html
--loadby mtime
--reverse
--drb
@masaki
masaki / gist:155454
Created July 26, 2009 07:22
rewrite selenium-server.jar enable browser version
gem install webrat -v=0.4.4
# webrat-0.4.4 is not compatible with selenium-client-1.2.15 or higher.
gem install selenium-client -v=1.2.14
cd $GEM_HOME/gems/webrat-0.4.4/vendor
jar xf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/readystate\@openqa.org/install.rdf
jar xf selenium-server.jar \
customProfileDirCUSTFFCHROME/extensions/\{538F0036-F358-4f84-A764-89FB437166B4\}/install.rdf
@masaki
masaki / gist:155854
Created July 26, 2009 16:26
authentication w/ ActiveLdap
#!/usr/bin/env ruby
require 'rubygems'
require 'active_ldap'
ActiveLdap::Base.setup_connection(
:host => 'ldap.example.com',
:base => 'dc=example,dc=com',
)
@masaki
masaki / rubygems-remote_fetcher-no_proxy.patch
Created July 28, 2009 10:29
RubyGems with HTTP_PROXY/NO_PROXY
--- rubygems/remote_fetcher.rb.orig 2009-07-28 19:01:30.000000000 +0900
+++ rubygems/remote_fetcher.rb 2009-07-28 19:05:47.000000000 +0900
@@ -4,6 +4,7 @@
require 'uri'
require 'rubygems'
+require 'http_configuration'
##
# RemoteFetcher handles the details of fetching gems and gem information from
@masaki
masaki / gist:157123
Created July 28, 2009 11:03
configatron
# -*- coding: utf-8 -*-
# config/initializers/configatron.rb
configatron.configure_from_yaml("#{RAILS_ROOT}/config/configatron.yml", :hash => Rails.env)