Skip to content

Instantly share code, notes, and snippets.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install docker-engine cgroup-lite apparmor -y
# Install docker-compose
@ircykk
ircykk / allegro.php
Created February 26, 2018 12:14
Allegro SOAP test
<?php
try {
$soapClient = new SoapClient('https://webapi.allegro.pl/service.php?wsdl');
} catch(Exception $e) {
echo $e->getMessage();
}
echo 'OK';
@ircykk
ircykk / ContactController.php
Created March 14, 2018 15:51
Simple reCAPTCHA PrestaShop contact form controller override
<?php
class ContactController extends ContactControllerCore
{
public function postProcess()
{
if (Tools::isSubmit('submitMessage')) {
$response = $_POST["g-recaptcha-response"];
$url = 'https://www.google.com/recaptcha/api/siteverify';
$data = array(
sudo docker exec -i -t name /bin/bash
echo -e "\n php_value max_input_vars 10000" >> /var/www/html/.htaccess
@ircykk
ircykk / gist:c35591ab0384f1d35a592ffa08029618
Created April 14, 2018 10:26
Linux bluetoothctl auto pair and connect device
#!/bin/bash
coproc bluetoothctl
echo -e 'scan on\n' >&${COPROC[1]}
sleep 3
echo -e 'remove AA:AA:AA:AA:AA:AA\n' >&${COPROC[1]}
sleep 1
echo -e 'pair AA:AA:AA:AA:AA:AA\n' >&${COPROC[1]}
sleep 1
@ircykk
ircykk / product_features_mod.tpl
Last active April 16, 2018 10:30
Allegro [product_features_mod]
{if isset($features) && count($features)}
<ul>
{foreach from=$features item=f key=key}
{if $f.name|strpos:"FILTR" === false}
<li>{$f.name|escape:'html':'UTF-8'} - <b>{$f.value|escape:'html':'UTF-8'}</b></li>
{/if}
{/foreach}
</ul>
{/if}
version: '3.3'
services:
ps1_db:
image: mysql:5.7
volumes:
- /var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: admin
@ircykk
ircykk / admin-pass-reset.php
Created April 19, 2018 14:54
PrestaShop reset admin password
<?php
require(dirname(__FILE__).'/config/config.inc.php');
Db::getInstance()->Execute(
'UPDATE`'._DB_PREFIX_.'employee` SET `passwd` = "'.md5(_COOKIE_KEY_.'12345678').'"'
);
@ircykk
ircykk / quick-rename.py
Created April 26, 2018 14:57
Quick rename python script
import os
import argparse as ap
parser = ap.ArgumentParser(description="Quick rename")
parser.add_argument("--dir")
args, leftovers = parser.parse_known_args()
path = './'
if args.dir is not None:
path = args.dir
@ircykk
ircykk / ceneo.php
Created May 22, 2018 16:40
Ceneo Xml categories recurse extract
<?php
$catgoriesXmlPath = __DIR__.'/ceneo-categories.xml';
$xml = simplexml_load_string(file_get_contents($catgoriesXmlPath));
$out = [];
foreach($xml->Category as $xmlCategory) {
recurseExtract($out, '', $xmlCategory);
}