Skip to content

Instantly share code, notes, and snippets.

View socheatsok78's full-sized avatar
πŸ––
ΰΌΌ ぀ β—•_β—• ༽぀ is having a baby

Socheat Sok socheatsok78

πŸ––
ΰΌΌ ぀ β—•_β—• ༽぀ is having a baby
View GitHub Profile
@socheatsok78
socheatsok78 / Generating stronger DH parameters for nginx
Created July 11, 2023 11:03 — forked from ageis/Generating stronger DH parameters for nginx
Generating stronger DH parameters for nginx's SSL
# run in the terminal, then set as ssl_dhparam in nginx.conf
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
@socheatsok78
socheatsok78 / golang_job_queue.md
Created July 7, 2023 09:45 — forked from harlow/golang_job_queue.md
Job queues in Golang
@socheatsok78
socheatsok78 / 0-rancher-vsphere-setup.md
Created May 24, 2023 18:57 — forked from PhilipSchmid/0-rancher-vsphere-setup.md
How to set up a Rancher K8s cluster on VMware (incl. vSphere StorageClass)

Rancher K8s Cluster on VMware vSphere

Prerequisites

vCenter Configuration

{
"allowed": [
"5f5e8848426129ab63cb4db717bb54193c1c1ad7",
"cfb0ce978c1c8ec691d76e207f349337bce6efc4",
"a7838b75c42b612da3b6cc99beed4ecb2d04cff2",
"9e638562ab1c1fced9def142864cdd5a7019e1aa",
"443c7602b4fde83d1154d6d9da48808418b181b6",
"d6b4535ba8f2b34012bc633569f113e77017e032"
],
"comments": {
@socheatsok78
socheatsok78 / README.md
Last active April 27, 2023 08:46
Poor man's reverse proxy with SSH

Usage

Install the service by adding the [email protected] to /lib/systemd/system/.

Create a config for a service:

Example:

# /etc/default/ssh-reverse-proxy@your-service
@socheatsok78
socheatsok78 / esm-package.md
Created April 19, 2023 17:24 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@socheatsok78
socheatsok78 / markdown-printer.js
Last active March 10, 2023 10:28
Print GitHub Markdown Document
// Print GitHub Markdown Document
// Copy following scripts in the developer console of page included markdown content you want to print and run "printMarkdown("#readmy")
function printMarkdown(selector) {
var $ = document.querySelector.bind(document);
$(selector).setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$(selector + '>article').setAttribute('style', 'border: none');
$('body').innerHTML = $(selector).outerHTML;
window.print();
}
@socheatsok78
socheatsok78 / SSLPoke.java
Created February 16, 2023 02:53 — forked from bric3/SSLPoke.java
The famous SSLPoke from Atlassian : establish a TLS connection but support http proxy and updated to Java 11
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
@socheatsok78
socheatsok78 / README.md
Last active February 12, 2025 15:10
A simple fix for using "ca-certificates" to update Java "cacerts" store for container.

About

A simple fix for using ca-certificates to update Java cacerts store for container.

Use with pre-built JDK/JRE container

Due to the update-ca-certificates will output the Java cacerts store to /etc/ssl/certs/java/cacerts which the pre-built image not aware of the changes. So by removing the ${JAVA_HOME}/lib/security/cacerts and create a symbolic link from /etc/ssl/certs/java/cacerts to ${JAVA_HOME}/lib/security/cacerts will resolve the issue.

Alpine

FROM eclipse-temurin:17-jre-alpine