Skip to content

Instantly share code, notes, and snippets.

@rand0m86
rand0m86 / downgrademysql.md
Created January 17, 2017 16:35 — forked from Voronenko/downgrademysql.md
Downgrade mysql to mysql 5.6 on xenial

Install MySQL 5.6 in Ubuntu 16.04

Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range of backwards compatibility issues with code written against older MySQL versions.

Oracle maintains a list of official APT repositories for MySQL 5.6, but those repositories do not yet support Ubuntu 16.04. However, the 15.10 repos will work for 16.04.

Uninstall existing mysql 5.7 if any

sudo apt remove mysql-client mysql-server libmysqlclient-dev mysql-common
@rand0m86
rand0m86 / spring-circular.xml
Created February 11, 2015 11:16
Spring circular dependency resolution
<bean id="serviceA" class="com.ServiceA" lazy-init="true">
<property name="serviceB" ref="serviceB"/>
</bean>
<bean id="serviceB" class="com.ServiceB">
<property name="serviceA" ref="serviceAProxy"/>
</bean>
<bean id="serviceAProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="targetSource">
@rand0m86
rand0m86 / upstart.conf
Last active December 30, 2015 11:29 — forked from tzachz/gist:5047526
Sample upstart script
author "Your Name"
description "upstart script for sample-dw-service"
# respawn the job up to 5 times within a 10 second period.
# If the job exceeds these values, it will be stopped and
# marked as failed.
respawn
respawn limit 5 10
# move to this service's working directory
@rand0m86
rand0m86 / D3-update.js
Last active December 27, 2015 20:59
General update pattern D3
function update(data) {
// DATA JOIN
// Join new data with old elements, if any.
var text = svg.selectAll("text")
.data(data);
// UPDATE
// Update old elements as needed.
text.attr("class", "update");
@rand0m86
rand0m86 / grant.sql
Last active December 26, 2015 05:08
Create DB user and grant him access
grant all privileges on mydb.* to myuser@localhost identified by 'mypasswd';
@rand0m86
rand0m86 / sample-arquillian.java
Last active December 26, 2015 05:08
Arquillian save archive to disk
archive.as(ZipExporter.class).exportTo(
new File("C:/myPackage.jar"), true);
return archive;