Skip to content

Instantly share code, notes, and snippets.

View thxCode's full-sized avatar
🎯
Focusing

Frank Mai thxCode

🎯
Focusing
  • Seal
  • ShenZhen, GuangDong
View GitHub Profile
@soarez
soarez / ca.md
Last active July 8, 2024 01:08
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ducas
ducas / Create-Administrator.ps1
Last active May 22, 2024 09:29
Create a local administrator account using PowerShell
$Username = "su"
$Password = "password"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
@fvbock
fvbock / translate.go
Created September 25, 2015 02:10 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@Jaykul
Jaykul / New-RootSignedCert.ps1
Created February 3, 2017 00:20
Generate a self-signed root certificate, and then an SSL cert signed by that root
#.Synopsis
# Generate a self-signed root certificate and then generate an SSL certificate signed by it.
#.Description
# Generates a self-signed root certificate and an SSL certificate signed by it.
# Puts the root public key in a .pem file for adding to PHP's CAcert.pem
param(
# Used as the CN for the Root certificate
$RootName = "NO LIABILITY ACCEPTED - Test Root $(get-date -f "yyyy-MM-dd")",
# Used as the CN for the SSL certificate
$Subject = "${Env:ComputerName}.${Env:UserDnsDomain}",
@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 2, 2024 13:30
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@StevenACoffman
StevenACoffman / Docker Best Practices.md
Last active June 23, 2024 10:51
Docker Best Practices

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

@bobrik
bobrik / README.md
Last active May 7, 2024 12:19
CFS hiccups