This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rpm | |
wget --no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \ | |
-O jdk-7-linux-x64.rpm | |
# ubuntu | |
wget --no-cookies \ | |
--no-check-certificate \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserService service = new UserService(url); // Service class | |
port = service.getPort(IUser.class); // the HTTP port of the webservice | |
Client client = ClientProxy.getClient(port); | |
HTTPConduit http = (HTTPConduit) client.getConduit(); | |
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); | |
httpClientPolicy.setConnectionTimeout(30000); //the timeout in milli | |
httpClientPolicy.unsetReceiveTimeout(); | |
http.setClient(httpClientPolicy); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import org.hibernate.Session; | |
import org.hibernate.StatelessSession; | |
import org.springframework.stereotype.Repository; | |
@Repository | |
public class StatelessRepository { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
import java.time.Instant; | |
import java.time.ZoneId; | |
import java.time.ZonedDateTime; | |
import java.time.zone.ZoneOffsetTransition; | |
import java.time.zone.ZoneRules; | |
public class TimezoneList { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
redis: | |
image: redis | |
container_name: dev_redis | |
hostname: redis | |
environment: | |
- TZ=America/Sao_Paulo | |
ports: | |
- "6379:6379" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/react-brasil/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
container_name: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
networks: | |
- network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoDB Replication | |
Replication is the concept of maintaining multiple copies of your data. | |
This is a really important concept in MongoDB, but really in any database system. | |
The main reason why replication is necessary is because you can never assume that all of your servers will always be available. | |
Whether you have to perform maintenance on a data center or a disaster wipes out your data entirely, your servers will experience downtime at some point. | |
The point of replication is to make sure that in the event your server goes down, you can still access your data. | |
This concept is called availability. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoDB Replica Set | |
Replica sets or groups of mongods that share copies of the same information between them. | |
Replica set members can have one of two different roles. | |
The either can be primary node where all reads and all writes are served by this node. | |
Or secondary node where the responsibility of this node is to replicate all of the information, and then serve as a high availability to node in case of failure of the primary. | |
The secondaries will get the data from the primary through an asynchronous replication mechanism. | |
Every time an application writes some data to the replica set, that right is handled by the primary node. | |
And then data gets replicated to the secondary nodes. | |
Now this replication mechanism is based out of a protocol that manages the way that the secondaries should read data from the primary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoDB Setting up a replica set | |
The configuration file for the first node (/data/node1.conf): | |
storage: | |
dbPath: /var/mongodb/db/node1 | |
net: | |
bindIp: 192.168.103.100,localhost | |
port: 27011 | |
security: | |
authorization: enabled |