Skip to content

Instantly share code, notes, and snippets.

View CedricL46's full-sized avatar

Cedric L CedricL46

View GitHub Profile
## Once the certificate renew command is scheduled (or manually with sudo ./etc/letsencrypt/certbot-auto renew) a new certificate is generated
## To check if a new certificate was generated you can run :
[ec2-user@ip-MyIp ~]$ locate *certbot.pem
/etc/letsencrypt/csr/0000_csr-certbot.pem #old certificate
/etc/letsencrypt/csr/0001_csr-certbot.pem #new certificate
## You then need to change the ssl conf to specify the new certificate :
sudo vim /etc/httpd/conf.d/ssl.conf
## Search for SSLCertificateKeyFile(vim command : ?SSLCertificateKeyFile) and change the file for the new one :
# Server Private Key:
#How to fix BEA-141281 – unable to get file lock or BEA-280060 The persistent store encountered a fatal error in weblogic
#After an unexpected crash the following error can occur when you startup your weblogic server:
nohup /YOUR_DOMAIN_PATH/domains/YOUR_DOMAIN_NAME/bin/startManagedWebLogic.sh YOUR_SERVER_NAME t3://YOUR_WEBLOGIC_SERVER:7004 2>&1 &
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ nohup /YOUR_DOMAIN_PATH/domains/YOUR_DOMAIN_NAME/bin/startManagedWebLogic.sh YOUR_SERVER_NAME t3://YOUR_WEBLOGIC_SERVER:7004 2>&1 &
[1] 14150
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ nohup: ignoring input and appending output to nohup.out
#read the nohup.out to get the startup error message
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ tail -f nohup.out
//Function to call as follow :
//Object myValue = MyBean.getRichTableSelectedRowAttributeValue("tableID", "VoAttributeName");
public Object getRichTableSelectedRowAttributeValue(String tableID, String attributeName) {
Object value = null;
RichTable richTable = (RichTable)findComponentInRoot(tableID); //part of the JSFUtils opensource class
if (richTable != null) {
ViewObject vo = getViewObjectFromTable(richTable); //part of the ADFUtils opensource class
if (vo != null) {
//Get select row from the view object
/**** Run this query to get the boundary time or your AWR report ****/
select snap_id,
snap_level,
to_char(begin_interval_time, 'dd/mm/yy hh24:mi:ss') begin
from
dba_hist_snapshot
order by 1
desc;
/***
# Open a command terminal in the bin folded of your java installation (e.g: C:\Program File(x86)\Java\jreXXXX\bin)
# In the commands below :
# - selfsigned is the name of the certificate
# - storPass is the password of the keystore and truststore
# - keyPass is the password of the certificate
# You can change those values for yours
#Generate the keystore.jks
keytool -genkeypair -alias selfsigned -keyalg RSA -keysize 2048 -validity 365 -keypass keyPass -storepass storPass -keystore keystore.jks
#Enter your informations when prompt
#Connect to the Weblogic Host through FTP and upload your keystore.jks and truststore.jks to your user home
#Connect to the Weblogic Host through SSH with your user
#Copy the trustStore and keyStore to a tmp folder available from your {YourWeblogicUser}
[{YourSSHUser}@{YourWeblogicHost} ~]$ cp truststore.jks /tmp/
[{YourSSHUser}@{YourWeblogicHost} ~]$ cp keystore.jks /tmp/
#Sudo to {YourWeblogicUser}
[{YourSSHUser}@{YourWeblogicHost} ~]$ sudo su - {YourWeblogicUser}
#Copy files to {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates
[{YourWeblogicUser}@{YourWeblogicHost} ~]$ mkdir {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates
[{YourWeblogicUser}@{YourWeblogicHost} ~]$ cp /tmp/truststore.jks {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates
#SSH to your instance
#example :
#chmod 600 YOURPEMKEY.pem
#ssh -i YOURPEMKEY.pem ec2-user@YOURELASTICIP
#update current packages
sudo yum update -y
#install prerequisites
sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
<!-- This DataBinding.cpx is usually found at ViewController/adfmsrc/view/DataBinding.cpx -->
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://xmlns.oracle.com/adfm/application" version="11.1.2.61.83" id="DataBindings"
SeparateXMLFiles="false" Package="view" ClientType="Generic">
<definitionFactories>
<factory nameSpace="http://xmlns.oracle.com/adfm/dvt"
className="oracle.adfinternal.view.faces.dvt.model.binding.FacesBindingFactory"/>
</definitionFactories>
<pageMap>
<page path="YOUR_FRAGMENT_PATH/YOUR_FRAGMENT.jsff" usageId="view_YOUR_PAGEPageDef"/>
<!-- In Oracle ADF, To fix JBO-27200: JNDI failure. Unable to lookup Data Source
you need to ensure that your datasource name is the same in 3 places:
Note : This is case sensitive.
-->
<!-- In web.xml -->
<resource-ref>
<res-ref-name>jdbc/YOUR_DATASOURCE_NAME</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
//Oracle ADF ActionEvent to duplicate a row
public void duplicateRowLine(ActionEvent e) {
ViewObject vo = this.getViewObjectFromIterator("YOUR_ITERATOR_NAME");
Row currentRow = vo.getCurrentRow();
Row duplicatedRow = vo.createRow();
AttributeDef[] voKeyAttributes = vo.getKeyAttributeDefs(); //List of the primary keys that need to be unique
String[] currentRowAttributes = currentRow.getAttributeNames();
for (String attributeName : currentRowAttributes) {
int attributeIndex = duplicatedRow.getAttributeIndexOf(attributeName);
//Check if the attribute is updatable