code, perl, security, tech

reading wtmp

Have a wtmp file you need read? A nice perl one liner to do so: perl -we '@type=("Empty","Run Lvl","Boot","New Time","Old Time","Init","Login","Normal","Term","Account");$recs = ""; while (<>) {$recs .= $_};foreach (split(/(.{384})/s,$recs)) {next...
DB, perl, web

restoring mysql tables….

Note to self… use this perl program+backup…. http://blog.tsheets.com/2008/tips-tricks/extract-a-single-table-from-a-mysqldump-file.html And since things break over time… the program.  Not mine, use at your own peril, etc… just don’t ask why I needed...