Post Reply 
Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
Apr. 09, 2016, 10:00 AM (This post was last modified: Dec. 08, 2017 10:26 PM by Faxopita.)
Post: #9
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
View Privoxy Status in OS X Menu Bar

[Image: 34d774c8-fe44-11e5-9cec-1d11df154551.png]

  1. In all scripts, replace "Thunderbolt Ethernet" by Wi-Fi if necessary. Other alternative: complete with configuring other device ports at the same time.
  2. I did not find any better solution than activating Privoxy logging. If issues in detecting Privoxy status, unable debug modes 512, 4096, 8192 or try any one of those.
  3. It might be wise to empty the log file once in a while… For example, at system startup with a cron job:
    Code:
    @reboot echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log
    (command to empty the log file but the latest Privoxy status)

    Note: you might need to claim the ownership of the log file if you choose to add the cron job as a regular user. Make sure Privoxy has write access to the log file too! Otherwise, it will crash.

Install BitBar via Homebrew Cask: brew cask install bitbar

Amend [script folder] in those scripts:
  • Privoxy_Status.5s.sh (menu bar item refreshed every 5 sec.)
  • HTTPS_Port_Status.1m.sh (menu bar item refreshed every one min.)
Both located inside your BitBar folder.

-–—

Caution with Script `Privoxy_Status.sh`

If you're not in the habit of clearing Privoxy's logfile once in a while—you may want to keep it for later examination—I suggest you “rotate” it daily in order to reduce CPU usage every time the command grep is called—every x seconds. Highly recommended since using such a command-line utility cyclically on a logfile of 100's of MB (past a million entries) can have a serious impact on your CPU during a few seconds. Not good if you're on battery then!

In my case, I decided to have Privoxy's logfile content flushed out daily to some other file located inside the userland part of the system; you can create a new cron job—`crontab -e` in Terminal—and add this line:

Code:
0 20 * * * cat /private/var/log/privoxy/logfile.log >> /usr/local/var/log/Privoxy/logfile.bak && echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log

If you just want to clear Privoxy's logfile content at 8 p.m. daily:
Code:
0 20 * * * echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log
(if every hour, replace `20` by `*`)

Same job but at reboot time only:
Code:
@reboot    echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log

To list your cron jobs: `contrab -l`.

-–—

Minuscule donations are always appreciated…
Code:
BTC --> 34WKogWorDoReJ2MSxw8rTsrGD87VMAPJY
BCH --> 1AXwyMdtMFZktZPvXScC58ESUZXptmjvge
DASH -> XusJsETR6PwDnG4Gde7cvGeRhXzUJFSxtD
ETH --> 0xb829FA99AA9AB31C32590dbc88B837bC5D91453e
ETC --> 0x059F128357331c346Ad2E23F95a4639beC3f0b3a
LTC --> MK7vxk93A1M6HHAYT38W8NPJSb8zANqCia
ZEC --> t1JNCuxdZEWUPBQiAzxZPUMqb4BM87sxs9H
DOGE -> DBPAUuCaez4JYGobAn4RHNNhFXwa9u1W6N
STRAT > SgG6jAHuxQfzW1QBaWyQRVdCdSq514BcyM


Attached File(s)
.zip  PrivoxyStatus.zip (Size: 23.62 KB / Downloads: 740)
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to Faxopita for this post:
cattleyavns
Post Reply 


Messages In This Thread
RE: Privoxy + ProxHTTPSProxyMII on OS X - diem - Oct. 12, 2015, 03:07 PM
RE: Privoxy + ProxHTTPSProxyMII on OS X - JJoe - Oct. 13, 2015, 12:09 AM
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial) - Faxopita - Apr. 09, 2016 10:00 AM

Forum Jump: