Notes on JavaScript. With comparisons to Python.
Source: ReduceRightDave/forgotJS
Notes on JavaScript. With comparisons to Python.
Source: ReduceRightDave/forgotJS
Put this in your apache config if you are using JBoss & mod_proxy_cluster and want to log which backend JBoss member server your hits are going to:
LogFormat "%h %l %u %t \"%r\" %>s %b %{BALANCER_WORKER_NAME}e" commonbackend
CustomLog /var/log/httpd/httpd.log commonbackend
I spend so much time on TLS I wrote a post discussing my favourite tools.
check_mailq_filter – an Icinga / Nagios postfix mail queue monitor with a filter (include or exclude mails matching a pattern).
So to exclude facebook mails from your monitor you may run:
check_mailq_filter.py -x '.*facebookmail.*'
While you’re here, have a look at pfqueue – a console tool for interactively viewing your postfix queue that’s a step up on postcat etc.
Getting errors like “/root/.virtualenvs/utils35/lib/python3.5/site-packages/pymysql/cursors.py:170: Warning: (1300, “Invalid utf8 character string: ‘9C1DCE'”)
result = self._query(query)” when you run an ansible playbook with the ARA plugin?
Change the mysql python lib to cymysql
ie in $ANSIBLE_CONFIG
[ara]
database = mysql+cymysql://ara:dbpass@localhost/ara
Seems like pymysql has issues with utf-8 & python v3
Why is this 8 year old bug still not fixed? It even has Tim Berners-Lee chiming in on the comments!
With a complex multi-tier stack with HTTP requests getting proxied it can be difficult to track a request as it goes around the system.
One thing you can do is enable mod_unique_id in apache – this creates a distinct environment variable UNIQUE_ID in the web server context for each incoming request. Simply loading the module enables it.
You can then add this via header to downstream systems (eg application servers such as php-fpm or python flask uwsgi) and return upstream so you can view it with browser DevTools with the following config:
RequestHeader set my_id %{UNIQUE_ID}e
Header set my_id %{UNIQUE_ID}e
Furthermore you can add it to your webserver logs:
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D %{UNIQUE_ID}e" combinedtime
CustomLog logs/access_log combinedtime
You can do similar in nginx with $request_id.
For a far more in-depth approach to this, look at Open Tracing.
Cronic is a shell script to help control the most annoying feature of cron: unwanted emailed output, or “cram” (cron spam).
pam_ssh_agent_auth lets you use your ssh keys inside ssh-agent, that you forward in your ssh client connections to subsequently give you passwordless sudo via a destination side list of trusted public keys.
This can be used with ansible which often needs root permissions, details below: