diff --git a/bin/nopaste.pl b/bin/nopaste.pl new file mode 100755 index 0000000..7ff637b --- /dev/null +++ b/bin/nopaste.pl @@ -0,0 +1,85 @@ +#!/usr/bin/env perl -w + +# Copyright (C) 2008, Parrot Foundation. +# $Id: nopaste.pl 38612 2009-05-08 18:30:25Z Infinoid $ + +use 5.008; +use strict; +use warnings; + +use WWW::Mechanize; +use Getopt::Std; +use Pod::Usage; +use Data::Dumper; + +my $server = 'nopaste.snit.ch'; +my $url = "http://$server:8001/paste"; +my $opt = { + c => '#parrot', # channel + n => 'dukeleto', + t => undef, # title +}; + +getopt( 'c:n:t:', $opt ); + +pod2usage(2) unless defined $opt->{t}; + + +my $text; while(<>) { $text .= $_; } +my $mech = WWW::Mechanize->new( + cookie_jar => undef, + autocheck => 1, +); + +$mech->get( $url ); + +$mech->submit_form( + form_name => 'pasteForm', + fields => { + (defined $opt->{c} ? + (channel => $opt->{c}) : + () + ), + nick => $opt->{n}, + summary => $opt->{t}, + paste => $text, + }, + button => 'Paste it', +); + +my @link = $mech->links; +print "Your paste can be found at ", $link[0]->url, "\n"; + + +=head1 NAME + +tools/dev/nopaste.pl - paste the contents of a file via a pastebot server + +=head1 SYNOPSIS + + nopaste.pl -t "TITLE" [ -c CHANNEL ] [ -n NAME ] [ FILENAME ] + + TITLE the title of the paste + CHANNEL the irc channel (defaults to #parrot) + NAME the username (defaults to username or 'someone') + FILENAME the name of the file to paste (defaults to STDIN) + +=head1 DESCRIPTION + +This program can be used to paste the contents of a file on a pastebot server +-- specifically, B -- for immediate linkage on an IRC channel -- +by default, B<#parrot>. + +=head1 AUTHOR + +Originally written by particle, with subsequent contributions to functionality +by LimbicRegion, paultcochrane and cotto. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: diff --git a/config/.bashrc b/config/.bashrc index b22286b..e3fcbd1 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -4,7 +4,7 @@ export DYLD_LIBRARY_PATH=/usr/local/lib # This is ... madness. #export PERL5LIB="/opt/local/lib/perl5/5.10.0/darwin-2level/: #export PERL5LIB="/opt/local/lib/perl5/site_perl/5.8.8:/Library/Perl/5.8.8" -export PERL5LIB=/opt/local/lib/perl5/site_perl/5.10.0:/opt/local/lib/perl5/site_perl/5.8.8:/Library/Perl/5.8.8 +#export PERL5LIB=/opt/local/lib/perl5/site_perl/5.10.0:/opt/local/lib/perl5/site_perl/5.8.8:/Library/Perl/5.8.8 #export PERL5LIB=/opt/local/lib/perl5/site_perl/5.10.0:/opt/local/lib/perl5/site_perl/5.8.8 export PERL_MM_USE_DEFAULT=1 export TEST_JOBS=9 @@ -56,7 +56,7 @@ if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi -export PATH=/sbin:/bin:/usr/sbin:/opt/local/sbin:/usr/bin:/usr/games:/opt/bin:/opt/local/bin:/usr/local/sbin:~/bin:/usr/local/bin:/usr/X11R6/bin:/opt/local/lib/postgresql83/bin/ +export PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/opt/local/sbin:/usr/bin:/usr/games:/opt/bin:/opt/local/bin:/usr/local/sbin:~/bin:/usr/X11R6/bin:/opt/local/lib/postgresql83/bin/ export bgcolor=black export C1='' export C2='' diff --git a/config/.bashrc.aliases b/config/.bashrc.aliases index dbbdd33..292e6ed 100644 --- a/config/.bashrc.aliases +++ b/config/.bashrc.aliases @@ -29,6 +29,13 @@ parrot_svn_ps() { svn ps svn:eol-style native $1 } +parrot_git_svn_ps() { + git svn ps svn:mime-type 'text/plain' $1 + git svn ps svn:keywords "Author Date Id Revision" $1 + git svn ps svn:eol-style native $1 +} + + # by Aaron "H-Bomb" Harsh ..to () { cd `pwd | perl -pe "s[(.*/[^/]*$1[^/]*/).*][\\1/]"` @@ -43,7 +50,11 @@ function t () { ./Build test --verbose 1 --test_files $1 |colortest } function modversion () { - perl5.10 -M$1 -le "print $1->VERSION" + perl -M$1 -le "print $1->VERSION" +} + +function grh () { + git rebase -i head~$1 } alias rot13="perl -pe 'y/a-zA-Z/n-za-mN-ZA-M/'" @@ -54,6 +65,7 @@ alias glg="git log --graph --pretty=oneline" alias grc="git rebase --continue" alias glp="git log -p" alias githist="git log -p" + alias undo="git reset HEAD^" alias gd="git diff --cached -a --diff-filter=ACDTMR" alias gdc="git diff --diff-filter=ACDTMR" @@ -79,8 +91,8 @@ alias gPm="git push origin master" alias prove="prove-5.10" alias p6topir="~/git/rakudo/perl6 --target=pir" alias p="perl5.10 -d -e0" -alias perl=perl5.10 -alias perldoc=perldoc-5.10 +#alias perl=perl5.10 +#alias perldoc=perldoc-5.10 alias perl_list_modules="perl -MCPAN -e 'CPAN::Shell->r'" alias pdF="perldoc -F" alias jpg_resize_all='for i in `ls`; do jpg_resize $i; done'