Compare commits

...

2 Commits

3 changed files with 51 additions and 4 deletions

View File

@ -1 +1,2 @@
*.json
*.json
*.json.[0-9]*

View File

@ -13,15 +13,29 @@ my $URL_PREFIX;
my $FN;
my $OUT_DIR;
my $USAGE;
my $ACMD;
my %jh;
my @a1;
$URL_PREFIX = "https://lainchan.org/lit/src/";
$THREAD_NO = 4953;
$DOMAIN = "lainchan.org";
# $URL_PREFIX = "https://lainchan.org/lit/src/";
$URL_PREFIX = "https://$DOMAIN/lit/src/";
$THREAD_NO = 4619;
# $THREAD_NO = 6105;
# $THREAD_NO = 4345;
# $THREAD_NO = 4953;
$FN = "$THREAD_NO.json";
$OUT_DIR = "./dl/";
$USAGE = "Usage: bookdl.pl [http://someurl/]thread_id";
die "$USAGE" unless scalar @ARGV > 0;
$ACMD = $ARGV[0];
# Read JSON with list of files
open FILE, "<", $FN or die "could not open file";
do{
@ -88,5 +102,5 @@ close FILE;
# Print a list of wget commands from our tuples
for my $i1 (@a1){
printf("wget -N %s -O '%s%s'\n", scalar $i1->[1], $OUT_DIR, scalar $i1->[0]);
printf("wget -nc %s -O '%s%s'\n", scalar $i1->[1], $OUT_DIR, scalar $i1->[0]);
}

View File

@ -0,0 +1,32 @@
#!/usr/bin/perl
use warnings;
use strict;
my $fn;
my $cmd_out;
my $dn;
my @hd;
$dn = "/home/";
opendir MYDIR, $dn or die "could not open $dn";
@hd = readdir MYDIR;
closedir MYDIR;
@hd = grep {!($_ =~ /^\..*$/)} @hd;
$fn = "/tilde/lyadmin/user_list.txt";
open FILE, "<", $fn or die "could not open $fn";
while(<FILE>){
chomp;
unless(exists( {map { $_ => 1} @hd}->{$_})){
printf("Deleting user %s\n", $_);
`userdel $_`;
}
}
close FILE