Skip to content

Instantly share code, notes, and snippets.

@putheng
putheng / README.md
Created December 22, 2023 12:49 — forked from bgarcial/README.md
How to install cert-manager and start to work with kong

Using cert-manager to work with kong and ingress

cert-manager is a native Kubernetes certificate management controller. It can help with issuing certificates from a variety of sources, such as Let’s Encrypt, HashiCorp Vault, a simple signing keypair, or self signed.

We are going to use Let's Encrypt to issue our zcrm365 certificate

Overview

Cloud Build

Cloud Build is a product of GCP (Google Cloud Platform) used to build software quickly across all languages.

Function:

  • Speed up Build with VMs on Cloud without wasting personal computer’s resources.
  • Source code put on Local, Github, Cloud Source Repositories or Bitbucket all can use Cloud Build.
  • Package your source into Docker containers or non-container artifacts with build tools such as Maven, Gradle, webpack, Go, or Bazel.
  • After completing Build, the result is updated on Docker Hub or Container Registry.
  • You can be flexible to adjust the stream of Build process according to your intention.
@putheng
putheng / git-deployment.md
Created April 4, 2022 10:21 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@putheng
putheng / asymEncNdDec.js
Created February 19, 2022 09:45 — forked from thecipherBlock/asymmEncNdDec.js
Asymmetric encryption and decryption of JSON data in js
var crypto = require("crypto");
var path = require("path");
var fs = require("fs");
var encryptStringWithRsaPublicKey = function(toEncrypt, publicKeyInPemPath) {
var absolutePath = path.resolve(publicKeyInPemPath);
var publicKey = fs.readFileSync(absolutePath, "utf8");
var buffer = Buffer.from(JSON.stringify(toEncrypt));
var encrypted = crypto.publicEncrypt(publicKey, buffer);
return encrypted.toString("base64");
@putheng
putheng / image_color_picker_widget.dart
Created February 8, 2022 06:25 — forked from roipeker/image_color_picker_widget.dart
Basic image pixel color detection in Flutter (supports screenshots of the widget tree)
//////////////////////////////
//
// 2019, roipeker.com
// screencast - demo simple image:
// https://youtu.be/EJyRH4_pY8I
//
// screencast - demo snapshot:
// https://youtu.be/-LxPcL7T61E
//
//////////////////////////////
@putheng
putheng / nginx.conf
Created January 26, 2022 02:28 — forked from spiermar/nginx.conf
Nginx RMTP to HLS and DASH
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
@putheng
putheng / laravel-deployment-vps.md
Created January 20, 2022 04:12 — forked from mokhosh/laravel-deployment-vps.md
Deploy Laravel to VPS (LEMP, Git, Mail, Redis, SSL, etc.)

Sign in and create git user

  • ssh root@IP
  • adduser git
  • usermod -aG sudo git

Set SSH keys

on local machine

  • ssh-keygen
  • ls ~/.ssh
  • cat ~/.ssh/id_rsa.pub
@putheng
putheng / gradient_border_container.dart
Created December 17, 2021 08:02 — forked from flutter-clutter/gradient_border_container.dart
A flutter widget that gives the given child a configurable gradient border (used and explained on https://www.flutterclutter.dev/flutter/tutorials/how-to-add-a-border-to-a-widget/2020/587/)
import 'package:flutter/material.dart';
class GradientBorderContainer extends StatelessWidget {
GradientBorderContainer({
@required gradient,
@required this.child,
@required this.onPressed,
this.strokeWidth = 4,
this.borderRadius = 64,
this.padding = 16,
@putheng
putheng / Session.hpp
Created November 8, 2021 05:01 — forked from Voltra/Session.hpp
A session middleware for the C++ web framework Crow
#pragma once
#include <functional>
#include <unordered_map>
#include <string>
#include <mutex>
#include <sstream>
#include <locale>
#include <cstdlib>
#include <algorithm>
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
Future<List<Result>> fetchResults(http.Client client) async {
final response = await client.get('https://api.myjson.com/bins/j5xau');