This file will contain instructions to run goaccess from a PHP instance.
For more details on GoAccess check these links:
For this project, I'm using a compiled version of GoAccess with enabled options to reduce the memory usage.
| #include <stdio.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| FILE *in; long M[1<<24]={0}, *D, *R, H=0x130000, IP=0, T; | |
| long getu() { long t, h = getc(in); if (h < 0xC0) return h; | |
| t = ((h&0x1F) << 6) | (getc(in) & 0x3F); if (h < 0xE0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); if (h < 0xF0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); return t & 0x1FFFFF; } | |
| void putu(long c) { if (c < 0x80) { putchar(c); return; } | |
| if (c < 0x7FF) { putchar(0xC0|(c>>6)); } else { |
| #!/bin/bash | |
| set -e | |
| CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
| hex=$((cat <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> |
| #!/bin/bash | |
| # warning you need to build in something to stop the loop | |
| # in practice, I used a kill file check before invoking the script again | |
| echo 'tail recursive bash ftw' | |
| sleep 10 | |
| $0 & | |
| # if you didn't listen and ran this as-is, try: | |
| # killall tail.sh |