Skip to main content

Posts

An ingenious way to find Java on POSIX systems

This is Perl code. _java_bin returns the full path to the java executable. From http://search.cpan.org/~dolmen/DateTime-TimeZone-HPUX-1.04/lib/DateTime/TimeZone/HPUX.pm our @JAVA_HOMES = ( '/opt/java1.4', ); { my $_java_bin; sub _java_bin { return $_java_bin if defined $_java_bin; $_java_bin = ''; # Default value: java not found (false) foreach ( (map { ("$_/jre/bin/java", "$_/bin/java") } (exists $ENV{JAVA_HOME} ? ($ENV{JAVA_HOME}) : ()), @JAVA_HOMES, ), (map { "$_/java" } split(/:/, $ENV{PATH}) ), ) { next unless -x "$_"; $_java_bin = $_; last; } return $_java_bin; } }

Find the 10 largest directories on POSIX

This script outputs the number of 1,024 byte blocks consumed by each of the 10 largest directories in the provided directory, or in the current directory if no arguments are provided. From: Warren Young Date: Wed, 30 Jan 2013 21:08:33 -0700 "This script helps me find the 10 biggest pigs on any system with a basic POSIX user environment." #!/bin/sh if [ $# -eq 0 ] then     dir=. else     if [ ! -d $1 ]     then         echo usage: $0 [directory] [options]         echo         echo "  Prints kb in use in directory; if directory isn't"         echo "  given, '.' is assumed."         echo         echo "  If you give options, they are passed to du, in addition"         echo "  to the -sk options the script provides."         echo    ...

The Software Project Lifecycle

All projects follow the same lifecycle pattern, or theme. What varies from project to project is the amount of time between stages. Embryonic projects consist of presentations, problem statements, solutions, Slack workspaces, and other forms of optimism. We can do this! Infant projects consist of proof of concept prototypes built by at most three developers. There is no error handling. Baby projects have a source code repository and programming guidelines. It might be possible to run it on your own laptop. Fat chance. Toddler projects have automated builds and unit tests. They “go live,” always too soon. Tween projects have bug tracking systems. Users are unpaid testers. Teenage projects have a release candidate that evolves, usually much longer than anyone expects, into the sacred “one dot oh.” Most projects fail during this stage due to infighting or insufficient funds. The teenager ages into adulthood via 1.0 patch releases and then eventually into 2.0. Quality and revenue a...