Skip to content

Instantly share code, notes, and snippets.

@mortenbra
mortenbra / centos_basic_utils.sh
Last active August 29, 2015 14:21
Install basic utilities for CentOS
#install some basic utils
yum install nano -y
yum install unzip -y
yum install bc -y
yum install wget -y
@mortenbra
mortenbra / tomcat_ssl_connector.xml
Created May 28, 2015 20:11
SSL Connector for Tomcat server.xml file
<-- setup SSL connector for Tomcat, and enabling only recommended protocols and ciphers -->
<Connector port="8443" protocol="HTTP/1.1" maxHttpHeaderSize="32767" URIEncoding="UTF-8"
maxThreads="150" connectionTimeout="20000"
SSLEnabled="true" scheme="https" secure="true"
sslProtocol="TLS" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
ciphers="TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"
keystoreFile="/path/to/your_keystore.jks" keystorePass="yourpasswordhere"
clientAuth="false" />
@mortenbra
mortenbra / tomcat_ssl_keytool.sh
Last active May 27, 2021 08:45
Generate Certificate Signing Request (CSR) and install SSL certificate (CRT) into Java keystore used by Tomcat
# create a new keystore
keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore foobar_com.jks -dname "CN=foobar.com,OU=IT, O=FooBar Inc, L=FooCity, ST=FooState, C=NO"
# create a certificate signing request (CSR) to send to the certificate authority (CA)
keytool -certreq -alias server -file foobar_com.csr -keystore foobar_com.jks
# now go and buy a SSL certificate, using the CSR file
# you should get a certificate file in .crt format back
# install the received certificate (example uses files received from GoDaddy)
@mortenbra
mortenbra / centos_ntp.sh
Last active August 29, 2015 14:22
Setup Network Time Protocol (NTP) for CentOS
# setup Network Time Protocol (NTP)
# see http://www.uptimemadeeasy.com/networking/setup-ntp-on-centos-linux/
# check current date/time
date
# setup time zone
mv /etc/localtime /etc/localtime.bkp
cp /usr/share/zoneinfo/Europe/Oslo /etc/localtime
@mortenbra
mortenbra / centos_swapfile.sh
Last active October 29, 2021 14:51
Creating a swapfile suitable for Oracle XE on CentOS
# Oracle XE requires a swap file of at least twice the size of physical memory
# see https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6
# check current swap file
swapon -s
# check available space
df
# setup 2GB swap file
dd if=/dev/zero of=/swapfile bs=1024 count=2048k
@mortenbra
mortenbra / xe_post_install_verify.sh
Last active August 29, 2015 14:22
Post-install test of Oracle XE
# initial test of Oracle XE database after install
# become the "oracle" user
su - oracle
# connect to database
sqlplus /nolog
connect sys as sysdba
-- basic query to see stuff working
@mortenbra
mortenbra / xe_post_install_cleanup.sql
Last active May 9, 2017 08:04
Clean up unused features in Oracle XE after installation
-- do some cleanup after Oracle XE installation
-- run as SYS
-- disable XDB server
-- assumes we will use ORDS or other web listener instead
exec dbms_xdb.sethttpport(0);
exec dbms_xdb.setftpport(0);
-- anonymous user is not needed when we don't use XDB
alter user anonymous account lock;
@mortenbra
mortenbra / apex_install_runtime.sql
Created June 4, 2015 14:29
Install Apex runtime
-- install Apex (runtime only)
@apxrtins.sql SYSAUX SYSAUX TEMP /i/
@mortenbra
mortenbra / apex_workspace_verify.sql
Created June 4, 2015 14:30
Verify Apex workspaces
-- check setup of Apex workspaces
select *
from apex_workspaces;
select *
from apex_workspace_schemas;
@mortenbra
mortenbra / ora_network_acl_verify.sql
Created June 4, 2015 14:39
Verify network ACL settings in Oracle
-- check/verify network ACL settings
select host, lower_port, upper_port, acl
from dba_network_acls;
select *
from dba_network_acl_privileges;