Skip to content

Instantly share code, notes, and snippets.

View hiyosi's full-sized avatar

Tomoya Usami hiyosi

View GitHub Profile
@hiyosi
hiyosi / README.md
Last active September 18, 2024 23:06
TUF

prepare repository

[p1]$ go run main.go -init --work-dir repo
flowchart TD
    Root --> Snapshot
 Root --> Timestamp

server.go

package main

import (
   "fmt"
   "log"
   "net"
   "time"
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"log"
"os"
@hiyosi
hiyosi / configure-vault.md
Last active September 6, 2021 02:27
Configure Upstream Vault and Install on k8s
@hiyosi
hiyosi / clean.el
Created May 10, 2020 13:38 — forked from rougier/clean.el
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-policy
namespace: default
spec:
# ポリシを適用するPodをselectorで指定
podSelector:
# IngressとEgressを両方またはいずれか指定
policyTypes:
#!/bin/bash
a=(
'sudo echo ${foo}'
'sudo ls -l'
'ls -l | sudo echo ${foo}'
)
foo="hello"
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
func main() {
r := mux.NewRouter()
r.HandleFunc("/foo", someHandler)
var err error
listener, err := net.Listen("unix", "/var/run/fcgi.sock")
if err != nil {
log.Fatal(err)
}
package cmd
import (
"bytes"
"testing"
)
func TestCmd(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
errBuf := bytes.NewBuffer([]byte{})