Skip to content

Instantly share code, notes, and snippets.

View RagedUnicorn's full-sized avatar

Raged Unicorn RagedUnicorn

View GitHub Profile
@RagedUnicorn
RagedUnicorn / checkstyle_intellij_setup.md
Last active August 27, 2018 21:14
Setup Checkstyle for IntelliJ

Checkstyle IntelliJ Setup

In Settings > Plugins search for Checkstyle and install it. After restarting IntelliJ configure the plugin by navigating to Settings > Other Settings > Checkstyle

See checkstyle_settings.png

The configuration for basic RagedUnicorn projects can be found here: checkstyle-editor.xml

Checkstyle can be run in the tools window. See checkstyle_run.png.

@RagedUnicorn
RagedUnicorn / pmd_intellij_setup.md
Last active August 27, 2018 21:00
Setup PMD for IntelliJ

PMD IntelliJ Setup

In Settings > Plugins search for PMD and install it. After restarting IntelliJ configure the plugin by navigating to Settings > Other Settings > PMD

See pmd_settings.png

The configuration for basic RagedUnicorn projects can be found here: pmd-ruleset.xml

Run PMD by Tools > Run PMD > Custom Rules > [ruleset]

@RagedUnicorn
RagedUnicorn / pmd_suppress.md
Created August 27, 2018 20:33
PMD suppress warnings example

PMD Suppress Warnings

Simple examples of how PMD warnings can be suppressed.

Disable all PMD warnings in a class

@SuppressWarnings("PMD")
public class Foo {
  ...
}
@RagedUnicorn
RagedUnicorn / clean_mkv_title.bat
Created August 18, 2018 15:22
Setting mkv filename as metadata title
@echo off
REM This script takes all mkv files in the current directory and sets the filename (without .mkv) as its title in metadata
for %%x in (*.mkv) do (
mkvpropedit "%%x" --edit info --set "title=%%~nx"
)
pause
@RagedUnicorn
RagedUnicorn / docker_mysql_backup_and_restore.md
Created August 17, 2018 09:39
Docker backup or restory mysql

Docker MySQL Backup and Restore

Create a Backup

docker exec [CONTAINER] /usr/bin/mysqldump -u[user] -p[password] [DATABASE] > backup.sql

Restore a Backup

cat backup.sql | docker exec -i [CONTAINER] /usr/bin/mysql -u[user] -p[password] [DATABASE]

Note: Container in this case can be either part or the full container id or the full container name.

@RagedUnicorn
RagedUnicorn / windows_openssl_freeze.md
Last active October 21, 2022 05:13
Workaround OpenSSL freeze

Windows OpenSSL Bug

On windows certain OpenSSL versions seem to hang indefinitely on any command. This can be circumvented by prepending winpty before each command.

Hangs idenfinitely

openssl rsa -in .ssh/in.pem -out out.pem

Runs without a problem

@RagedUnicorn
RagedUnicorn / update_docker_stack_deployment.md
Last active August 17, 2018 09:22
Update a docker stack deployment

Update Docker Stack Deployment

A docker stack deployment can be updated by re-executing the deployment command.

docker stack deploy --compose-file=[docker-compose file] [stack-name]

An example where this could be used is if the image version changed. Simply change the docker-compose configuration to the newest version and then execute the above command.

@RagedUnicorn
RagedUnicorn / mangosd.conf.tpl
Last active February 8, 2019 17:10
A config template for tf-aws-wow-vanilla-server
#####################################
# MaNGOS Configuration file #
#####################################
[MangosdConf]
ConfVersion=2010100901
###################################################################################################################
# CONNECTIONS AND DIRECTORIES
#
@RagedUnicorn
RagedUnicorn / realmd.conf.tpl
Last active August 17, 2018 09:42
A config template for tf-aws-wow-vanilla-server
##################################4##########
# MaNGOS realmd configuration file #
############################################
[RealmdConf]
ConfVersion=2010062001
###################################################################################################################
# REALMD SETTINGS
#
@RagedUnicorn
RagedUnicorn / aws_device_farm_retrieve_files.md
Last active July 25, 2018 17:04
Aws device farm retrieve logfiles from runs

AWS Device Farm

Make sure to configure aws cli. Currently device farm is only supported in the us-west-2 region. Make sure to configure the aws cli to use this region.

aws configure

List your device farm projects

aws devicefarm list-projects