24 Mayıs 2013 Cuma

JBoss - Data source parolalarını şifrelemek

JBOSS_HOME dizinininde şifre için encryption yapılır:


java -cp client/jboss-logging-spi.jar:lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule <PASSWORD>


data source dosyasında tanımlanan security domain:


<?xml version="1.0" encoding="UTF-8"?>
<datasources>
    <local-tx-datasource>
        <jndi-name>PostgresDS</jndi-name>
        <connection-url>jdbc:postgresql://127.0.0.1:5432/test?protocolVersion=2</connection-url>
        <driver-class>org.postgresql.Driver</driver-class>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>20</max-pool-size>

        <!-- REPLACED WITH security-domain BELOW
        <user-name>admin</user-name>
        <password>password</password>
        -->

        <security-domain>EncryptDBPassword</security-domain>

        <metadata>
            <type-mapping>PostgreSQL 8.0</type-mapping>
        </metadata>
    </local-tx-datasource>
</datasources>
 
 
JBOSS_HOME/server/server_adı/conf/login/login-config.xml dosyasında, ilgili security-domain'e ait otantikasyon bilgileri eklenir:



<application-policy name = "EncryptedHsqlDbRealm">
   <authentication>
      <login-module code = "org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule"
       flag = "required">
          <module-option name = "username">sa</module-option>
          <module-option name = "password">E5gtGMKcXPP</module-option>
          <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
          <module-option name = "jaasSecurityDomain">jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</module-option>
       </login-module>
    </authentication>
 </application-policy>


önceden üretilen şifre, buradaki password alanına girilmelidir.

JBoss restart'ı ile değişiklikler aktive olur.

23 Mayıs 2013 Perşembe

Solaris - IP konfigürasyonunu görüntülemek

/usr/sbin/ifconfig -a

Solaris - Tar

tar czf name_of_archive_file.tar.gz name_of_directory_to_tar
tar xzf name_of_archive_file.tar.gz name_of_directory_to_tar

Cacerts dosyasına yeni sertifika eklemek

To add a certificate to the cacerts store


  1. At a command prompt that is set to your JDK's jdk\jre\lib\security folder, run the following to see what certificates are installed:
    keytool -list -keystore cacerts
    You'll be prompted for the store password. The default password is changeit. (If you want to change the password, see the keytool documentation at http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/keytool.html.) This example assumes that the certificate with MD5 fingerprint 67:CB:9D:C0:13:24:8A:82:9B:B2:17:1E:D1:1B:EC:D4 is not listed, and that you want to import it (this particular certificate is needed by the Twilio API service).
  2. Obtain the certificate from the list of certificates listed at GeoTrust Root Certificates. Right-click the link for the certificate with serial number 35:DE:F4:CF and save it to the jdk\jre\lib\security folder. For purposes of this example, it was saved to a file named Equifax_Secure_Certificate_Authority.cer.
  3. Import the certificate via the following command:
    keytool -keystore cacerts -importcert -alias equifaxsecureca -file Equifax_Secure_Certificate_Authority.cer
    When prompted to trust this certificate, if the certificate has MD5 fingerprint 67:CB:9D:C0:13:24:8A:82:9B:B2:17:1E:D1:1B:EC:D4, respond by typing y.
  4. Run the following command to ensure the CA certificate has been successfully imported:
    keytool -list -keystore cacerts
  5. Zip the JDK and add it to your Windows Azure project's approot folder.

For information about keytool, see http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/keytool.html.

22 Mayıs 2013 Çarşamba

Linux - Proxy ayarları

http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/

SVN - revizyon numarasına güncellemek

svn up -r 2147 config.java

Awk - linux swap colunms

awk 'BEGIN {FS=OFS=":"} {temp=$1; $1=$2; $2=temp} {print}' input.txt

10 Mayıs 2013 Cuma

Powershell - alt dizinlerde .svn dizinlerinden kurtulmak

powershell
gci -fil '.svn' -r -force | ri -r -force