2007 May 07 - Mon
Importing a Blosxom Blog into Movable Type
I have my Blosxom based blog organized by category directories rather than by date. I've written a Perl script to
take this collection of articles and transform them into a MovableType import file. My content files have a .txt
extension. You'll need to change the match string if your extension is different from mine.
To run, there is a variable called dir which you seed with a starting directory. The program then scans that
directory and further sub-directories looking for files with the designated suffix. It then uses the first line of
a found file for the title. The third and subsequent lines are used for the content.
I've found that after importing, I'm not able to see the body in Movable Type's content editor. How weird...
Well, it does show up when you customize the display of the page. It shows up in the extended entry text.
2007/06/12: David Graff suggested an additional print statement before the body block. I havn't tried it,
but I hope it works to remedy the missing body bit.
Here is the script:
#!/usr/bin/perl
use strict;
#use File::stat;
use Fcntl ':mode';
my $author = 'ray';
my $ext = '.txt';
my @dirs;
my $dir = '/var/www/html/blog';
push( @dirs, $dir );
while ( $dir = pop( @dirs) ) {
chdir( $dir );
opendir( DIR, $dir );
# print( "$dir\n" );
foreach my $file ( readdir( DIR) ) {
if ( $file =~ /.txt$/ ) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime((stat($file))[9]);
$mon+=1;
$year+=1900;
$mon = substr( '0' . $mon, -2 ,2 );
$mday = substr( '0' . $mday, -2, 2 );
$hour = substr( '0' . $hour, -2, 2 );
$min = substr( '0' . $min, -2, 2 );
$sec = substr( '0' . $sec, -2, 2 );
my $date = "$mon/$mday/$year $hour:$min:$sec";
# print( " $file: $date\n");
open( FILE, '<' . $file );
my $title = <FILE>;
chomp( $title );
my $body;
my $extbody;
my $line;
my $summary = 1;
while ( $line = <FILE> ) {
if ( $summary ) {
$body .= $line;
if ( length( $line ) < 2 ) {
$summary = 0;
}
}
$extbody .= $line;
}
close( FILE );
$dir =~ /\/([^\/]+$)/;
my $category = $1;
print( "AUTHOR: $author\n" );
print( "TITLE: $title\n" );
print( "DATE: $date\n" );
print( "PRIMARY CATEGORY: $category\n" );
print( "STATUS: publish\n" );
# print( "ALLOW COMMENTS: 1\n" );
# print( "ALLOW PINGS: 1\n" );
print("-----\n"); # 2007/06/12 insertion by David Graff
print( "BODY:\n" . $body . "\n-----\n" );
print( "EXTENDED BODY:\n" . $extbody . "\n-----\n" );
print( "--------\n" );
}
my $mode = (stat($file))[2];
if ( S_ISDIR( $mode ) ) {
if ( '.' ne $file && '..' ne $file ) {
push( @dirs, $dir . '/' . $file );
}
}
}
closedir( DIR );
}
[/OpenSource/Debian/MovableType]
permanent link
Security Enhancements for Remote Access at Microsoft
Here is a link to a paper that has a bunch of useful stuff in it regarding Microsoft VPN's, IAS (Internet
Authentication Server), security scripting, and Windows 2003 based Remote Access Infrastructure:
Security Enhancements for
Remote Access at Microsoft: Technical White Paper
[/Cisco]
permanent link
User Certficate Auto Enrollment
With my 802.1x test setup, machine certificates were being sent to domain machines with no problem, but user
certificates were not showing up.
In the group policy object, right on the container housing the users that needed certificates, I set the
auto-enrollment
settings. For some reason things weren't being inherited from the domain default policy. The group policy container is
User Configuration -> Windows Settings -> Security Settings -> Public
Key Policies -> Autoenrollment SEttings. The 'Enroll Certificates Automatically' needs to be checked along with it's two
subsidiary check boxes.
The following command serves as a manual refresh of the policy:
gpupdate /target:user
Enrollment will take several minutes. Running the certmgr.msc mmc snap-in will allow one to check that the certificate
has arrived in
the Personal -> Certificates store.
The Application Event Log will contain success/failure status for the auto-enrollment.
I also found out from an troubleshooting auto-enrollment article, that domain users without email addresses will not
auto-enroll. They don't need an actual email box, just an entry in the email attribute in Active Directory.
As further reference, Microsoft has an article on How Autoenrollment Works. There are other related and helpful articles in the same library section.
[/Cisco]
permanent link
|