Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nyxcalamity
nyxcalamity / smtp-mail-check.py
Last active August 29, 2015 14:08
A simple mail checker script.
#!/usr/bin/env python
"""
Copyright 2014 CRX Markets S.A.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@nyxcalamity
nyxcalamity / socket-monitoring.sh
Created April 22, 2015 10:40
Socket monitoring script
##!/bin/bash
#Performs socket monitoring for specific port and outputs the result to a file.
#
#Parameters:
#1st: log file (default:socket-monitoring.sh.csv)
#2nd: number of checks per 1 sec (default:2)
#3rd: port (default:61622)
#
#Example:
# socket-monitoring.sh /media/ws/rhel-socket-monitoring.log 2 61622
@nyxcalamity
nyxcalamity / checkstyle.xml
Last active December 30, 2015 04:19
checkstyle config file for crxmarkets
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!-- NOTE: Change formatting of PackageName if you need a generic config. -->
<module name="Checker">
<!-- Checks that property files contain the same keys. -->
<module name="Translation"/>
@nyxcalamity
nyxcalamity / findbugs.xml
Created December 6, 2013 15:02
FindBugs config file.
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Bug pattern="BC_IMPOSSIBLE_DOWNCAST"/>
</Match>
<Match>
<Bug pattern="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY"/>
</Match>
<Match>
<Bug pattern="EC_INCOMPATIBLE_ARRAY_COMPARE"/>
@nyxcalamity
nyxcalamity / pmd.xml
Created December 6, 2013 15:04
pmd config file.
<?xml version="1.0" encoding="UTF-8"?>
<ruleset>
<description>QP Backend</description>
<rule ref="rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException">
<priority>4</priority>
</rule>
<rule ref="rulesets/basic.xml/EmptyInitializer">
<priority>4</priority>
</rule>
<rule ref="rulesets/strings.xml/AvoidStringBufferField">
@nyxcalamity
nyxcalamity / jar-libs-modifier.sh
Last active December 31, 2015 01:49
Removes old libs from a jar and adds new libs to it. Perfect for adding new eclipselink to glassfish-3.1.2.2-embedded jar.
#!/bin/bash
#DESCRIPTION:
#Generates a new jar in which:
#-Classes from all jars in $OLD_LIBS are removed
#-Files fron all jars in $NEW_LIBS are added (except META-INF dir, *.html, anything with "LICENCE")
#
#REQUIRES:
#-Installed jar and/or keytool
#
#HOW TO USE:
@nyxcalamity
nyxcalamity / backup.sh
Created December 21, 2013 13:18
script for complete system and data backup
#!/bin/bash
#Performs a recursive directory backup by copying it to a specified location in a raw format.
#Usefull rsync shortcuts:
#-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
#-n, --dry-run perform a trial run with no changes made
#-h, --human-readable output numbers in a human-readable format
#-W, --whole-file copy files whole (w/o delta-xfer algorithm)
#--del an alias for --delete-during
#--delete-during receiver deletes during xfer, not before
#--log-file=FILE log what we're doing to the specified FILE
@nyxcalamity
nyxcalamity / xvfb
Last active April 25, 2016 15:16
/etc/init.d/xvfb service script
XVFB=/usr/bin/Xvfb
XVFB_ARGS=":1 -ac -screen 1 1600x1200x24"
XVFB_LOG=/var/log/xvfb
case "$1" in
start)
echo -n "Starting Xvfb: "
$XVFB $XVFB_ARGS 1>&2 2> $XVFB_LOG &
echo "OK"
;;
@nyxcalamity
nyxcalamity / gf-local-cleanup.sh
Last active November 14, 2017 06:24
Utility scripts to clean up glassfish domain folders to avoid permgen exception
#!/bin/bash
#Cleans up glassfish domain folders so that the maven deployment with cargo doesn't hang.
#---------------------------------------------------------------------------------------------------
# CUSTOMIZATION SECTION START
#---------------------------------------------------------------------------------------------------
export GF_DIR=/home/nyxcalamity/ws/appservers/glassfish
#---------------------------------------------------------------------------------------------------
# CUSTOMIZATION SECTION END
#---------------------------------------------------------------------------------------------------
export OK="$(tput setaf 2) DONE$(tput sgr0)"