Skip to content

Instantly share code, notes, and snippets.

import hashlib
from base64 import b64decode, b64encode
def utf16tobin(s):
return s.encode('hex')[4:].decode('hex')
b64salt = "kDP0Py2QwEdJYtUX9cJABg=="
b64hash = "OJF6H4KdxFLgLu+oTDNFodCEfMA="
binsalt = b64decode(b64salt)
password_string = 'password'.encode("utf16")
target = """insert into mt_entry (mt_author_id, mt_authored_on, entry_basename, entry_blog_id, mt_class,
entry_convert_breaks, entry_created_by, entry_created_on, entry_excerpt, entry_status,
entry_text, entry_text_more, entry_title, entry_week_number, mubble_id)
values(1, 1, '%(publish_date)', '%(filename)', 1, 'entry',
0, 0, '%(publish_date)', '%(excerpt)', %(status),
'%(text)', '%(text_more)', '%(title)', '%(weeknumber)', '%(mubble_id)')
on duplicate key update
mt_author_id=values(mt_author_id),
mt_authored_on = values(mt_authored_on),
entry_basename = values(entry_basename),
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-31997-3");
pageTracker._trackPageview();
} catch(err) {}</script>
my @cats = @{$entry->categories};
my @aggs = grep {
my $type = get_meta($_)->{aggregate_category};
$type && $type == "Children";
} @cats;
my %meta = map {$_->id => get_meta($_)} @cats;
my %idx = map {$_->id => $_} @cats;
By <mt:AuthorDisplayName /><mt:ExtendedAuthors glue=", ">
<mt:AuthorDisplayName />
</mt:ExtendedAuthors>
source entry_source
{
type = mysql
strip_html = 0
index_html_attrs =
sql_host = localhost
sql_user = ###
sql_pass = ###
sql_db = ###
sql_port = 3306 # optional, default is 3306
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script src="http://code.jquery.com/jquery-1.3b1.js" type="text/javascript"></script>
<script>
1) Critical site components (navigation, content styling, etc)
2) Editorializer in place and functional
3) Imported content from old site
4) Content categorized according to new scheme
5) Redirects
6) Extensive testing
7) User customization features (cookie based)
8) Secondary site components (various widgets, related search, etc)
9) User customization features (persisted to accounts)
$VAR1 = bless( {
'__triggers' => {},
'column_values' => {
'author_id' => undef,
'archive_type' => 'Individual',
'file_path' => '/home/kurt/ars-technica-mt-bits/published/te ch-policy/news/2007/12/foia-reform-bloggers-a re-journalists-too.php',
'template_id' => '1787',
'startdate' => undef,
'entry_id' => '34',
'virtual' => '0',
sub cb_build_file{
my ($eh, %args) = @_;
my $html = ${$args{Content}};
my $blog = $args{Blog};
${$args{Content}} = replace_links($html, $blog);
};