Home | Signal


Khalid Saidi

Co-founder of Palmera Health Sciences and Terpomo Software. I build tools for AI agents.

Projects

Work

Products

AI agent tools

Libraries

Experiments

Notes

kubernetes x509 not signed by a valid certificate authority (May 2023)

When kubectl throws "x509: certificate signed by unknown authority", the API server certificate does not validate against the CA in your kubeconfig.

For quick local testing you can temporarily skip verification. Do not use this in production.

clusters:
- name: my-cluster
  cluster:
    server: https://your-api-server:6443
    insecure-skip-tls-verify: true

Better fix: update certificate-authority-data or certificate-authority to match the cluster CA.

Cloudfront with public S3 bucket (May 2023)

To keep an S3 bucket private behind CloudFront, use an Origin Access Identity (OAI) or Origin Access Control (OAC) and restrict the bucket policy.

Reference: Restrict access to S3 with CloudFront.

vi: stay at matching result after escape (May 2023)

By default, Vim can move the cursor after you exit search mode. If you want the cursor to stay on the match, set the cpoptions flag.

set cpoptions+=x

Add it to ~/.vimrc to make it persistent.

Mac Big Sur change shell (Jan 2021)

Big Sur defaults to zsh, but you can switch shells with chsh as long as the shell is listed in /etc/shells.

cat /etc/shells

chsh -s /bin/bash

Log out and back in for the change to take effect.

Mac Switch java version (between jdk 11 and 1.8) (Dec 2020)

macOS ships /usr/libexec/java_home to manage multiple JDKs. Use it to switch JAVA_HOME cleanly.

/usr/libexec/java_home -V

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
export PATH="$JAVA_HOME/bin:$PATH"

Put the export lines in ~/.zshrc or ~/.bash_profile to persist.

ERR_CLEARTEXT_NOT_PERMITTED in debug app on Android ionic (Oct 2020)

Android 9+ blocks cleartext HTTP by default. In Ionic debug builds this often breaks local APIs.

Quick debug fix: allow cleartext traffic in the app manifest.

<application
  android:usesCleartextTraffic="true"
  ...>

For production, prefer HTTPS or a network security config scoped to specific hosts.

ionic io issue blank screen error cross origin request are only supported for http:// (Oct 2020)

WKWebView blocks file:// to http:// XHR which can lead to a blank screen in Ionic iOS apps.

Install the file XHR plugin and rebuild.

cordova plugin add cordova-plugin-wkwebview-file-xhr
ionic cordova prepare ios
ionic cordova run ios

This allows local file origins to reach http(s) resources during development.

Why git not using a user different from the one in the config (Apr 2020)

On macOS, Git can still use credentials stored in the Keychain even if git config shows a different user. This leads to permission denied for the old user.

git credential-osxkeychain erase
host=github.com
protocol=https

Retry the operation and save the correct credentials.

NTFS for Mac (Apr 2020)

macOS can read NTFS but not write. For external drives you can install an NTFS driver.

One option: Seagate NTFS Driver for Mac.

After install, replug the drive to enable write access.

angular, resetting creds before auth-guard (Feb 2020)

Problem: on refresh, the AuthGuard runs before credentials are restored, so the app redirects to login even though a valid session exists.

Solution: move the credential bootstrap into an APP_INITIALIZER so it runs before routing.

// app.module.ts
providers: [
  {
    provide: APP_INITIALIZER,
    useFactory: initAuth,
    deps: [AuthService],
    multi: true,
  },
]

Dispatch refresh logic inside initAuth so guards see the correct state.

Search in any archive ear, war, jar (Jan 2020)

To search inside .ear/.war/.jar files, treat them like zip archives.

zipgrep -R "MyClass" app.ear

jar tf app.war | grep -i "spring"

For nested archives, extract first and repeat.

angular importing module that has routes but without the routes (Dec 2019)

Importing an Angular module that declares routes merges those routes into the parent, which can lead to unexpected route matches.

Split the module into:

Import FeatureModule where you want the components without routes, and FeatureRoutingModule only in the feature's own module.

Run kubernetes on ubuntu VM behind corporate proxy using cttlm (Jan 2019)

Behind a corporate proxy, minikube and kubectl need a local proxy like cntlm.

Enable gateway in cntlm and start the service:

# /etc/cntlm.conf
Gateway yes

Install kubectl and minikube:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/minikube

Start minikube with proxy envs and resolv.conf override:

sudo minikube start --vm-driver=none   --docker-env http_proxy=http://172.10.0.1:3128   --docker-env https_proxy=http://172.10.0.1:3128   --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf

On subsequent runs, the shorter start command is usually enough.

link linux admin guide (Dec 2018)

Reference: Linux Network Administrator's Guide (PDF).

cognito and aws cli to reset password (Sep 2018)

When a Cognito user is forced to reset a password, you must respond to NEW_PASSWORD_REQUIRED.

