Skip to content

Instantly share code, notes, and snippets.

@xxorax
xxorax / env.php
Last active September 18, 2023 23:49 — forked from dianabotean/env.php
move open source queues to rabbit
[
(...)
'queue' => [
'amqp' => [
'host' => '<rabbitmq_host>',
'port' => '<rabbitmq_port>',
'user' => '<rabbitmq_user>',
'password' => '<rabbitmq_pass>',
'virtualhost' => '/',
'ssl' => false
@xxorax
xxorax / README.md
Created December 5, 2022 22:13 — forked from mul14/README.md
[Linux] [Firefox] Open link in browser, which is in current workspace

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

@xxorax
xxorax / feature-mysql.pl
Created January 18, 2021 15:13
Fixed Virtualmin user creation for Mariadb 10.2 - 10.3
sub require_mysql
{
return if ($require_mysql++);
$mysql::use_global_login = 1;
&foreign_require("mysql");
if (!$mysql::config{'login'}) {
$mysql::config{'login'} = 'root';
$mysql::mysql_login ||= 'root';
$mysql::authstr = &mysql::make_authstr();
}
#!/bin/bash
# Because packager sucks
gem list --local | grep '(' | sed -r 's/^([^ ]+)( \(.+)$/\1/' | xargs gem uninstall
apt-get purge --auto-remove ruby ruby-dev
# Optionnal (or not)
echo 'Package: <nameofpackage>
Pin: origin ""
Pin-Priority: -1' > /etc/apt/preferences.d/ruby
#!/bin/bash
# Author: Martin PANEL
# Description: find all crashed mysql table from a log file, a run request to repair them
# Usage : mysqlRepairTableFromLog.sh [logFile]
# logFile: file log or /var/log/syslog by default
#
# env var $MYSQL_OPTS can be used to add mysql params
#
log=/var/log/syslog
@xxorax
xxorax / jsQuoteEscapeTest.php
Created May 19, 2016 10:15
Magento jsQuoteEscape security test
<?php
$mageFilename = dirname(__FILE__).'/app/Mage.php';
require_once($mageFilename);
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::init($mageRunCode, $mageRunType);
$test = 'test\\\'+alert("powned");//';
@xxorax
xxorax / getMagentoPatches.php
Created November 3, 2015 11:19 — forked from Schrank/getMagentoPatches.php
Download all magento patches (once), and sort them into the correct directory, so you have all patches for a single version by hand.
class PatchDownloader
{
/**
* @var string
*/
private $infoUrl = "https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/filter/version/";
/**
* @var string
*/
private $downloadUrl = "https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/file/";
@xxorax
xxorax / fix-url-keys.php
Last active September 11, 2015 17:11 — forked from Vinai/fix-url-keys.php
This fixes the duplicate url_key issue in a Magento 1.8 / 1.13 installation.
<?php
/**
* Drop this into the shell directory in the Magento root and run with -h to see all options.
*/
require_once 'abstract.php';
/**
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints.
#!/bin/bash
set -e
container_id=$1
if [ -z $container_id ]; then
echo "usage: sudo docker-nsenter <container_id> [args ...]"
exit 1
fi
target=`docker inspect --format '{{.State.Pid}}' $container_id`
nsenter --mount --uts --ipc --net --pid --target $target ${@:2}
#!/bin/bash
# An alternative to "links", run this script after starting or stopping any
# container. It's a hack to update the host machine (vagrant) /etc/hosts with
# the current active docker containers and tell dnsmasq to refresh.
#
# Then start each machine with "-dns ${DOCKER_HOST_IP}", e.g.
# $ docker run -d -name mycontainer1 -dns 10.0.3.1 MYPRODUCT
# You can't seem to set the DNS during "docker build".
#
# Diagnostic command to run in host or while logged into containers: