Skip to content

Instantly share code, notes, and snippets.

Matteo Scaramuccia scara

Block or report user

Report or block scara

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sergiotabanelli
sergiotabanelli / REVAMPED.md
Last active Oct 25, 2018
MYSQLND_MS REVAMPED: Single and multi-master read/write consistency enforcing in MySQL asynchronous clusters with PHP and mysqlnd_ms extension
View REVAMPED.md

MYSQLND_MS REVAMPED: Single and multi-master read/write consistency enforcing in MySQL asynchronous clusters with PHP and mysqlnd_ms extension

NOTE: The service level and consistency feature is one of the most changed areas of the mymysqlnd_ms fork. Functionalities like server side read consistency and server side write consistency allow transparent migration to MySQL asyncronous clusters in almost all use cases with no or at most extremely small effort and application changes.

Different types of MySQL cluster solutions offer different service and data consistency levels to their users. Any asynchronous MySQL replication cluster offers eventual consistency by default. A read executed on an asynchronous slave may return current, stale or no data at all, depending

@Zenexer
Zenexer / escapeshellrce.md
Last active Sep 10, 2019
Security Advisory: PHP's escapeshellcmd and escapeshellarg are insecure
View escapeshellrce.md

Paul Buonopane paul@namepros.com at NamePros
PGP: https://keybase.io/zenexer

I'm working on cleaning up this advisory so that it's more informative at a glance. Suggestions are welcome.

This advisory addresses the underlying PHP vulnerabilities behind Dawid Golunski's [CVE-2016-10033][CVE-2016-10033], [CVE-2016-10045][CVE-2016-10045], and [CVE-2016-10074][CVE-2016-10074]. It assumes prior understanding of these vulnerabilities.

This advisory does not yet have associated CVE identifiers.

Summary

@kekru
kekru / Docker connect to remote server.md
Last active Dec 8, 2019
Connect to another host with your docker client, without modifying your local Docker installation
View Docker connect to remote server.md

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@himanshuvirmani
himanshuvirmani / DatabaseConfiguration.java
Created Sep 26, 2016
SpringBoot Multiple DB Connections using Routing DataSource
View DatabaseConfiguration.java
@Configuration
@EnableJpaAuditing(dateTimeProviderRef = "dateTimeProvider")
@EnableJpaRepositories("com.sample.repository")
@EnableTransactionManagement
public class DatabaseConfiguration implements EnvironmentAware {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
private RelaxedPropertyResolver dataSourcePropertyResolver;
private RelaxedPropertyResolver slaveDataSourcePropertyResolver;
@stronk7
stronk7 / pre-push
Last active Feb 14, 2018
pre-push hook to avoid Moodle upstream branches to perform travis builds all the time
View pre-push
#!/bin/bash
# pre-push hook to enable/disable travis push builds
# based on the nature of the pushed branches.
# - upstream and deleted ones won't be built.
# - development ones will be built.
# Requires travis (client) gem binary installed.
# Useful for people wanting to keep their upstream branches updated,
# and not causing them to perform travis builds all the time, like me :-)
IFS=' '
hasupstreambranch=
@spalladino
spalladino / mysql-docker.sh
Created Dec 22, 2015
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mrverrall
mrverrall / rhel7-moodle.sh
Last active Apr 23, 2019
A script that installs and configures all the core components for moodle on RHEL/Centos 7 leaving you with a running site complete with AV scanning and Memcached
View rhel7-moodle.sh
#!/bin/bash
#
# This Bash script installs Moodle (http://moodle.org) and all it's
# requirements into a freshly installed Centos or RHEL 7 operating system.
# It assumes an 'Enforced' SELinux environment and configures the system
# accordingly.
#
# It is designed to be instructional and clear to read to persons unfamiliar
# with Bash and as such does *no* sanity checking before taking actions.
# Becasue of this *great* care should be taken if you feel the urge to run
View run_behat_tests_locally_parallel.sh
#!/bin/bash
################################
#!# SiteId=behat_whole_suite_m
#!# OutputFormat=moodle_progress,junit
################################
# Optional Params.
if [ -z "${BehatProfileToUseOnDay}" ]; then
BehatProfileToUseOnDay="default default default default default default default"
fi
if [ -z "${SELENIUMPORT}" ]; then
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Dec 15, 2019
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@duggan
duggan / check.php
Last active Jul 24, 2017
Get latest versions of a list of PHP PECL extensions
View check.php
<?php
/*
* Usage:
* $ php check.php --extensions="apc memcached redis"
* apc: 3.1.13
* memcached: 2.2.0
* redis: 2.2.5
*/
class PHPExtensionUpdates {
You can’t perform that action at this time.