aws cognito-idp admin-initiate-auth   --user-pool-id POOL_ID   --client-id CLIENT_ID   --auth-flow ADMIN_NO_SRP_AUTH   --auth-parameters USERNAME=USERNAME,PASSWORD=TEMP_PASSWORD

Then respond to the challenge using the session from the first call:

aws cognito-idp admin-respond-to-auth-challenge   --user-pool-id POOL_ID   --client-id CLIENT_ID   --challenge-name NEW_PASSWORD_REQUIRED   --challenge-responses file://auth.json   --session "SESSION"
{
  "USERNAME": "USERNAME",
  "NEW_PASSWORD": "NEW_PASSWORD",
  "userAttributes.name": "FIRST_NAME",
  "userAttributes.family_name": "LAST_NAME",
  "userAttributes.email": "EMAIL"
}
angular with aws-sdk (May 2018)

Using AWS SDK in Angular can trigger "Cannot find name 'Buffer'" because Node types are missing.

npm install --save-dev @types/node
// tsconfig.app.json
{
  "compilerOptions": {
    "types": ["node"]
  }
}

Restart the TypeScript server after the change.

Bonsoir Ba (Sonar) (Apr 2018)

SonarQube project keys must be unique. If scans overwrite each other, set an explicit key.

sonar-scanner -Dsonar.projectKey=my_project_key

Use the same key across CI to keep history consistent.

javascript, ng2, Ionic (Aug 2016)

Grab-bag of Ionic and Angular CLI maintenance and debugging notes.

npm outdated -g
npm cache clean --force
ionic cordova run android --device -l --debug

Common fixes:

launch putty from keepass (Feb 2016)

Use KeePass URL Overrides to launch PuTTY with the selected entry.

URL Override: Scheme: putty
URL Override: cmd://C:\Program Files\PuTTY\putty.exe -ssh {USERNAME}@{BASE:HOST} -pw {PASSWORD}

Set the entry URL to putty://host to trigger the override.

jconsole (Feb 2016)

To connect JConsole to a local WebLogic instance, enable JMX and set the host and port.

# setDomainEnv.cmd
set JAVA_OPTIONS=%JAVA_OPTIONS% ^
  -Djava.rmi.server.hostname=localhost ^
  -Dcom.sun.management.jmxremote ^
  -Dcom.sun.management.jmxremote.port=10313 ^
  -Dcom.sun.management.jmxremote.ssl=false ^
  -Dcom.sun.management.jmxremote.authenticate=false

For verbose JConsole logging, launch with a logging config:

jconsole.exe -J-Djava.util.logging.config.file=C:\temp\jconsole_logging.properties
handlers = java.util.logging.ConsoleHandler
.level = DEBUG
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
javax.management.level = FINEST
javax.management.remote.level = FINER
GIT (Jan 2016)

If Git keeps reusing stored credentials, configure the credential helper to prompt or cache.

git config --global credential.helper cache
git config --global credential.https://github.com.username youruser
git clone https://github.com/youruser/repository.git

Use credential.helper osxkeychain or manager if you want native storage instead of cache.

OIM EventHandler PostProcess (Jul 2015)

To ensure an OIM EventHandler runs after all others, set its order to LAST in eventHandler.xml.

<event-handler ... order="LAST" />

This can fix org changes not applying when handled too early.

Reinstall OAAM (Mar 2015)

When OAAM servers get into a bad state, a clean reinstall may require removing server entries and backing files.

rm -rf /u01/oracle/config/domains/IAMAccessDomain/servers/wls_oaam1.bkp
rm -rf /u01/oracle/config/domains/IAMAccessDomain/servers/wls_oaam_admin1.bkp

# edit init-info backups
/u01/oracle/config/domains/IAMAccessDomain/init-info/domain-info.xml.bkp
/u01/oracle/config/domains/IAMAccessDomain/init-info/config-groups.xml.bkp

Validate the domain configuration before starting the servers again.

Fusion Middleware Configuration Wizard.log file (Mar 2015)

The Fusion Middleware Configuration Wizard can write a detailed log if you pass a log flag.

$MW_HOME/oracle_common/common/bin/config.sh -log=logfile

Use this when troubleshooting domain creation or extension steps.

Weblogic (Feb 2015)

Quick WebLogic notes: version lookup and a common Hibernate Validator classloader issue.

Check version

locate registry.xml
# example: /u01/oracle/products/identity/registry.xml

java -cp weblogic.jar weblogic.version

Hibernate Validator ClassCastException

If you see a ClassCastException around XMLStreamInputFactory during startup, add Woodstox to the domain lib.

cp woodstox-core-asl-4.2.0.jar $DOMAIN_HOME/lib

Class loading debug

-verbose:class
OAM Authorization not working (Feb 2015)

OAM can bypass authorization checks if SSOOnlyMode is enabled. Disable it for policy-based authorization.

