View duplicate_lines_count.sh
# Sorts the file by duplicate line count | |
sort /path/to/filename | uniq -c | sort -nr > ./_aggregated.tmp | |
# Just read the head as it's probably a huge file | |
head -n 1000 ./_aggregated.tmp | less |
View mongodb_subdoc_query.js
// | |
// Find documents with sub-document query: | |
// | |
db.collection_name.find({ | |
relays: { | |
$elemMatch: { | |
timestamp: {$gte: 1447628400}, | |
status: "RELAY_STATUS_ERROR_SUBMIT", | |
app_id: ObjectId("537cb1b5fc20a0eb47000000") | |
} |
View desc
#!/bin/bash | |
# Print information about a single option or command | |
# http://svn.mikelward.com/svn/scripts/desc | |
# Example Usage: | |
# opt bash continue | |
# opt rsync -v | |
scriptname=desc |
View tsv2csv.py
#!/usr/bin/python | |
import glob | |
import csv | |
import sys | |
import os | |
# Check args | |
if len(sys.argv) < 2: | |
sys.exit('Usage: tsv2csv.py /path/to/dir') |
View nmap_dragon.txt
( ) /\ _ ( | |
\ | ( \ ( \.( ) _____ | |
\ \ \ ` ` ) \ ( ___ / _ \ | |
(_` \+ . x ( .\ \/ \____-----------/ (o) \_ | |
- .- \+ ; ( O \____ | |
(__ +- .( -'.- <. \_____________ ` \ / | |
(_____ ._._: <_ - <- _- _ VVVVVVV VV V\ \/ | |
. /./.+- . .- / +-- - . (--_AAAAAAA__A_/ | | |
(__ ' /x / x _/ ( \______________//_ \_______ | |
, x / ( ' . / . / \___' \ / |
View accesslog2csv.pl
#!/usr/bin/perl | |
# | |
# @file | |
# Converter tool, from Apache Common Log file to CSV. | |
# | |
# All code is released under the GNU General Public License. | |
# See COPYRIGHT.txt and LICENSE.txt. | |
# | |
View find_n_exec.sh
find . -type f -name "__MACOSX" -exec rm -rf {} \; |
View cron_times.sh
# When does cron.daily, cron.hourly, etc. run on a system? | |
grep run-parts /etc/crontab |
View dos2unix.sh
find . -type f ! -regex ".*\/\.svn\/.*" -exec dos2unix {} \; |
View gitignore2svnignore.sh
#!/bin/bash | |
cat .gitignore | sed 's/^/\.\//g;s/\(.*\)\/\([0-9a-zA-Z\*\?\.]*\)$/svn propedit svn:ignore "\2" \1 /mg' | bash |