Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
xmlstarlet sel -N tei="http://www.tei-c.org/ns/1.0" -t -f -o " " -m "//tei:bibl[@type='source']/tei:title" -c "." -n pj10*/*Z.xml | perl -0777 -nE 's/xmlns="[^"]+"//g;s/\.\.\/database\/journals\/journals. xml/\&journals;/g;s/\s{2,}/ /g;s/([^>])\n/\1/g;s/xml\s/xml\n/g;s/\s(pj\d{3})/\n\1/g;print "$_\n"' | grep '\(pj\|jour"\)' | perl -nE 'chomp;if(/^pj/){$v=$_}else{$v{$v}++}; END { printf "%s: %d\n", $_, $v{$_} for sort { $v{$a} cmp $v{$b} } keys %v}'
@haoess
haoess / mysql_table_size.sql
Created November 2, 2010 08:52
List out one database, and each tables size in detail
SELECT table_name, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "schema_name";
-- thanks to http://www.mkyong.com/mysql/how-to-calculate-the-mysql-database-size/
% perl -e 'goto qq.\010.x0x11.qq.Just another Perl hacker,\n.'
Just another Perl hacker,
% perl -e 'goto qq.\010.x0x11.q.Just another Perl hacker,.'
Just another Perl hacker, at -e line 1.
% perl -e 'goto("\010"x0x11)."Just another Perl hacker,"'
Just another Perl hacker, at -e line 1.
% perl5.11.0 -e 'eval { $::{"@"}="" }'
perl5.11.0: sv.c:4312: Perl_sv_setpvn: Assertion `sv' failed.
zsh: abort LC_ALL=C /opt/perl/bleadperl/bin/perl5.11.0 -e 'eval { $::{"@"}="" }'
% perl5.11.0 -le 'eval { undef *$_ } for keys %::'
Attempt to free unreferenced scalar: SV 0x2866aa0, Perl interpreter: 0x283c010.