December 2005
Monthly Archive
Fri 23 Dec 2005
Posted by Jonathan Adjei under
LAMP ,
MythTVNo Comments
In mythtv-setup under ‘Input connections’ (or something) type
/home/mythtv/.mythtv/sendkeys.sh
Then create this sendkeys.sh script in the directory mentioned above.
#!/bin/sh
for digit in $(echo $1 | sed -e 's/./& /g'); do
red_eye /dev/ttyS0 $digit 2
sleep 0.4
done
Decided this works better…
#!/bin/csh
echo "changing to $1"
/usr/local/bin/red_eye /dev/ttyS0 $1 2 &
Place the red_eye c program from
http://redremote.co.uk/serial/resdown.html
in /usr/bin or similar and you’re done.
Fri 9 Dec 2005
Posted by Jonathan Adjei under
LAMPNo Comments
This first script will list the perl modules you have installed and the version number.
#!/usr/bin/perl
#
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
This 2nd will uninstall a perl module by passing it the module name.
i.e.
./filename.pl Mail::Bulkmail
#!/usr/bin/perl -w
use ExtUtils::Packlist;
use ExtUtils::Installed;
#
$ARGV[0] or die “Usage: $0 Module::Name\n”;
#
my $mod = $ARGV[0];
#
my $inst = ExtUtils::Installed->new();
#
foreach my $item (sort($inst->files($mod))) {
print “removing $item\n”;
unlink $item;
}
#
my $packfile = $inst->packlist($mod)->packlist_file();
print “removing $packfile\n”;
unlink $packfile;
Fri 9 Dec 2005
Posted by Jonathan Adjei under
LAMP1 Comment
This chunk of code will show you a nice list of ports on which you have something listening.
#!/bin/sh
# listen - parse netstat -an output for listeners
netstat -an | awk '
BEGIN {
printf("%12s\t%5s\t%5s\n", "ADDRESS", "PROT", "PORT#")
printf("%12s\t%5s\t%5s\n", "-------", "----", "-----")
}
/ LISTEN / {
split($4,ip,":")
printf("%12s\t%5s\t%5s\n", ip[1], $1, ip[2])
}
‘
Thu 1 Dec 2005
Posted by Jonathan Adjei under
GeneralNo Comments
This blog comes highly recommended, and this article in particular struck home with most aspects of my business life.
There are others out there!
Full-time freelancing: 10 things learned in 180 days ~ Authentic Boredom