A python cli and some semgrep rules for scanning CSS and JS under the MediaWiki namespace for external resource usage.
- Python 3+
- Semgrep
- About
350 Mb
of local disk space (to cache CSS and JS files)
A python cli and some semgrep rules for scanning CSS and JS under the MediaWiki namespace for external resource usage.
350 Mb
of local disk space (to cache CSS and JS files)#!/usr/bin/env bash | |
################################################################################ | |
# Author: [email protected] | |
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0> | |
# Usage: chmod +x install-gadget-test-mw.sh && ./install-gadget-test-mw.sh | |
################################################################################ | |
set -euo pipefail | |
# check binary dependencies | |
bins=("cat" "echo" "git" "docker") |
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
define( "AST_PHP_VERSION", 80 ); | |
if( PHP_SAPI !== 'cli' ) { | |
exit("Please run as a PHP CLI!"); | |
} |
#!/usr/bin/env bash | |
# based upon https://gist.github.com/mbohun/b161521b2440b9f08b59 | |
# re: https://about.codecov.io/security-update/ | |
DEBUG=false | |
GITHUB_API_BASE="https://api.github.com" | |
GITHUB_API_REST="/orgs/wikimedia/repos" | |
GITHUB_API_HEADER_ACCEPT="Accept: application/vnd.github.v3+json" | |
# set GITHUB_TOKEN |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# License: Apache 2.0 | |
import csv | |
import requests | |
import time | |
from lxml import html |
(see scripts) |
#!/usr/bin/env bash | |
################################################################################ | |
# Author: [email protected] | |
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0> | |
################################################################################ | |
. /etc/profile.d/mediawiki.sh | |
# pass debug as an argument to use a smaller test dblist | |
if [[ "$1" != "debug" ]]; then |
#!/usr/bin/env bash | |
################################################################################ | |
# Author: [email protected] | |
# License: Apache 2 <https://opensource.org/licenses/Apache-2.0> | |
# Description: | |
# A way to get (complete) row counts for gerrit searches via its api | |
################################################################################ | |
set -euo pipefail | |
# validate arguments |
!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" Search for people in a Namely API | |
Doc: https://developers.namely.com/docs/namely-api/ | |
Author: sbassett29 | |
License: CC0 | |
""" | |
import json |
#!/usr/bin/env bash | |
curl -s https://gerrit.wikimedia.org/r/projects/?r=mediawiki/services/.* | \ | |
awk 'NR>1' | \ | |
jq -r 'to_entries[] | "\(.key) [ \(.value.web_links[0].url) ]"' |