Skip to content

Instantly share code, notes, and snippets.

View altitdb's full-sized avatar

Altieres de Matos altitdb

View GitHub Profile
netsh interface portproxy add v4tov4 listenport=1521 listenaddress=127.0.0.1 connectport=1521 connectaddress=192.168.56.101
@altitdb
altitdb / win-ruby-ssl-error.md
Created October 20, 2016 00:56 — forked from eyecatchup/win-ruby-ssl-error.md
SSL Error with Ruby on Windows when trying to install a gem from command line.

[Solved] The SSL_connect returned=1 errno=0 state=SSLv3 read server certificate-Error on Ruby for Windows

The Issue

When you try to install (or update) a Ruby gem from your Windows command line and get an error like, for example, the following:

> gem install compass
ERROR:  Could not find a valid gem 'compass' (>= 0), here is why:
        Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/latest_specs.4.8.gz)
import java.util.regex.Pattern;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
/**
*
* @author Altieres de Matos
*/
public class DocumentRightLeft extends PlainDocument {
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import javax.swing.text.SimpleAttributeSet;
/**
*
* @author Altieres de Matos
*/
public class DocumentMoney extends PlainDocument {
@altitdb
altitdb / gist:775c987e58dcf858e7f2
Created June 23, 2015 15:23
Implementação da validação de XML com XSD
private void OutputJaxpImplementationInfo() {
System.out.println(getJaxpImplementationInfo("DocumentBuilderFactory", DocumentBuilderFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("XPathFactory", XPathFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("TransformerFactory", TransformerFactory.newInstance().getClass()));
System.out.println(getJaxpImplementationInfo("SAXParserFactory", SAXParserFactory.newInstance().getClass()));
}
private String getJaxpImplementationInfo(String componentName, Class componentClass) {
CodeSource source = componentClass.getProtectionDomain().getCodeSource();
return MessageFormat.format(
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@altitdb
altitdb / gist:5974611
Created July 11, 2013 11:19
Adicionar/Retirar "lock" ao user
@Oracle
Adicionar/Retirar "lock" ao user
alter user MY_USER account lock;
alter user MY_USER account unlock
@altitdb
altitdb / gist:5554338
Created May 10, 2013 13:19
Habilitar/Desabilitar Constraints (FK)
@Oracle
Habilitar/Desabilitar Constraints (FK)
set heading off
spool C:\file.sql;
select 'alter table '||table_name||' OPERATION constraint '||constraint_name||';'
from user_constraints u
where u.constraint_type = 'R';
spool off
@altitdb
altitdb / gist:5212595
Created March 21, 2013 12:13
Alterar tamanho tablespace
@Oracle
Alterar tamanho tablespace
alter user MY_USER quota unlimited on MY_TABLESPACE;
@altitdb
altitdb / gist:5204125
Created March 20, 2013 11:59
Retirar lock de usuário
@Oracle
Retirar lock de usuário
alter user MY_USER account unlock;