Skip to content

Instantly share code, notes, and snippets.

Avatar

Nikita Makarov inri13666

View GitHub Profile
@inri13666
inri13666 / php_unserialize_to_json.sql
Created Jul 23, 2021 — forked from storeman/php_unserialize_to_json.sql
PHP unserialize in Postgresql to json
View php_unserialize_to_json.sql
/**
Decode a php serialized value to json. This function only supports basic
data types:
- arrays (will always become a json object)
- booleans
- integers
- floats
- strings
- NULL
@inri13666
inri13666 / azure-pipelines.yml
Created Jun 8, 2021 — forked from zanechua/azure-pipelines.yml
Azure Pipeline + Laravel + MySQL + PHPUnit + Laravel Dusk
View azure-pipelines.yml
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 16.04'
variables:
phpVersion: 7.2
@inri13666
inri13666 / .htaccess
Created Jul 2, 2020
Better Security Drupal
View .htaccess
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
View Git Changing file permissions.md

@fooMonster article worked for me

git ls-tree HEAD

100644 blob 55c0287d4ef21f15b97eb1f107451b88b479bffe script.sh As you can see the file has 644 permission (ignoring the 100). We would like to change it to 755:

git update-index --chmod=+x script.sh

commit the changes

git commit -m "Changing file permissions"

@inri13666
inri13666 / linix.md
Last active Feb 19, 2019
PHP File-system challenge
View linix.md
mkdir -p /tmp/test/realcachefolder/gretta
ln -s /tmp/test/realcachefolder /tmp/test/symlinkcachefolder
cd /tmp/test/symlinkcachefolder
php -r "var_dump(realpath('/tmp/test/symlinkcachefolder'));"
php -r "var_dump(__DIR__);"

create index.php with following content at /tmp/test/symlinkcachefolder

<?php 
View settings.php
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
View environment.md

####systeminfo | findstr /B /C:"OS Version" /C:"System Type" /C:"System Locale"

OS Version:                10.0.14393 N/A Build 14393
System Type:               x64-based PC
System Locale:             en-us;English (United States)

####php -i | findstr /B /C:"PHP Version" /C:"Architecture" /C:"Compiler" /C:"Configure Command" /C:"Zend Extension Build" /C:"Client API library version" /C:"PostgreSQL(libpq)"

PHP Version => 7.0.7
View Missed Neighbourhood
+------------------+---------------------+------------------------+------------------------------------+----------+------+--+
| Province | Feed City | Google City | Google Neighbourhood | PostalC | Qnty | |
+------------------+---------------------+------------------------+------------------------------------+----------+------+--+
| Ontario | Brampton | Brampton | Churchville | L6Y4B5 | 13 | |
| Ontario | Toronto | Toronto | Willowdale | M2R1H9 | 39 | |
| Ontario | Toronto | Toronto | Midtown Toronto | M5R3T5 | 75 | |
| Ontario | Tiny | | Gilford | L0L1R0 | 4 | |
| Ontario | Lakeshore | | Belle River | N0R1A0 | 64 | |
| Ontario
@inri13666
inri13666 / config.yml.dist
Last active Nov 19, 2016
Demo for "phrets-core"
View config.yml.dist
akuma:
phrets:
crea: #KeyAsAttribute
base_uri: 'http://sample.data.crea.ca/'
username: 'CXLHfDVrziCfvwgCuL8nUahC'
password: 'mFqMsCSPdnb5WO1gpEEtDCHH'
http_auth_method: ~
user_agent: ~
@inri13666
inri13666 / app.cmd
Created Nov 7, 2016
Provides simply way to access Symfony's Console
View app.cmd
@ECHO OFF
if exist "app/console" (
SET CONSOLE="app/console"
)
if exist "bin/console" (
SET CONSOLE="bin/console"
)
IF NOT DEFINED CONSOLE (
echo "No console found"