Skip to content

Instantly share code, notes, and snippets.

@hai-voquang
hai-voquang / openshift-cheatsheet.md
Created October 16, 2021 00:21 — forked from rcauchon/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile

@hai-voquang
hai-voquang / DO425.md
Created October 16, 2021 00:21 — forked from luckylittle/DO425.md
Red Hat DO425 Notes

Red Hat Security: Securing Containers & OpenShift (DO425)

Last update: Tue Jan 14 23:15:49 UTC 2020 by @luckylittle


Objectives

  1. Understand, identify, and work with containerization features
  2. Deploy a preconfigured application and identify crucial features such as namespaces, SELinux labels, and cgroups
@hai-voquang
hai-voquang / openshift-cheatsheet.md
Created October 5, 2021 22:11 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
oc create serviceaccount user-root
oc adm policy add-scc-to-user anyuid -z user-root
oc patch dc/myAppNeedsRoot --patch '{"spec":{"template":{"spec":{"serviceAccountName": "user-root"}}}}'
or
oc set sa dc myAppNeedsRoot user-root
@hai-voquang
hai-voquang / build.gradle
Created July 6, 2021 16:47 — forked from rponte/build.gradle
Configuring Gradle compiler encoding
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
eclipseJdt << {
ant.propertyfile(file: ".settings/org.eclipse.core.resources.prefs") {
ant.entry(key: "eclipse.preferences.version", value: "1")
ant.entry(key: "encoding/<project>", value: "utf-8")
@hai-voquang
hai-voquang / crc1_14_0_F31.md
Created May 1, 2021 03:47 — forked from sub-mod/crc1_14_0_F31.md
Setup CodeReady Containers on Remote Server and connect from Laptop 4.2 - Fedora 31
@hai-voquang
hai-voquang / mvnw-fix.sh
Created December 30, 2019 18:47 — forked from kbastani/mvnw-fix.sh
Adds a settings.xml file to your Spring Boot maven wrapper
#!/usr/bin/env bash
# Secure workaround for https://issues.sonatype.org/browse/MVNCENTRAL-1369
# Navigate to the root of your Spring Boot project where a Maven wrapper is present and run this script
cd .mvn/wrapper
wget https://gist.githubusercontent.com/kbastani/d4b4c92969ec5a22681bb3daa4a80343/raw/f166086ef051369383b02dfb74317cd07b6f2c6e/settings.xml
cd ../../
./mvnw clean install -s .mvn/wrapper/settings.xml
@hai-voquang
hai-voquang / README.md
Created July 27, 2019 14:14 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@hai-voquang
hai-voquang / clean_code.md
Created July 25, 2019 13:42 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@hai-voquang
hai-voquang / xampp_php7_xdebug.md
Created June 24, 2019 13:34 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup