Skip to content

Instantly share code, notes, and snippets.

View guaxinim's full-sized avatar

Elvis Rocha guaxinim

  • Red Hat
  • Brasilia - Brazil
View GitHub Profile
@guaxinim
guaxinim / criptografia_datasource_eap6
Last active December 17, 2015 08:08
Criptografia de datasource - JBoss EAP 6
Criptografia de datasource - JBoss EAP 6
1° Gerar o keystore:
keytool -genkey -alias nome_do_alias -keystore arquivo_do_keystore
Exemplo: keytool -genkey -alias jboss -keystore /opt/jboss-eap-6.0/jboss.crypto.keystore
Senha: fndejboss123
2° Encriptando a senha:
Executar o script vault.sh que está na pasta bin
/opt/jboss-eap-6.0/bin/vault.sh
@guaxinim
guaxinim / exploded_war_CLI
Created May 14, 2013 17:01
Deploy exploded war via CLI
Fazer deploy de war explodido via CLI
Adicionando o path do deploy em /deployment
/deployment=neo.war:add(runtime-name="neo.war",content=[{"path"=>"/opt/deploy/neo.war","archive"=>"false"}])
Adicionando o deploy no grupo
/server-group=grupo-fnde/deployment=neo.war:add(runtime-name="neo.war",content=[{"path"=>"/opt/deploy/neo.war","archive"=>"false"}],enabled=true)
{
"outcome" => "success",
@guaxinim
guaxinim / dynamic_binding
Created May 14, 2013 17:03
Dynamic JNDI Bindings on EAP 6
JNDI Bindings lookup dinamico:
<subsystem xmlns="urn:jboss:domain:naming:1.1" >
<bindings>
<simple name="java:global/a" value="100" type="int" />
<object-factory name="java:global/b" module="com.acme" class="org.acme.MyObjectFactory" />
<lookup name="java:global/c" lookup="java:global/b" />
</bindings>
</subsystem>
@guaxinim
guaxinim / too_many_open_files_error
Last active December 17, 2015 08:08
Too many open files error on JBoss EAP 6
Too many open files (JBoss AS 7.0.2)
Erro por causa do ulimit do usuário.
jboss soft 10240
jboss hard 10240
/root/.bashrc
ulimit -n 10240 (aumentou em 10x)
@guaxinim
guaxinim / format_exception
Created May 14, 2013 17:07
Format EAP 6 error on server.log
On vi editor use:
:%s/START/\r&/g
@guaxinim
guaxinim / eap6_remote_jmx
Created May 14, 2013 17:17
Acesso ao JBoss EAP 6 remoto via VisualVM
JBoss implements a JSR 160 compliant JMXConnector instead of an RMI interface to establish a connection to a JMX MBeanServer form a remote client.
There is no need for any additional JVM options. The JMXConnector uses under the hood JBoss Remoting for the transport and by default the native management endpoint of the AS7 if the server is running in the standalone mode.
To access the management endpoints a management user in the realm ManagementRealm is required
add the user: ./add-user.sh
Add the folowing libs on classpath:
org/jboss/remoting3/remoting-jmx
org/jboss/remoting3
Sub Macro_PreencheColunaA()
Dim quantidade As Integer
Dim asque As Integer
asque = 65
Dim cela As Integer
cela = 14
quantidade = cela + 9
Dim coluna As Integer
coluna = 4
Dim valorCelula As String
@guaxinim
guaxinim / Macro Excel
Created September 6, 2016 20:10
Macro de preenchimento automático no excel
Private Sub CommandButton1_Click()
Dim quantidade As Integer
Dim asque As Integer
asque = 65
Dim cela As Integer
cela = ActiveCell.Row
quantidade = cela + Cells(1, 9) - 1
Dim coluna As Integer
@guaxinim
guaxinim / java_trust_ca
Created December 3, 2017 00:11
Create a java app in a container that trusts in a specific CA
1) Create a Dockerfile build with FROM pointing at one of app base images (call it `example-com-eap7`)
2) ADD or COPY example.com's CA (for EAP, this looks something like `ADD configs/certs/cacerts_JDK8 /etc/pki/ca-trust/extracted/java/cacerts`)
3) Create new apps based on `example-com-eap7` (`oc new-app example-com-eap7~...`)
The jist is, if you can add the pertinent files to `/etc/pki/ca-trust/` then the apps & pods should be good.
for i in $(oc get projects | grep Terminating| awk '{print $1}'); do echo $i; oc get serviceinstance -n $i -o yaml | sed "/kubernetes-incubator/d"| oc apply -f - ; done
for i in $(oc get projects | grep Terminating| awk '{print $1}'); do echo $i; oc get servicebinding -n $i -o yaml | sed "/kubernetes-incubator/d"| oc apply -f - ; done