Skip to content

Instantly share code, notes, and snippets.

View kcowgill's full-sized avatar

Kent Cowgill kcowgill

View GitHub Profile
#!/bin/bash
for FILE in `ls *.tgz`; do
echo "Unzipping '$FILE'"
tar xzf $FILE
cd package/
echo "Checking for old repo..."
perl -pi -e 's/https.*/http:\/\/new.repository\/repository\/custom-npm\/"/ if m/registry.*https:\/\/package/' package.json
echo "Uploading to new repo..."
npm publish --registry=http://new.repository/repository/custom-npm/
# DDPClient from here: https://github.com/hharnisc/python-ddp
from DDPClient import DDPClient
import hashlib
import time
# these are callbacks
def show_data(data, *more):
print("Data received: '{}':'{}'".format(data, more))
def received_message(data):
@kcowgill
kcowgill / mirror_cheater.sh
Created May 6, 2013 16:30
Shell script for mirroring rubygems.org. Forcibly downloads quick/Marshal.4.8/${GEM}spec.rz, and all the indices (to prevent having to attempt (and subsequently fail - we just can't make it work) to generate_index ourselves). N.B. $MIRRORSCRIPT refers to a ruby script to fetch new gems similar to the script located at the following URL: http://h…
#!/bin/bash
# define $SHELL_VARS here
report_error () {
MESSAGE=$1
SUBJECT=$2
echo "$MESSAGE" | $MAILPROGRAM --subject="$SUBJECT" --toList=$EMAIL
}
@kcowgill
kcowgill / gist:4286863
Created December 14, 2012 16:52
Hack to make Email::Sender::Transport::SMTP use Net::SMTP_auth instead of Net::SMTP (to support NTLM authentication)
diff --git a/SMTP_old.pm b/SMTP.pm
index 23b508e..4f6f35d 100644
--- a/SMTP_old.pm
+++ b/SMTP.pm
@@ -49,12 +49,12 @@ sub _quoteaddr {
sub _smtp_client {
my ($self) = @_;
- my $class = "Net::SMTP";
+ my $class = "Net::SMTP_auth";