Skip to content

Instantly share code, notes, and snippets.

@juangacovas
juangacovas / maxminddb-download.sh
Last active August 24, 2019 18:19
Automatic download of MaxMindDB GeoLite2 (for lighttpd, 2019)
#!/bin/bash
# Automatic MaxMindDB GeoLite2 download (city version)
# * that downloads ONLY when new database is available (which is cool and nice with MaxMind servers) *
# * by Juanga Covas 2019
# logs to download.log and download-nothing.log
# recommended cron: 0 6 * * * cd /root/maxminddb; sh download.sh > download-last-cron.log
final_path="/var/cache/lighttpd"
@juangacovas
juangacovas / search-svn-repos.sh
Last active June 27, 2022 22:54
SVN/Subversion Find in Files/Searching content of files in all repositories (at SVN server)
#!/bin/bash
# Search in SVN repositores -- by Juanga 2019
# Based on https://svn.haxx.se/users/archive-2006-09/1016.shtml
echo " "
echo -n "*** Will search "$1" in PHP code inside all SVN repositories "
if [[ -z $1 ]]; then
@juangacovas
juangacovas / lint.bat
Last active December 21, 2023 15:04
Windows cmd script for PHP lint recursive (batch script to lookup syntax errors and deprecations)
@echo off
SETLOCAL enabledelayedexpansion
echo.
echo  Recursive PHP lint parser 
echo Will do "php -l" for all php files under given directory tree, telling deprecations and/or syntax errors.
echo Assumes "php.exe" is on PATH
echo.
if "%1"=="" goto :usage
if NOT exist "%1" (