Skip to content

Instantly share code, notes, and snippets.

Arthur Schreiber arthurschreiber

Block or report user

Report or block arthurschreiber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.js
'use strict';
var net = require('net');
var http = require("http");
var count = 0;
var server = http.createServer(function(req, res) {
var id = res.id = count++;
View .md

You can "force" commands to be run on a login for a specific user in ~/.ssh/authorized_keys

To always run the /home/deployuser/deploy.sh command:


command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1JnkxQDucKWOAD8QsmAVlXT0trq/QmtKeGkL+a6QUvctKBpe8qLuYUyGEgn+GvGwP9IqDZPYXBP0andFvim+40QKworx9oALuIei5rIWM3fCIbY0lTdM6gZVgTdYBNryW5axeuwsXjuT/i5lE+lA1JxQ5LjTq7n5gbT8tus4FbHySSkmrWmoz9rh8m9bULnmGquDQw6+xCbPFteVUhEDRsCsmlUldLMatMDuQ5hnhz0mKU41sqs+EPtmYh6pG/ofpyURMsR7/C/Rf1/i6AB9Mb3WqQOGE2x3cj+sj0vILiuHsnEx32qpNDvqrE+scRjcRsKIiaTSD4jqO9Mws5Ob7w==

command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding" <jenkins pub>
command="DEPLOY_USER='arthur.schreiber@hp.com' /home/deploy/deploy.sh $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port
View gist:9011609
require 'rugged'
repo = Rugged::Repository.init_at('./test-repo')
index = repo.index
base_commit_options = {
author: { name: "Matt", email: "matt@test.com" },
committer: { name: "Matt", email: "matt@test.com" },
update_ref: 'HEAD'
View test.rb
$:.unshift File.expand_path("../lib", __FILE__)
require 'rugged'
repo = Rugged::Repository.init_at('./test-repo')
index = repo.index
base_commit_options = {
author: { name: "Matt", email: "matt@test.com" },
View gist:8538997
exec { "download redis-${version}":
command => "wget --output-document redis-${version}.tar.gz https://github.com/antirez/redis/archive/${version}.tar.gz",
cwd => '/usr/local/src',
path => ['/bin', '/usr/bin'],
creates => "/usr/local/src/redis-${version}.tar.gz",
} -> exec { "extract redis-${version}":
command => "tar xfz redis-${version}.tar.gz",
cwd => '/usr/local/src',
path => ['/bin', '/usr/bin'],
creates => "/usr/local/src/redis-${version}",
View gist:6366401
package require "TclOO"
oo::class create oss::class {
superclass oo::class
constructor { args } {
oo::class create [self].Meta
next {*}$args
View gist:6125077
Arthurs-iMac-2:rugged arthur$ bin/rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0
make -f Makefile.embed clean
rm -f src/attr.o src/attr_file.o src/blob.o src/branch.o src/buf_text.o src/buffer.o src/cache.o src/checkout.o src/clone.o src/commit.o src/commit_list.o src/compress.o src/config.o src/config_cache.o src/config_file.o src/crlf.o src/date.o src/delta-apply.o src/delta.o src/diff.o src/diff_driver.o src/diff_file.o src/diff_patch.o src/diff_print.o src/diff_tform.o src/diff_xdiff.o src/errors.o src/fetch.o src/fetchhead.o src/filebuf.o src/fileops.o src/filter.o src/fnmatch.o src/global.o src/graph.o src/hash.o src/hashsig.o src/ignore.o src/index.o src/indexer.o src/iterator.o src/merge.o src/merge_file.o src/message.o src/mwindow.o src/netops.o src/notes.o src/object.o src/object_api.o src/odb.o src/odb_loose.o src/odb_pack.o src/oid.o src/pack-objects.o src/pack.o src/path.o src/pathspec.o src/pool.o src/posix.o src/pqueue.o src/push.o src/refdb.o src/refdb_fs.o src/reflog.o src/refs.o src/refsp
View gist:6125074
Arthurs-iMac-2:rugged arthur$ bin/rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0
make -f Makefile.embed clean
rm -f src/attr.o src/attr_file.o src/blob.o src/branch.o src/buf_text.o src/buffer.o src/cache.o src/checkout.o src/clone.o src/commit.o src/commit_list.o src/compress.o src/config.o src/config_cache.o src/config_file.o src/crlf.o src/date.o src/delta-apply.o src/delta.o src/diff.o src/diff_driver.o src/diff_file.o src/diff_patch.o src/diff_print.o src/diff_tform.o src/diff_xdiff.o src/errors.o src/fetch.o src/fetchhead.o src/filebuf.o src/fileops.o src/filter.o src/fnmatch.o src/global.o src/graph.o src/hash.o src/hashsig.o src/ignore.o src/index.o src/indexer.o src/iterator.o src/merge.o src/merge_file.o src/message.o src/mwindow.o src/netops.o src/notes.o src/object.o src/object_api.o src/odb.o src/odb_loose.o src/odb_pack.o src/oid.o src/pack-objects.o src/pack.o src/path.o src/pathspec.o src/pool.o src/posix.o src/pqueue.o src/push.o src/refdb.o src/refdb_fs.o src/reflog.o src/refs.o src/refsp
View gist:5653887
$:.unshift File.join(File.dirname(__FILE__), "lib")
require "rugged"
repo = Rugged::Repository.new(".")
10000000.times do
begin
Rugged::Reference.each(repo) do |ref|
raise "fail"
end
View gist:5348266
class RepositoryThreadedPushTest < Rugged::SandboxedTestCase
def setup
super
sandbox_init("testrepo.git")
@repos = (1..10).collect do |i|
sandbox_clone("testrepo.git", "testrepo#{i}.git").tap { |r| r.config['core.bare'] = true }
sandbox_clone("testrepo#{i}.git", "testrepo#{i}")
end
You can’t perform that action at this time.