<Setting Name="SSOOnlyMode" Type="xsd:boolean">false</Setting>

Restart OAM servers after the change.

LCM Single Node OAM OAAM OIM OUD (Jan 2015)

Some legacy OIM and OAM installers require 32-bit compatibility libraries on 64-bit Linux. This is a messy workaround but it can unblock the installer.

rpm --force -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
rpm --force --nodeps -ivh glibc-devel-2.5-123.i386.rpm
rpm --force --nodeps -ivh glibc-2.5-123.i686.rpm
rpm --force --nodeps -ivh glibc-common-2.5-123.i386.rpm
rpm --force --nodeps -ivh glibc-headers-2.5-123.i386.rpm
rpm --force --nodeps -ivh libaio-0.3.106-5.i386.rpm
rpm --force --nodeps -ivh libgcc-4.1.2-55.el5.i386.rpm
rpm --force --nodeps -ivh libstdc++-4.1.2-55.el5.i386.rpm

A cleaner fix is to update refhost.xml to use i686 instead of i386:

cd $REPOS_HOME/installers
for FILE in $(find . -name refhost.xml | grep linux64); do
  sed -i.bak 's/i386/i686/g' $FILE
done

Use at your own risk and only in isolated build environments.

Linux (Jan 2015)

Two small Linux shell reminders: redirect stderr and disable password expiration.

command arg1 arg2 2>/dev/null

chage -I -1 -m 0 -M 99999 -E -1 username
IM (Mar 2014)

Identity management reference links collected during project work:

database (Mar 2014)

Database fundamentals refresher:

https://www.youtube.com/watch?v=Xk3cgUdoieU

IE 8 ERROR_INTERNET_SECURITY_CHANNEL_ERROR (Jan 2014)

IE8 sometimes fails SSL handshakes with local WebLogic, resulting in ERROR_INTERNET_SECURITY_CHANNEL_ERROR.

In one case the fix was to trust the Fiddler root certificate:

After trusting the cert, the local site loaded.

JMX (Dec 2013)

JMX monitoring references:

Open ESB (Dec 2013)

Open ESB project homepage:

http://www.open-esb.net/

Oracle Application Testing Suite. quick start (Nov 2013)

Oracle Application Testing Suite quick start:

  1. Use OpenScript to create one or more HTTP/Web scripts.
  2. Open Oracle Load Testing and choose the same repository as the scripts.
  3. Add scripts to a scenario and set the number of virtual users (VUs).
  4. Run the test and stop it when complete.
Java Memory Analysis (Oct 2013)

Java memory analysis tools and guides:

Linux (Oct 2013)

Linux command snippets for everyday admin work:

lsb_release -a

/usr/ucb/ps -aw

find . -name "*.ear" -printf "%f\n"
find . -name "*.ear" -exec cp {} ./ears \;
Google App Engine with Restful web services (Oct 2013)

Google App Engine and REST resources:

JDeveloper and Webcenter Portal (Jun 2013)

WebCenter Portal field notes, condensed and cleaned up.

Too many redirects when installing extensions

JDeveloper can keep using a proxy even after you uncheck it. Add * to the proxy exceptions to fully bypass it.

Deploying a portlet WAR into WebCenter Portal

Convert the WAR to a WSRP application using the predeploy tool, then deploy the resulting EAR to WebLogic.

java -jar C:\Oracle\Middleware2\jdeveloper\webcenter\modules\oracle.portlet.server_11.1.1\wsrp-predeploy.jar   ch7_HelloWorldPortlet.war PortletEAR.ear

After deployment, open the application in the WebLogic console and copy the WSRP WSDL URL from the info page. Use that URL to create a WSRP connection in JDeveloper.

NoClassDefFoundError for JSTL

Add JSTL to the integrated WebLogic classpath in the start script:

set CLASSPATH=%CLASSPATH%;C:\Oracle\Middleware2\oracle_common\modules\jstl-1.2.jar
WOA REST and Javascript (May 2013)

REST and JavaScript references:

Virtual Box VM (May 2013)

VirtualBox quick fixes:

usermod -a -G vboxsf oracle

Use Machine > ACPI Shutdown to power off cleanly.

Useful Links about Gadgets (May 2013)

Gadget development resources:

Setting up a standalone machine with Webcenter Suite for development (May 2013)

When WebCenter Sites runs on a VM and you connect from a local Eclipse/CSDT install, CAS URLs can still point to localhost and break logins.

Update SSOConfig.xml to point to the VM IP:

<property name="casUrl" value="http://vm_ip:port/cas" />

Typical location:

/home/oracle/Oracle/Middleware/user_projects/domains/csDomain/servers/CS_Server/stage/CS/CS/WEB-INF/classes/SSOConfig.xml
List of useful links about Oracle Webcenter (May 2013)

Large collection of Oracle WebCenter resources:


GitHub