This file contains 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
@Bean | |
public RestTemplate restTemplate(RestTemplateBuilder builder) throws NoSuchAlgorithmException, KeyManagementException { | |
TrustManager[] trustAllCerts = new TrustManager[] { | |
new X509TrustManager() { | |
public java.security.cert.X509Certificate[] getAcceptedIssuers() { | |
return new X509Certificate[0]; | |
} | |
public void checkClientTrusted( | |
java.security.cert.X509Certificate[] certs, String authType) { |
This file contains 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
## script 1 | |
-- step 1 | |
select | |
c.owner, | |
c.object_name, | |
c.object_type, | |
b.sid, | |
b.serial#, | |
b.status, |
This file contains 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
package com.hprog99; | |
import java.io.BufferedReader; | |
import java.io.DataOutputStream; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import javax.net.ssl.HttpsURLConnection; | |
This file contains 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
/* Call SOAP URL and send the Request XML and Get Response XML back */ | |
import java.io.BufferedReader; | |
import java.io.ByteArrayOutputStream; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; |
This file contains 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
## PA 1: Import the certificate into the Java Store | |
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -file $CERT_FILE -storepass "changeit" -alias $ALIAS | |
## PA 2: run java app with arguments | |
java -Djavax.net.ssl.trustStore=my-domain.com.jks -Djavax.net.ssl.trustStorePassword=sb1234 Get https://selfsigned.my-domain.com | |
## PA 3: custom code | |
... |
This file contains 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
#!/bin/sh | |
SWAP_SIZE=4G | |
echo "create $SWAP_SIZE swap" | |
# on centos 6 | |
#fallocate -l $SWAP_SIZE /swapfile | |
# on centos 7 | |
dd if=/dev/zero of=/swapfile count=4096 bs=1MiB |
This file contains 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
create table oauth_client_details ( | |
client_id VARCHAR(256) PRIMARY KEY, | |
resource_ids VARCHAR(256), | |
client_secret VARCHAR(256), | |
scope VARCHAR(256), | |
authorized_grant_types VARCHAR(256), | |
web_server_redirect_uri VARCHAR(256), | |
authorities VARCHAR(256), | |
access_token_validity INTEGER, | |
refresh_token_validity INTEGER, |
This file contains 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 lombok.extern.slf4j.Slf4j; | |
import lombok.val; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; | |
import org.springframework.web.filter.OncePerRequestFilter; | |
import org.springframework.web.util.ContentCachingRequestWrapper; | |
import org.springframework.web.util.ContentCachingResponseWrapper; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; |
This file contains 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
#!/bin/sh | |
# set -e | |
#to remove trailing \r character | |
#sed -i 's/\r$//' file_name.sh or using dos2unix to format: yum install dos2unix -y | |
#Nginx from source | |
#http://www.ehowstuff.com/how-to-install-nginx-on-centos-7-rhel-7/ | |
# | |
#Note: enable AIO | |
# Nginx RTMP Module |
This file contains 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
server { | |
# Internal image resizing server. | |
server_name localhost; | |
listen 888 ; | |
allow 127.0.0.1; | |
deny all; | |
access_log /var/log/nginx/image_access.log; | |
error_log /var/log/nginx/image_error.log; | |
NewerOlder