Skip to content

Instantly share code, notes, and snippets.

View smiklosovic's full-sized avatar

Štefan Miklošovič smiklosovic

View GitHub Profile
/*
* Added additional null checks when closing the ResultSet and Statements.
*
* Thanks to pihug12 and Grzegorz Oledzki at stackoverflow.com
* http://stackoverflow.com/questions/5332149/jdbc-scriptrunner-java-lang-nullpointerexception?tab=active#tab-top
*/
/*
* Modified: Use logWriter in print(Object), JavaDoc comments, correct Typo.
*/
/*
@derEremit
derEremit / gource-multiple-repositories.sh
Created November 8, 2011 14:58 — forked from anonymous/gource-multiple-repositories.sh
Generates gource video out of multiple repositories.
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <this.sh> /path/to/repo1 /path/to/repo2
RESOLUTION="1600x1080"
outfile="gource.mp4"
i=0
@di
di / Screenshot.java
Created February 17, 2012 17:53
The whole screenshot class
import java.io.File;
import java.io.IOException;
import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.RawImage;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
@devoncrouse
devoncrouse / MessageConsumer.java
Created July 25, 2013 16:52
Simple class to consume from a Kafka topic
import java.util.List;
import java.nio.ByteBuffer;
import java.io.IOException;
import kafka.consumer.Consumer;
import kafka.consumer.ConsumerConfig;
import kafka.consumer.ConsumerIterator;
import kafka.consumer.KafkaStream;
import kafka.javaapi.consumer.ConsumerConnector;
@kpiwko
kpiwko / gist:6363711
Created August 28, 2013 08:47
JBoss Nexus Staging repository
<profile>
<id>jboss-staging-repository-group</id>
<repositories>
<repository>
<id>jboss-staging-repository-group</id>
<name>JBoss Staging Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/staging</url>
<layout>default</layout>
<releases>
@tomster
tomster / gist:7585211
Last active July 5, 2018 09:16
bootstrap a freebsd 9.2 host with ansible. it requires a password for the root user to be set for which it will prompt you (-k). you must use the paramiko transport to allow password based login. based on https://gist.github.com/illenseer/6390361
---
# run this with ansible-playbook -i ansible_hosts bootstrap.yml -k -c paramiko
- hosts: jails_host
gather_facts: false
remote_user: root
tasks:
- name: install pkgng
raw: "pkg_info | grep -v 'pkg-' > /dev/null ; if $? pkg_add -r pkg; rehash ; pkg2ng; echo 'WITH_PKGNG=yes' >> /etc/make.conf; echo 'packagesite: http://pkgbeta.freebsd.org/freebsd%3A9%3Ax86%3A64/latest' >> /usr/local/etc/pkg.conf; pkg update ; pkg upgrade -y"
- name: install python27
raw: "pkg install -y python27"
@kpiwko
kpiwko / gist:b96abdb8a13586b63a7d
Created November 4, 2014 12:50
Missing artifacts in Maven Central for AS 7.2.0
Not in Maven Central: com.sun.faces:jsf-impl:jar:2.1.18-jbossorg-1
Not in Maven Central: com.sun:tools:jar:1.6
Not in Maven Central: org.jacorb:jacorb:jar:2.3.2.jbossorg-4
Not in Maven Central: org.jboss.as:jboss-as-client-all:jar:7.2.0.Final
Not in Maven Central: org.jboss.as:jboss-as-clustering-common:jar:tests
Not in Maven Central: org.jboss.as:jboss-as-osgi-configadmin:bundle:7.2.0.Final
Not in Maven Central: org.jboss.as:jboss-as-osgi-http:bundle:7.2.0.Final
Not in Maven Central: org.jboss.as:jboss-as-osgi-jpa:bundle:7.2.0.Final
Not in Maven Central: org.jboss.byteman:byteman-bmunit:jar:2.0.1
Not in Maven Central: org.jboss.byteman:byteman-install:jar:2.0.1
@sebastienblanc
sebastienblanc / gist:9615439c67968ecb92da
Last active December 4, 2018 08:02
Add a new platform in the UnifiedPush Server

Add a new platform in the UnifiedPush Server

This is simple checklist for those who would like to add a new Push Platform support to UPS (like Blackberry hint for the community hint).

Adapt the Model

  • Start by updating the Variant Enum class by adding your platform

  • Create a subclass of the Variant base class , add any properties that are specific to this platform (like API keys, secrets etc ...)

@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@Eng-Fouad
Eng-Fouad / ssl-certs.md
Last active June 23, 2024 05:50
Generate self-signed PKCS#12 SSL certificate and export its keys using Java keytool and openssl.

Steps to generate self-signed PKCS#12 SSL certificate and export its keys:

1- Create PKCS#12 keystore (.p12 or .pfx file)

keytool -genkeypair -keystore myKeystore.p12 -storetype PKCS12 -storepass MY_PASSWORD -alias KEYSTORE_ENTRY -keyalg RSA -keysize 2048 -validity 99999 -dname "CN=My SSL Certificate, OU=My Team, O=My Company, L=My City, ST=My State, C=SA" -ext san=dns:mydomain.com,dns:localhost,ip:127.0.0.1
  • myKeystore.p12 = keystore filename. It can with .pfx extension as well.
  • MY_PASSWORD = password used for the keystore and the private key as well.
  • CN = commonName, it will be shown as certiciate name in certificates list.
  • OU = organizationUnit, department name for example.