Skip to content

Instantly share code, notes, and snippets.

@stantoxt
stantoxt / ssl.md
Created August 13, 2020 09:25
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@stantoxt
stantoxt / -
Created March 8, 2021 06:07 — forked from noman798/-
This file has been truncated, but you can view the full file.
agg_time,prov,city,com_scope,com_sub_scope,investor,round,money,currency,money_num,valuation,name,com_registered_name,slogan,invse_title,com_des,com_id,累计融资,未透露轮数
2019-12-06,香港,中西区,游戏,游戏开发商,"阿里巴巴(领投),Bright Success Capital,Vectr Ventures(领投),Apes Ventures,Ironfire Ventures",种子轮,215万美元,美元,1440.5,6987.5,Area28 Technologies,,游戏开发服务提供商,Area28 Technologies完成215万美元种子轮融资,Area28 Technologies是一家中国香港的游戏开发服务提供商,致力于打造“世界上第一个基于云的协作平台和游戏引擎,让游戏开发团队能够实时连接和创造”。,35506468,1440.5,
2019-12-06,江苏,苏州,硬件,芯片半导体,"凯风创投(领投),德迅投资,智由友金苗基金(领投)",Pre-A轮,数千万人民币,人民币,1000,15000,原位芯片,苏州原位芯片科技有限责任公司,微纳芯片研发商,原位芯片完成数千万元Pre-A轮融资,原位芯片是一家微纳芯片研发商,专注于新型MEMS芯片与模组的研发、生产和销售。掌握40多项领先MEMS技术,拥有芯片设计、工艺开发、流片生产和测试的全流程自主研发、自主生产能力。相关加工服务。,34882238,1000,
2019-12-06,江苏,南京,新工业,轻工制造,南京创投,A轮,未透露,人民币,,10000,英尼格玛,南京英尼格玛工业自动化技术有限公司,自动化生产设备及控制系统研发商,英尼格玛完成A轮融资,"英尼格玛是一家致力于电弧3D打印、自动化、智能化系统及生产线的研发、制造、调试、销售、服务的创新型科技公司。以""为工业制造提供先进、安全、可靠的解决方案""为使命,本着""传递价值,承载信托""的企业精神,英尼格玛为汽车制造、电力、军工、石油化工、航空航天、船舶、重型机械、科研院所等各行业的客户提供优质的产品和完善的售前、售后服务。",35505431,,1
2019-12-06,欧洲,英国,广告营销,移动及网络广告,Idin
@stantoxt
stantoxt / letsencrypt-acme-guide.md
Created April 25, 2022 05:31 — forked from ammgws/letsencrypt-acme-guide.md
Using acme.sh script to renew LetsEncrypt certs using non-standard SSL port

1. Install acme.sh shell script

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install

Optionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.

@stantoxt
stantoxt / CustomerController.cs
Created May 20, 2022 14:02 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
// open your terminal
1. Download source from official website
2. Extract it into some folder
3. Do this command
cd source_of_postgres_dir
./configure
make
su
make install
adduser postgres
@stantoxt
stantoxt / installing_postgresql.md
Created June 5, 2023 10:57 — forked from 15Dkatz/installing_postgresql.md
PostgreSQL installation tutorial

Let's install PostgreSQL onto your operating system.

As an open source object-relational database management system, PostgreSQL available for MacOS, Linux, and Windows.

Goal for each Operating System

The goal will be to run the following command successfully from the command line (regardless of the OS):

psql -U postgres

This should open the psql interactive shell and print a prompt that looks like:

@stantoxt
stantoxt / Startup.cs
Created August 9, 2023 14:50 — forked from aqwert/Startup.cs
ASPNetCore Change response via Middleware
namespace Project
{
public class Startup
{
public Startup(IHostingEnvironment env)
{
//...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
# Opens a PowerShell instance with elevation, finds the wsl ip without relying on hostname, since ArchWSL and others doesn't have it
# then iterate opening the selected ports
$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
$remoteport = wsl -- ip -o -4 -json addr list eth0 ` | ConvertFrom-Json ` | %{ $_.addr_info.local } ` | ?{ $_ }
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if($found) {
$remoteport = $matches[0];
} else{