Based on this article
ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does
This script can be copy paste to ssh as is. No hands installation. :-)
yum install zsh -y
[package] | |
name = "gemini-teacher" | |
version = "0.1.0" | |
edition = "2021" | |
default-run = "gemini-teacher" | |
[dependencies] | |
tokio = { version = "1.32", features = ["full"] } | |
tokio-tungstenite = { version = "0.17",features = ["rustls-tls-native-roots"] } | |
tungstenite = { version = "0.20", features = ["rustls-tls-native-roots"] } |
ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does
This script can be copy paste to ssh as is. No hands installation. :-)
yum install zsh -y
git log --since="2022-01-01" --until="2022-12-31" --numstat --pretty="%an" | | |
awk ' | |
{ | |
if (NF == 1) author = $0 | |
else if (NF > 1) { | |
added[author] += $1; | |
removed[author] += $2; | |
} | |
} | |
END { |
apiVersion: networking.istio.io/v1alpha3 | |
kind: EnvoyFilter | |
metadata: | |
name: inf-auth-gateway-filter-grpc | |
spec: | |
workloadLabels: | |
app: istio-ingressgateway | |
filters: | |
- listenerMatch: | |
portNumber: 443 |
apiVersion: apps/v1 | |
kind: ReplicaSet | |
metadata: | |
name: inf-auth-gateway-grpc | |
labels: | |
app: inf-auth-gateway-gprc | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
import com.google.rpc.Status; | |
import io.envoyproxy.envoy.service.auth.v2.AuthorizationGrpc; | |
import io.envoyproxy.envoy.service.auth.v2.CheckRequest; | |
import io.envoyproxy.envoy.service.auth.v2.CheckResponse; | |
import io.envoyproxy.envoy.service.auth.v2.DeniedHttpResponse; | |
import io.envoyproxy.envoy.type.HttpStatus; | |
import io.envoyproxy.envoy.type.StatusCode; | |
import io.grpc.Server; | |
import io.grpc.ServerBuilder; | |
import io.grpc.stub.StreamObserver; |
<dependencies> | |
<dependency> | |
<groupId>io.envoyproxy.controlplane</groupId> | |
<artifactId>api</artifactId> | |
<version>0.1.15</version> | |
</dependency> | |
<dependency> | |
<groupId>io.grpc</groupId> | |
<artifactId>grpc-netty-shaded</artifactId> | |
<version>1.20.0</version> |
apiVersion: apps/v1 | |
kind: ReplicaSet | |
metadata: | |
name: inf-auth-gateway-rest | |
labels: | |
app: inf-auth-gateway-rest | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
apiVersion: networking.istio.io/v1alpha3 | |
kind: EnvoyFilter | |
metadata: | |
name: inf-auth-gateway-rest | |
spec: | |
workloadLabels: | |
app: istio-ingressgateway | |
filters: | |
- listenerMatch: | |
portNumber: 443 |
@RestController | |
@Slf4j | |
public class AuthController { | |
@GetMapping("/") | |
public void auth(HttpServletRequest request, HttpServletResponse response) { | |
Map<String, String> headers = new HashMap<>(); | |
Enumeration headerNames = request.getHeaderNames(); | |
while (headerNames.hasMoreElements()) { |