Skip to content

Instantly share code, notes, and snippets.

fedek6 /
Created Dec 21, 2018
Packager for web projects on nix systems.
# Extract JSON value
parse_json () {
echo $1 | \
sed -e 's/[{}]/''/g' | \
sed -e 's/", "/'\",\"'/g' | \
sed -e 's/" ,"/'\",\"'/g' | \
sed -e 's/" , "/'\",\"'/g' | \
sed -e 's/","/'\"---SEPERATOR---\"'/g' | \
fedek6 / Controller.php
Created Dec 3, 2018
Prepend application name to site title in Yii2
View Controller.php
* Extension of base controller.
* Add additional controller functions and vars here.
namespace app\components;
use Yii;
fedek6 / remove_old_log_entries.sql
Last active Aug 21, 2018
Log rotation in MySQL table
View remove_old_log_entries.sql
DELETE FROM logs WHERE id IN (select id from (select id FROM log ORDER BY id DESC LIMIT 1000, 500) x)
fedek6 / .user.ini
Created Jul 27, 2018
Simple PHP large upload test script
View .user.ini
upload_max_filesize = 2048M
post_max_size = 2048M
max_input_time = 3600
fedek6 / web.config
Created Jun 19, 2018
Force https on IIS
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<rule name="Force HTTPS" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
fedek6 / matomo.bat
Created Jun 6, 2018
Automatic log parsing for matomo using Bat
View matomo.bat
@echo off
:: Based on
:: Global config
SET PY_BIN=C:\Program Files\Python\Python27\python.exe
SET IMPORT_LOGS=[path to matomo]\piwik\misc\log-analytics\
SET LOGS_DIR=C:\inetpub\logs\LogFiles
SET TOKEN=****************************
fedek6 / parse_logs.ps1
Created Jun 6, 2018
Parse logs for Matomo (Piwik) on Windows [using Powershell]
View parse_logs.ps1
#Based on
# Config
#:: Python URL (must be 2.x)
$PY_BIN="C:\Program Files\Python\Python27\python.exe"
#:: Matomo import_logs executable
fedek6 / import_logs.bat
Created Jun 5, 2018
Bat for importing Matomo logs on Windows enviroment.
View import_logs.bat
@echo off
:: Based on
:: Global config
:: Python URL (must be 2.x)
SET PY_BIN=C:\Program Files\Python\Python27\python.exe
:: Matomo import_logs executable
SET IMPORT_LOGS=C:\inetpub\htdocs\piwik\misc\log-analytics\
fedek6 / backup_pg.ps1
Created Jun 4, 2018
PowerShell script for Posgres backup. Support for multiple databases.
View backup_pg.ps1
#Global config (always uncommented)
$PG_BIN = "C:\Program Files\PostgreSQL\9.6\bin\pg_dump.exe"
$ZIP_BIN="C:\Program Files\7-Zip\7z.exe"
#Database config for (uncomment if manual use)
fedek6 / bootstrap.js
Created May 21, 2018
jQuery basic bootstrap
View bootstrap.js
(function ($, root, undefined) {
* Onready – fire when DOM is ready
$(function () {
'use strict';
// say hello
console.log('Hello, Want to hire me? Go to:');
You can’t perform that action at this time.