Skip to content

Instantly share code, notes, and snippets.

View mageddo's full-sized avatar
💭
🚲 🍺

Elvis Souza mageddo

💭
🚲 🍺
View GitHub Profile
@mageddo
mageddo / README.md
Created May 2, 2016 16:59
Setup fixed font JDK

Downloading and installing the fixed jdk (First way)

$ JDK_LINK="http://googledrive.com/host/0BwBEh4QJvkXjQzIxSFJtal9LNXM" # x64 bits
$ TAR_NAME="/tmp/jdk1.8.0-amd64-font-fixed.tar.xz"
$ curl -L $JDK_LINK > $TAR_NAME
tar: jdk1.8.0-amd64-font-fixed/man/ja: Cannot create symlink to ‘ja_JP.UTF-8’: File exists # no problem here
tar: Exiting with failure status due to previous errors
$ sudo tar -xf $TAR_NAME -C /opt/
@mageddo
mageddo / README.md
Last active May 2, 2016 17:18
Fix intellij idea swing ugly fonts
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@mageddo
mageddo / docker-compose.yml
Last active May 16, 2016 16:03
Rabbit server and admin using docker example
rabbitmq:
image: rabbitmq:3.6.1-management
ports:
- "15672:15672"
- "5672:5672"
hostname: "rabbitmq.dev.intranet"
volumes:
- /var/lib/rabbitmq:/var/lib/rabbitmq
@mageddo
mageddo / README.md
Last active May 19, 2016 01:58
Dockerized phpmyadmin

Dockerized phpmyadmin

@mageddo
mageddo / sql.sql
Created May 19, 2016 01:59
Remover itens duplicados considerando uma chave que se repete
/* schema */
CREATE TABLE `item` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`user_id` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
CREATE TABLE `user` (
@mageddo
mageddo / CustomApplicationContextLoader.java
Last active May 21, 2016 02:00
Start hsqldb server at spring
public class CustomApplicationContextLoader extends SpringApplicationContextLoader {
@Override
public ApplicationContext loadContext(MergedContextConfiguration config) throws Exception {
final HyperSqlDbServer hyperSqlDbServer = new HyperSqlDbServer();
hyperSqlDbServer.start();
return super.loadContext(config);
}
}
@mageddo
mageddo / README.md
Created June 13, 2016 15:07
Show Hibernate SQL programatically in debug

In your expression evaluate at IDE run the follow:

org.apache.log4j.LogManager.getLogger("org.hibernate.SQL").setLevel(Level.TRACE);
org.apache.log4j.LogManager.getLogger("org.hibernate.type").setLevel(Level.TRACE);
((ch.qos.logback.classic.Logger)LoggerFactory.getLogger("org.hibernate.type")).setLevel(Level.ALL);
((ch.qos.logback.classic.Logger)LoggerFactory.getLogger("org.hibernate.SQL")).setLevel(Level.ALL);
java.util.logging.Logger.getLogger("org.hibernate.SQL").setLevel(Level.ALL);
java.util.logging.Logger.getLogger("org.hibernate.type").setLevel(Level.ALL);
@mageddo
mageddo / EmbeddedMessageQueueResource.java
Created February 15, 2017 16:43 — forked from mlaccetti/EmbeddedMessageQueueResource.java
Apache QPid as embedded MQ broker
package laccetti.test;
import org.apache.qpid.server.Broker;
import org.apache.qpid.server.BrokerOptions;
import com.google.common.io.Files;
/**
* We shouldn't need external things for testing
*/
@mageddo
mageddo / _service.md
Created April 30, 2017 19:46 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)