Saturday, May 26, 2007

LooxLight & GoodWavPower

Minor update of utilities for PDA Fujitsu Siemens C550/N560.

Here is the new LooxLight version (2007-05-26). You may try it if you are enough annoyed with this message:
Error while starting: Return status 2 of ReqQueryValueEx
for hnd indicates error
lasterror=0
lasterror=0


Here is the new GoodWavPower version (2007-05-26). Message 'GoodWavPower: error play sound' is simply disabled.

New versions and latest news about LooxLight will be published right here.
Check for GoodWavPower updates here.

Recovering of Encfs Password

Whew. I've found all forgotten passwords for encfs with a help of the perl script:


#!/usr/bin/perl

use strict;
use warnings;

# these words are used as password components
my @words = (
"example", " ", "word", "123", "666", "pwd", "part1"
);

my @l = ();

sub mindex {
my $x = shift;

for (my $i = 0; $i <= $#words; $i++) {
if ($words[$i] eq $x) {
return $i;
}
}

return -1;
};

sub inc {
my $p = shift;
my $v = $l[$p];

unless (defined $v) {
$l[$p] = $words[0];
} else {
my $i = mindex ($v);
if ($i == $#words) {
$l[$p] = $words[0];
inc ($p+1);
} else {
$l[$p] = $words[$i+1];
}
}
};

while (1) {
inc (0);
my @ll = reverse @l;
my $pwd = join '', @ll;

open F, ">/tmp/1233";
print F "pwd\n";
close F;

print "$pwd\n";
system "encfs -S /tmp/encfsdir /tmp/mountpoint < /tmp/1233";
}


You may use it if you still know a vague shape of password you have lost.

Friday, May 18, 2007

Combinations

It seems to be simple, but it took me two hours to write this function. And now I know the true nature of things!
combr :: [[a]] -> [[a]]
combr [l] = map (\x -> [x]) l
combr (l : tl) = concat $ map (\ll -> map (:ll) l) $ combr tl

print $ combr [[1,2], [3,4], [5,6,7]]

[[1,3,5],[2,3,5],[1,4,5],[2,4,5],[1,3,6],[2,3,6],[1,4,6],
[2,4,6],[1,3,7],[2,3,7],[1,4,7],[2,4,7]]