{"id":20121806,"url":"https://github.com/parseword/util-misc","last_synced_at":"2025-05-06T16:32:19.233Z","repository":{"id":82258379,"uuid":"85143995","full_name":"parseword/util-misc","owner":"parseword","description":"Miscellaneous utilities for Linux and FreeBSD","archived":false,"fork":false,"pushed_at":"2024-02-19T01:24:03.000Z","size":35,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-15T17:21:37.156Z","etag":null,"topics":["freebsd","linux","php","ports","svn"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parseword.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-03-16T02:36:04.000Z","updated_at":"2022-06-17T20:52:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ceef566-d929-4f47-a5a0-f8fed6132aff","html_url":"https://github.com/parseword/util-misc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Futil-misc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Futil-misc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Futil-misc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Futil-misc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parseword","download_url":"https://codeload.github.com/parseword/util-misc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224513600,"owners_count":17323840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freebsd","linux","php","ports","svn"],"created_at":"2024-11-13T19:32:45.085Z","updated_at":"2024-11-13T19:32:45.979Z","avatar_url":"https://github.com/parseword.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# util-misc\nMiscellaneous utilities for Linux and FreeBSD, mostly written in PHP.\n\n### find-repos\n\nThis script finds the top-level Subversion and Git repositories on a system. \nIf you use Subversion 1.8 or newer, you don't really need this; you can get the \nsame results with `locate .svn | grep -E \"\\/\\.svn$\"`. Older Subversion clients \nwould litter repositories with many `.svn` subdirectories; the main purpose of \nfind-repos is to filter those out.\n\nIf you xargs the output to `svn status`, you can look for \"dirty\" or uncommitted \nchanges across your entire filesystem at once:\n\n    [root@dallas03 /tmp]# findrepos svn | xargs svn status\n    M       /etc/postfix/header_checks\n    M       /etc/postfix/virtual\n    ?       /etc/ssh/moduli.orig\n    M       /usr/local/apache2/conf/httpd.conf\n\n### nsa-dhs-news.php\n\nA script to generate an RSS \"news feed\" full of DHS watchlist terms and NSA \ncryptonyms. For use with the [TrackMeNot](https://cs.nyu.edu/trackmenot/) browser \nextension.\n\n### ports-update-check\n\nThis script checks for available ports updates on a FreeBSD system. It first \nbrings the ports tree current using git, then runs `portmaster -L` to \nquery for updates. If any are found, you get an email notification containing \nthe necessary `portmaster` commands to upgrade each port, like this:\n\n    Updates are available for the following ports:\n    \n    libiconv-1.14_11\n    perl5-5.24.3\n    \n    To upgrade all, run: portmaster -avw\n    \n    To upgrade individual ports,\n    \n    portmaster -Kvw libiconv-1.14_10\n    portmaster -Kvw perl5-5.24.2\n\nDrop the script into \n`/etc/periodic/daily` and set the execute bit.\n\nYou'll need to define a constant named `ADMINISTRATOR_RECIPIENT` and, optionally, \none named `ADMINISTRIVIA_SUBJECT_PREPEND`. I keep these in an external config file \nthat isn't included here.\n\n### remote-repository-check.php\n\nIn my environments, every website is a checked-out copy of a version control \nrepository. \n\nThis script runs \"svn status\" or \"git status\" against any number of remote \nrepositories, and sends an email notification if any repository isn't clean, \nproviding an early warning of potential website compromise or file tampering. \nI suggest setting it as a cron job that runs at least hourly.\n\nYou need to have passwordless key-based SSH set up between your \"monitor\" \nserver and any target servers. Configuring the script is straightforward, \njust follow the examples to define your remote repositories. For more, see \nthe article [*Website integrity monitoring through version control*](https://shaunc.com/go/kjj6wxDh18gS).\n\n### report-uri-content-security-policy.php\n\nThis script acts as a reporting endpoint for \nthe [`Content-Security-Policy`](https://www.owasp.org/index.php/Content_Security_Policy_Cheat_Sheet) HTTP \nsecurity header. If you run a website that sets this header, you can use this\nscript to receive error reports from your users' browsers. Place this file on\nyour server and set the `Content-Security-Policy` header's `report-uri` value to point there.\nThe script accepts and replies to both `OPTIONS` and `POST` requests.\n\nYou'll need to define a constant named `ADMINISTRATOR_RECIPIENT` and comment\nout the `require_once()` line, I keep this and other constants in an external\nconfig file that isn't included here.\n\n### report-uri-expect-ct.php\n\nThis script acts as a reporting endpoint for \nthe [`Expect-CT`](https://tools.ietf.org/html/draft-ietf-httpbis-expect-ct-02) HTTP \nsecurity header. If you run a website that sets this header, you can use this \nscript to receive error reports from your users' browsers. Place this file on \nyour server and set the `Expect-CT` header's `report-uri` value to point there. \nThe script accepts and replies to both `OPTIONS` and `POST` requests.\n\nYou'll need to define a constant named `ADMINISTRATOR_RECIPIENT` and comment \nout the `require_once()` line, I keep this and other constants in an external \nconfig file that isn't included here.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Futil-misc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparseword%2Futil-misc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Futil-misc/lists"}