I have some general ideas about useful hobby-type applications of computers; in this case FreeBSD, but they could be applied to any system.
Bookbinding; texlive, mupdf, perl/python/shell scripts, etc can be used to automate book signatures from archive.org, books.google.com pdf books. These can be used with cotton-rag paper to assemble handmade books.
Inkjet printers can be used to print out giclee paintings/photographs on canvas, etc. They also can print on wax paper, which is then used to create painted style signs on wood, metal, etc [with a heatgun/hair-dryer].
Make a script that reads through a folder tree and prints out the contents of text files to the terminal.
Now login to the system from an ssh app on a tablet in the kitchen. Recipes on demand.
{I just learned perl, pardon me if it looks rather amature}
Bookbinding; texlive, mupdf, perl/python/shell scripts, etc can be used to automate book signatures from archive.org, books.google.com pdf books. These can be used with cotton-rag paper to assemble handmade books.
Inkjet printers can be used to print out giclee paintings/photographs on canvas, etc. They also can print on wax paper, which is then used to create painted style signs on wood, metal, etc [with a heatgun/hair-dryer].
Make a script that reads through a folder tree and prints out the contents of text files to the terminal.
Now login to the system from an ssh app on a tablet in the kitchen. Recipes on demand.
{I just learned perl, pardon me if it looks rather amature}
Perl:
#!/usr/local/bin/perl -w
#Uses the Switch module [switch statements are not built into perl before v6 (v6 also uses different syntax)]
#Uses the Scalar::Util module.
use Switch;
use Scalar::Util qw(looks_like_number);
$DIR_var = "/home/myname/Documents/Recipes/";
$Acrobat = "okular"; #Uses the okular pdf viewer, change if need be.
@list_array = &list_dir($DIR_var,$arraySize);
print "Directory Number ('q' to exit,'r' to relist): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; }
}elsif(($key eq 'r') != 1){exit();}
$depth = 0;
#If $key is a number greater than 0 OR If $key is not a number and is either 'r' or 'u' keep looping.
while(looks_like_number($key) ? $key>0:($key eq 'r' || $key eq 'u')){
switch($depth){
case 0 {
if($key eq 'r'){#relisting the top directory
undef @list_array;
@list_array = &list_dir($DIR_var,$arraySize);
print "Directory Number ('q' to exit,'r' to relist): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; }
}elsif($key eq 'u'){exit();} #We only want it to loop with an 'r' if not a number here.
}else{#changes into sub directory
$NewDir = $list_array[$key];
undef @list_array;
@list_array = &list_dir("$DIR_var$NewDir/",$arraySize);
$depth++;
print "Recipe Number ('q' to exit,'r' to relist,'u' to go up one directory): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; }
}
}
}
case 1 {
if($key eq 'r'){#relisting sub directory
undef @list_array;
@list_array = &list_dir("$DIR_var$NewDir/",$arraySize);
print "Recipe Number ('q' to exit,'r' to relist,'u' to go up one directory): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; }
}
}elsif($key eq 'u'){#changes into the top directory
undef @list_array;
@list_array = &list_dir($DIR_var,$arraySize);
$depth--;
print "Directory Number ('q' to exit,'r' to relist): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; $depth++; }
}elsif($key eq 'u'){exit();}#We only want it to loop with an 'r' if not a number here.
}elsif (looks_like_number($key)){#print contents of the file
print "==============================================\n";
print " $list_array[$key]\n";
print "==============================================\n";
if(index ($list_array[$key], '.pdf') != -1){
system("\"$Acrobat\" \"$list_array[$key]\"");
}else{
system("cat \"$list_array[$key]\"");
print "==============================================\n";
}
print "Recipe Number ('q' to exit,'r' to relist,'u' to go up one directory): ";
$key = <STDIN>;
chomp $key;
if (looks_like_number($key)){
if ($key >= $arraySize){ print "Index Out of Bounds\n-------------------\n"; $key = 'r'; }
}
}
}
}
}
sub list_dir{#Takes in the directory path and arraySize, prints the directory, returns an array of strings of the contents of the directory.
#returns the arraySize by reference
chdir( $_[0] ) or die "Couldn't go inside $_[0] directory, $!";
opendir (DIR, '.') or die "Couldn't open directory, $!";
$_[1] = 1;
my @files = sort { lc($a) cmp lc ($b) } readdir(DIR); #Sort alpha order [conv to lc first].
while ( my $file = shift @files) { #cycle through the array
if(index ($file, '.') == -1 || index ($file, '.pdf') != -1){#There is no period in the filename [no file extension] or the filename includes a .pdf
if ($_[1] < 10){
print " $_[1] $file\n";
}elsif($_[1] < 100){
print " $_[1] $file\n";
}elsif($_[1] < 1000){
print " $_[1] $file\n";
}else{
print "$_[1] $file\n";
}
$array[$_[1]] = $file;
$_[1]++;
}
}
closedir DIR;
return @array;
}