Author: Konrad Fedorczyk
Create SQL table for logs (with rotation)
I needed a very simple SQL table with application log. After sometime I’ve realized that it already has 80 MB of data (sic!). What can you do with logs? Well, answer is simple! Use rotation. Below you can find quick SQL solution for removing old entries.
Simple PHP large file upload test script
I’ve created simple script to test large file uploads using PHP powered servers. Fell free to check it at Gist.
Use psexec to troll your work colleagues
If you’re an admin in a windows environment you can troll your friends a little bit đ Install psexec and use bellow command to run Rick Astley’s famous “sweet troll of mine” on a remote computer (background, no window!). psexec64 -s /user:domain\user -i \\xxx.xxx.xxx.xxx “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –app=”https://youtu.be/dQw4w9WgXcQ” xxx.xxx.xxx.xxx â stands for an ip number of a […]
How to change priority on Windows scheduled task using Powershell?
By default Windows setups task priority in scheduler to 7 (which is kinda low). The side effect of this is that for eg. backups are taking very long to take. In my case all databases were backed up in about 40-50 minutes…
How to force https on IIS webiste?
Edit web.config file in your website directory and carefully add this lines (remember to change domain name):
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)
Brutal fix for “Incorrect string value:” error in Matomo (Piwik)
If you’re using Matomo (previously Piwik) on MS IIS and MariaDBÂ and you’re getting a lot of these: [06-Jun-2018 11:56:36 UTC] Error in Matomo (tracker): Error query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xC3_\xC6\x92\xC3\x82…’ for column ‘name’ at row 1 In query: INSERT INTO matomo_log_action (name, hash, type, url_prefix) VALUES (?,CRC32(?),?,?) Parameters: array […]
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.
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 […]
E-mail extraction from an Outlook copied string
Sometimes you need to extract an e-mail address from a format like this: Name Surname <[email protected]> In such cases use this function: /** * Extract mail address from a string * * @param string $emailString * @return mixed match on success, false on error */ function extractEmail( $emailString ) { /** @var string $result **/ […]