Skip to content

Instantly share code, notes, and snippets.

View CedricL46's full-sized avatar

Cedric L CedricL46

View GitHub Profile
/**** 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;
/***
//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
#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
## 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:
const botBuilder = require("claudia-bot-builder");
const fbTemplate = botBuilder.fbTemplate;
//to install run 'npm i sync-request' in the project folder terminal
var request = require("sync-request");
//to install run 'npm i keyword-extractor' in the project folder terminal
var keywordExtractor = require("keyword-extractor");
//function to query the really nice icanhazdadjoke API for a joke
function getJoke(keyword) {
ubuntu@ip-YourComputer:~/FbJokeBot$ claudia update --configure-fb-bot
updating REST API apigateway.createResource parentId=parentId pathPart=facebook restApiId=0s7tsgupdating REST API apigateway.createResource parentId=parentId pathPart=telegram restApiId=0s7tsgupdating REST API apigateway.createResource parentId=parentId pathPart=groupme restApiId=0s7tsgrate-limited by AWS, waiting before retry apigateway.setAcceptHeader
Facebook Messenger setup
Following info is required for the setup, for more info check the documentation.
@CedricL46
CedricL46 / warnAndPreventUserInputADF.js
Last active April 12, 2018 13:31
How to display a please wait message when the server is processing using addBusyStateListener in ADF ? https://cedricleruth.com/how-to-display-a-please-wait-message-when-the-server-is-processing-using-addbusystatelistener-in-adf/
var popup = null;
var clickedElem = null;
function triggerOnLoad(event) {
//You can either set the popup using the pure html div id (recommended)
popup = AdfPage.PAGE.findComponentByAbsoluteId(document.getElementById('loaderId').nextSibling.id);
//or set the popup knowing the full id of your popup for example :
//popup = AdfPage.PAGE.findComponentByAbsoluteId('p1:processingP');
//popup = AdfPage.PAGE.findComponent('processingP');
return true;
@CedricL46
CedricL46 / addBusyStateListenerPopUp.html
Last active April 12, 2018 13:31
How to display a please wait message when the server is processing using addBusyStateListener in ADF ? https://cedricleruth.com/how-to-display-a-please-wait-message-when-the-server-is-processing-using-addbusystatelistener-in-adf/
<af:group id="pt_g3">
<div id="loaderId"></div>
<af:popup id="processingP" contentDelivery="immediate" clientComponent="true">
<af:dialog id="d2" title="Processing..." type="none" closeIconVisible="false" inlineStyle="text-align:center;" clientComponent="true"
modal="true">
<f:facet name="buttonBar"/>
<af:panelGroupLayout id="pgl2" layout="vertical" halign="center">
<af:spacer width="10" height="10" id="s11"/>
<af:outputText value="Please wait..." id="ot2669"/>
</af:panelGroupLayout>
/**
* Unapply a view criteria named MyViewCriteria to it's ViewObject
* by getting it through the binding iterator MyViewObjectIterator
* Full library: https://github.com/CedricL46/Oracle-ADF-and-JSF-Utils-libraries
*/
public void UnApplyViewCriteriaOnViewObjectByIteratorName(String MyViewCriteriaName, String MyViewObjectIteratorName) {
try {
//Get The viewObject from the iterator define in the current binding context
ViewObject vo = this.getViewObjectFromIteratorName(MyViewObjectIteratorName)
//Get all it's ViewCriteria using the ViewCriteriaManager of the ViewObject
#Initialize your project folder using npm
ubuntu@YourComputer:~/FbJokeBot$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.