Skip to content

Instantly share code, notes, and snippets.

View countcain's full-sized avatar
🏠
Working from home

Tao Huang countcain

🏠
Working from home
View GitHub Profile

mTLS 配置

对于mTLS的配置的证书来说,有如下的提示。

  • 三个文件。 对于大多数系统,如:MySQL, Redis,PostgreSQL。会需要三个文件:CA证书 + CERT 和 KEY。可以在我的这个开源项目(https://github.com/haoel/mTLS/tree/main/certs )中找到我生成的CA,以及 Server 和 Client的 .crt.key 文件。生成的方法也在我的那个开源项目中了。

  • 两个文件。 对于有的系统,比如:MongoDB,他只要两个文件,一个是CA,一个是 pem 文件,对于pem文件,你可以直接把上面的 .crt 和 .key 合并了就好了。如:cat server.crt server.key > server.pem

  • JKS文件。 对于一些系统,比如:Kafka 和 Zookeeper。他要的不是上面的明文的格式,他要的是一种jks的格式,这是Java的格式。怎么从上面的明文的方式转到jks的文件。需要经过下面几步。

@wli
wli / resign_ipa.md
Last active June 2, 2022 20:56
Expo build with associatedDomains

Resign Expo IPA for associatedDomains

You can also generalize these instructions to modify your ipa for any other reason.

Error message

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value '*' for key 'com.apple.developer.associated-domains' in 'Payload/Exponent.app/Exponent' is not supported."

Assumptions

  • My app id is io.getsparks.sparks
  • My distribution certificate name is iPhone Distribution: Boost Labs, Inc
@SuperPaintman
SuperPaintman / npm-f3-install.sh
Last active April 21, 2024 23:41
NPM install for low RAM machins. And "npm install ... killed" problem
#!/bin/bash
#
# Author: SuperPaintman <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
@subfuzion
subfuzion / curl.md
Last active May 8, 2024 04:57
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@paulirish
paulirish / what-forces-layout.md
Last active May 9, 2024 07:00
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@FUT
FUT / install-redis.sh
Last active April 19, 2022 11:16
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@staltz
staltz / introrx.md
Last active May 9, 2024 07:59
The introduction to Reactive Programming you've been missing
(function() {
// NOTE: I have intentionally avoided the use of jQuery in
// the next two functions so as not to obscure any details.
// Updates the DOM in such a way that layout is constantly
// computed and thrown away.
var UpdateThrash = function(data) {
// Get all the labels
var spans = document.querySelectorAll('.item .lab');
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark