Postgresql tips

11 Ağustos 2015 Yorum bırakın

Export specific rows from a PostgreSQL table as INSERT SQL script

pg_dump --table=export_table --data-only --column-inserts my_database > data.sql

Import from a PostgreSQL SQL script dump

psql -h localhost -U postgres platformdb_yeni < ruleExport.sql
Kategoriler:Kategori Edilmemiş

How to create spring-based executable jar with maven?

Very likely what has happened is the files which provides meta data to Spring about the location of the custom namespace handlers(spring.schema, spring.handlers) have ended up overwriting each other when you created the big(uber) jar.

To clarify this a little more, if you are using context name space say – context:property-placeholder-configurer, the information about how to parse this namespace is using a spring.handlers file in spring-context.jar!:/META-INF/spring.handlers file, a similar file is present in other spring jar files for other custom namespaces support. Now, when you create the Uber jar, since the location of the handler file is exactly the same, one spring.handler file will end up overwriting the others, and you see the error that you are seeing. Some potential fixes are described here, where some alternate ways of creating the executable jar is suggested:

add the following configuration after

<plugin>
  <executions>
    <execution>
      <configuration>
        <transformers>

so that the contents of the .schema files from all the jars get appended together.

<configuration>
  <transformers>
    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
      <resource>META-INF/spring.handlers</resource>
    </transformer>
    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
      <resource>META-INF/spring.schemas</resource>
    </transformer>
  </transformers>
</configuration>
Kategoriler:Programlama

Java Console uygulamasının Linux (Centos) üzerinde servis haline getirilmesi

01 Kasım 2014 Yorum bırakın

1. Create the start and the stop script of your application. Put it on some directory, in our example is:

Start Script: /usr/local/bin/myapp-start.sh
Stop Script: /usr/local/bin/myapp-stop.sh
Each one will provide the instructions to run/stop the app. For instance the myapp-start.sh content can be as simple as the following:

#!/bin/bash
java -jar myapp.jar

For the stop script it can be something like this:

#!/bin/bash
# Grabs and kill a process from the pidlist that has the word myapp
pid=`ps aux | grep myapp | grep -v 'grep' | awk '{print $2}'`
kill -15 $pid

2. Create the following script (myapp) and put it on /etc/init.d.

/etc/init.d/myscript content:

#!/bin/bash
# MyApp
#
# description: bla bla
case $1 in
 start)
 /bin/bash /usr/local/bin/myapp-start.sh
 ;;
 stop)
 /bin/bash /usr/local/bin/myapp-stop.sh
 ;;
 restart)
 /bin/bash /usr/local/bin/myapp-stop.sh
 /bin/bash /usr/local/bin/myapp-start.sh
 ;;
 esac
 exit 0

3. Give execute rights to all 3 scripts

chmode +x /usr/local/bin/myapp-start.sh
chmode +x /usr/local/bin/myapp-stop.sh
chmode +x /etc/init.d/myscript

4. Add these lines into myscript, including #, right after #!/bin/bash or #!/bin/sh:

# chkconfig: 2345 95 20
# description: Some description
# What your script does (not sure if this is necessary though)
# processname: myscript

5. Add script into services

#chkconfig --add myscript

6. Enable service

#chkconfig myscript on

7. Start/Stop Service

#service myscript start
#service myscript stop
Kategoriler:Kategori Edilmemiş Etiketler:, , ,

BPM (Business Process Management)

18 Temmuz 2012 Yorum bırakın

SÜREÇ
Bir kurumun hedeflerine ulaşabilmek için gerçekleştirdiği, tekrarlayan aktivite ve işlemlerin bütünü süreç olarak adlandırılır. Süreçler:

  • basit (örn: sipariş tamamlama) veya karmaşık (örn: yeni ürün geliştirme);
  • anlık (örn: yeni eleman alımı) veya sürekli (örn. mevzuata uyumluluk);
  • işleve özel (örn. teklif yönetimi) veya sektöre özel (örn. enerji tedariği);
  • tek departmanda (örn: tahsilat) veya kurum genelinde işliyor olabilirler.

BPM
BPM (Business Process Management) son yılların en çok konuşulan iş kavramlarından biri olmakla birlikte içeriği halen sorulan kişiye göre veya ele alındığı içeriğe göre farkılık gösterebiliyor. Peki gerçekte BPM nedir?

  1. İş Süreçlerini Yönetme Süreci
  2. Bir yönetim disiplini
  3. Teknoloji
  4. Hızlı Uygulama Geliştirme Platformu

Daha fazlasını oku…

Kategoriler:Programlama

Subversion behind an Apache Reverse Proxy

Subversion behind an Apache Reverse Proxy

A reverse proxy looks to the outside like a normal web server, but redirects requests to other (possibly invisible from outside) servers.

There are several reasons why one might want to put subversion behind a reverse proxy. The subversion server might be located in the intranet of an organisation, but has to be accessable from the outside or the administrator wants to separate several web-applications for better security, but still wants them to be visible under one server-name, to name just a few.

This tutorial is for Apache 2.x. Subversion needs Apache2.x, but the proxy part might also work with Apache 1.3

Warning: to make this work a little bit of compilation is needed (don’t worry, it is not much).

The DAV Protocol

Subversion uses the DAV (Distributed Authoring and Versioning) Protocol uses more methods than standard HTTP (eg. GET, COPY, MOVE) and more headers than standard HTTP. This must be taken into account for any Proxy configuration (be it reverse or standard).

Configuring Apache Proxy

The proxy side of Apache requires mod_proxy to work:

#load the module
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
#per default disallow all requests (for security)
ProxyRequests Off
<Proxy *>
  Order deny,allow
  Deny from all
</Proxy>
ProxyVia On

(normally this is already done in the preconfigured packages for your distribution)

Daha fazlasını oku…

Kategoriler:Kategori Edilmemiş

MQTT: MQ Telemetry Transport

09 Kasım 2011 Yorum bırakın

MQTT

http://mqtt.org

The MQTT protocol enables a publish/subscribe messaging model in an extremely lightweight way. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. For example, it has been used in remote sensors communicating to a broker via satellite link, over occasional dial-up connections with healthcare providers, and in a range of home automation and small sensor device scenarios. It is also ideal for mobile applications because of its small size, low power usage, minimised data packets, and efficient distribution of information to one or many receivers.

Kategoriler:Kategori Edilmemiş

Jelastic

Rock-solid Java in the Cloud
Easy to deploy. Runs ANY Java app.

Java Platform As A Service (PaaS)

Kategoriler:Programlama
Takip Et

Her yeni yazı için posta kutunuza gönderim alın.