Simple code snippet to cleanup files older than n days.
Continue reading Use Powershell to periodically cleanup temporary dirsCategory: Server
Parse logs for Matomo (Piwik) on Windows [using Powershell]
Automatic log parsing on Windows machines fot Matomo (Piwik).
Once again, thanks to: Adrian Ligiewicz (aka the Master of Powershell)
Continue reading Parse logs for Matomo (Piwik) on Windows [using Powershell]
Backup script for PostgreSQL with zip support 2.0 [using PowerShell]
Version 2 of PostgreSQL backup script. It uses PowerShell and json file for database settings declaration.
This post was created in cooperation with Adrian Ligiewicz.
Continue reading Backup script for PostgreSQL with zip support 2.0 [using PowerShell]
Backup script for PostgreSQL with zip support (Windows)
Simplest solution for backing up PostgreSQL databases. With this bat file you can dump one database to a file and compress it using 7-zip.
PS. If you want a date in your filename simply add %date% var to it’s string.
PS2. Of course check your paths before complaining it does not work 😛
@echo off :: Global config SET PG_BIN="C:\Program Files\PostgreSQL\9.6\bin\pg_dump.exe" SET PG_HOST=localhost SET PG_PORT=5432 SET PG_PATH="C:\inetpub\temporary_backups" SET ZIP_BIN="C:\Program Files\7-Zip\7z.exe" :: Database config for SET PG_DATABASE=your_database_name SET PG_USER=your_database_user SET PGPASSWORD=youe_database_password SET PG_FILENAME=%PG_PATH%\%PG_DATABASE%_postgres.sql %PG_BIN% -h %PG_HOST% -p %PG_PORT% -U %PG_USER% %PG_DATABASE% > "%PG_FILENAME%" %ZIP_BIN% a "%PG_FILENAME:~0,-4%.zip" "%PG_FILENAME%" &DEL "%PG_FILENAME%" @echo Backup Taken Complete %PG_PATH%%PG_FILENAME%
How to setup your IIS to handle very long PHP execution?
This might be useful when serving file downloads or uploads using PHP.
Continue reading How to setup your IIS to handle very long PHP execution?
PHP reading problem with files larger than 2 GB
If you’ll ever have problem with opening (fopen) and reading (fread) files larger than 2 GB in your PHP script. Check your version of scripting engine. In my case switching to 64 bit solved the problem. Please mind that this error is very hard to debug because PHP does not log anything (same as MS IIS) in such case. It simply resets client connection…
How to setup pushover alert on logon event in Windows
In this post I’ll show you how to configure Pushover with Windows server. In this specific case it will notify you when someone logs onto your machine. Continue reading How to setup pushover alert on logon event in Windows