Skip to content

Instantly share code, notes, and snippets.

View rytsh's full-sized avatar
🌿
fotosentez

Eray Ates rytsh

🌿
fotosentez
View GitHub Profile
#!/usr/bin/env bash
###################
# Containerd
###################
set -e
cd $(dirname $(realpath $0))
mkdir -p tools && cd tools
@rytsh
rytsh / presentation.md
Created January 9, 2024 03:09
presentation

Presentation files

@rytsh
rytsh / mapToStructGen.go
Created June 26, 2023 23:42
map to struct golang generation
//go:build ignore
package main
import (
"log"
"os"
"reflect"
"text/template"
@rytsh
rytsh / job-trivy.yml
Created October 4, 2022 19:20
trivy check
# Security scan with trivy
security:trivy:
stage: security
variables:
GIT_STRATEGY: none
image:
name: $TRIVY_IMAGE_CUSTOM
entrypoint: [""]
cache:
key: trivy-cache
@rytsh
rytsh / all.go
Last active September 26, 2022 16:04
call example
package main
import (
"context"
"fmt"
"log"
"github.com/rytsh/call"
)
@rytsh
rytsh / socatDocker.sh
Created June 7, 2022 22:25
socat docker socket
docker run --rm -it --name socat -p 2375:2375 -v /var/run/docker.sock:/var/run/docker.sock:ro alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
@rytsh
rytsh / testfortemplate.json
Created March 22, 2022 15:00
for with go template
{
"update":{
"issuelinks":[
{{range $i, $value := .issuelinks }}
{{- if $i}},{{ end }}
{
"add":{
"type":{
"name":"Relates"
},
@rytsh
rytsh / reach.sh
Created February 14, 2022 09:45
check port is reachable
cat ~/configs/resolv.conf | cut -d' ' -f2 | xargs -I {} sh -c "timeout 0.5 nc -z {} 53 && echo Reachable {} || echo Not {}"
@rytsh
rytsh / jsonMap.go
Created October 19, 2021 11:48
Embed Map to JSON output
package main
import (
"bytes"
"encoding/json"
"fmt"
)
type test struct {
KeyValue map[string]interface{} `json:"-"`
@rytsh
rytsh / check.sh
Last active June 11, 2021 04:48
Run command recursively
function check() {
# deep first search
for i in $(ls -d */ 2>/dev/null); do
(
cd ${i}
check ${@}
)
done
# execute command