Skip to content

Instantly share code, notes, and snippets.

View wizardjedi's full-sized avatar

Sayapin Alexander wizardjedi

View GitHub Profile
@wizardjedi
wizardjedi / app-context.xml
Last active October 12, 2015 06:58
Most full spring framework XML context file template
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:batch="http://www.springframework.org/schema/batch"
@wizardjedi
wizardjedi / logback.xml
Last active May 3, 2017 12:54
Logback and slf4j dependencies for pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<jmxConfigurator />
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
@wizardjedi
wizardjedi / gdb-heap-dump.sh
Last active July 4, 2019 09:44
Script for creating heap dump of running application using gdb
#!/bin/bash
# atlassian-heap-dump.sh - dump a heap using GDB for a crashed application
# Accepts a single argument: the PID of the JVM
# Author: James Gray ([email protected])
# Source: http://blogs.atlassian.com/2013/03/so-you-want-your-jvms-heap/
# Copyright Atlassian P/L
# License: MIT
# Are we root?
@wizardjedi
wizardjedi / smppsim.default
Created November 28, 2014 14:48
smppsim.sh
# Default port
PORT=2775
# Default JS-handler
# JS_HANDLER=3.js
@wizardjedi
wizardjedi / svn-to-git.sh
Last active August 29, 2015 14:12
svn to git
# install git-svn
$ sudo apt-get install git-svn
# create author map
$ svn log svn://svn.example.com/repository/path/ | sed -ne 's/^r[^|]*| \([^ ]*\) |.*$/\1 = \1 <\[email protected]>/p' | sort -u > author-map
$ git svn init svn://svn.devel.a1s/sms_traffic/trunk/ --no-metadata
$ git config svn.authorsfile author-map
$ git svn fetch
# git add remote
$ git remote add origin git://url
$ git push origin master
@wizardjedi
wizardjedi / create-docker-image.sh
Last active August 29, 2015 14:13
Create docker image from OS image
sudo apt-get install debootstrap dchroot
mkdir tmp-os
sudo debootstrap --arch i386 --variant=minbase stable os-tmp http://ftp.debian.org/debian/
sudo chroot os-tmp /bin/bash
apt-get update && apt-get install curl vim mc wget
Package: tmp
Version: 0.1
Maintainer: Huy Morzhoviy <[email protected]>
Architecture: all
Depends:
Description: Source simple package
@wizardjedi
wizardjedi / control
Created January 31, 2015 09:15
simple create debian package (with dpkg -b)
Package: tmp
Version: 0.2
Maintainer: Huy Morzhoviy <[email protected]>
Architecture: all
Depends:
Description: Source simple package
BEGIN {
delivered=0;
}
{
if (delivered>19 && int($3)>0) {
print $2 ";" $3
delivered = 0;
} else {
print $1 ";" $3
@wizardjedi
wizardjedi / kafka.md
Last active August 29, 2015 14:15 — forked from ashrithr/kafka.md

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic