Skip to content

Instantly share code, notes, and snippets.

View holybit's full-sized avatar

Joseph Crotty holybit

View GitHub Profile
@holybit
holybit / env.sh
Created February 28, 2012 21:19
perl distributions
#!/bin/sh
# Passed a perlbrew perl it will setup the environment
# e.g. ./env.sh perl-5.12.4
# By Perl convention the first three components are named 'revision', 'version'
# and 'subversion'. local::lib will use the 'version' to set the perl library
# path
# TODO
# ----
@holybit
holybit / gist:3872766
Created October 11, 2012 14:30
why is the value of FOO : and not foo2:bar1?
$ cat /tmp/try.txt
export FOO=foo1
export BAR=bar1
export FOO=foo2
export FOO=${FOO}:${BAR}
$ eval $(cat /tmp/try.txt)
$ echo $FOO
:
@holybit
holybit / gist:4280559
Created December 13, 2012 22:15
Perl app questions
Have 2-3 perl modules in a lib dir at the top level of a git repo along with a bin dir and some other application dirs. The entire dir structure below exists in dev and is delivered to other target envs - tst and prd.
$ ls
lib/
bin/
t/
conf/
build/
app/darkpan
app/perl5
@holybit
holybit / gist:4532051
Last active December 11, 2015 02:39
kafka-0.7.2 sbt remote build problem
[kafka@poma00 kafka-0.7.2]$ whoami
kafka
[kafka@poma00 kafka-0.7.2]$ pwd
/usr/local/kafka-0.7.2
[kafka@poma00 kafka-0.7.2]$ ./sbt update
Getting Scala 2.7.7 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-lang#scala-compiler;2.7.7
@holybit
holybit / .gitignore
Created June 7, 2013 21:30
Putting my shell config files into a git repo. Repo is in my home directory. Want to ignore everything but a few files. Files in .ssh/ giving me trouble. Can't seem to figure out how to ignore knows hosts and a few others. Ideas?
# Ignore everything
/*
# But not these files...
!/.*alias
!/.bashrc*
!/.perltidyrc
!/.func
!/.pcmrc
@holybit
holybit / gist:6003994
Last active December 19, 2015 19:09
Goal: Use Dist::Zilla to create a Task:: dist that will install only the applications Prereqs and not install the actual application code - for example files in foo/bin/*.pl and foo/lib/*.pm
The below yeilds a Task::RP::Foo that does contain the application code in Foo/bin and Foo/lib. How to elimiate the lib and bin dirs and their files from the dist and still get AutoPrereqs?
name = Task-RP-Foo
author = Joe Crotty <[email protected]>
license = None
copyright_holder = Return Path, Inc.
copyright_year = 2013
version = 1.4
@holybit
holybit / gist:6301499
Last active December 21, 2015 11:49
Carton - Test 'carton install' and 'carton bundle'. Results seem to indicate that the carton exectuable installed to vendor/bin is not properly fat packed.
# clean shell for Perl vars
$ perl -V:version
version='5.14.3';
$ which perl
perl is /usr/local/perlbrew/perls/perl-5.14.3/bin/perl
$ env | grep PERL
PERLBREW_VERSION=0.64
PERLBREW_PERL=perl-5.14.3
PERLBREW_BASHRC_VERSION=0.64
@holybit
holybit / gist:6394765
Last active December 22, 2015 01:09
New tmux session to split window into two panes. Want to set TERM=screen-256color on both panes, but the script only sets it on pane :1 and not also pane :0. I am trying to use sync panes, but not seeming to work.
txsi() {
local session=foo
tmux new-session -d -s "$session"
tmux select-window -t "$session":0
tmux split-window -h
tmxu select-pane -t 0
tmux synchronize-panes on
tmux send-keys "export TERM=screen-256color" C-m
tmux synchronize-panes off
@holybit
holybit / gist:6516263
Created September 10, 2013 21:53
Carton on 5.10.1 CentOS w/out package perl-core.x86_64 installed. Module::CoreList is part of perl-core.x86_64. Notice, Module::CoreList is required by App-scan_prereqs_cpanfile, however it never gets installed to local/. Not sure why, my guess is Carton thinks Module::Corelist should have been in core perl even though it's not. Where does carto…
$ cat cpanfile
requires 'perl', '5.10.1';
requires 'DBI';
requires 'DateTime';
requires 'DateTime::Format::Strptime';
requires 'Digest::MD5';
requires 'Encode';
requires 'File::Find::Rule';
requires 'Getopt::Long';
requires 'JSON';
@holybit
holybit / gist:6632973
Last active December 23, 2015 12:09
Perl rpm for CentOS 6.x. Perl was installed to /opt/perls/perl-5.16.3 in this case. The script below uses fpm and the -C option so I can have a my Perl in /opt/perls and at the same time build the rpm and then `yum install` it to /usr/local/perls. The problem I am running into is once Perl is installed into /usr/local/perls/perl-15.16.3/bin/perl…
$ cat ./fpm-perl-5.16.3
#!/bin/env bash
# Note, this will build a Perl RPM based on what's in /opt/perls/perl-$VERSION
# and package it for install to /usr/local/perls.
VERSION="5.16.3"
ITER=1
fpm -s dir -t rpm\