Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
crab crab

Kaan Karakaya TheYkk

🦀
crab crab
View GitHub Profile
View trivy-as-lib.go
package main
import (
"context"
"flag"
image2 "github.com/aquasecurity/fanal/artifact/image"
"github.com/aquasecurity/fanal/cache"
"github.com/aquasecurity/fanal/image"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/log"
@TheYkk
TheYkk / test.sh
Created Feb 1, 2021 — forked from developer-guy/test.sh
Display Kubernetes OpenAPI Spec
View test.sh
#!/usr/bin/env bash
set -e
# Proxy minikube to localhost on arbitrary port:
kubectl proxy --port=8080 &
sleep 3
# Now swagger.json is available at localhost:12345/openapi/v2
# Save to /tmp/temp/json and serve with e.g. docker swagger-ui container
curl http://localhost:8080/openapi/v2 > /tmp/temp.json
docker container run -d -p 9999:8080 -e SWAGGER_JSON=/var/specs/temp.json -v /tmp/temp.json:/var/specs/temp.json swaggerapi/swagger-ui
@TheYkk
TheYkk / download.sh
Last active Sep 15, 2020
Download private youtube list as mp3
View download.sh
while IFS= read -r config; do
a=($(echo $config | tr '=' "\n"))
if ls *$a[2]* 1> /dev/null 2>&1; then
echo "files do exist"
else
youtube-dl -x --audio-format mp3 $config
fi
done< <(jq -c -r '.[]' < 32file.json)
@TheYkk
TheYkk / worker.js
Created Jul 24, 2020 — forked from maxkostinevich/worker.js
Serverless Geolocation Service
View worker.js
/*
* Serverless Geolocation Service, hosted on Cloudflare Workers.
*
* Learn more at https://maxkostinevich.com/blog/serverless-geolocation
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
// https://gist.github.com/maephisto/9228207
View dockerfile
# Install npm packages
FROM node:12-alpine as builder
WORKDIR /usr/src/app
COPY package.json .
RUN yarn install --prod
# Push js files
FROM node:12-alpine
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules
@TheYkk
TheYkk / megalovania.sh
Created May 29, 2020
beep megalovania
View megalovania.sh
# megalovania first part
# for mikrotik routerboard
# by linuxgemini
#
# challenge started by ave
# bar 1
beep -f 293 -l 140
beep -f 293 -l 122
@TheYkk
TheYkk / cloudSettings
Last active Feb 16, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-02-16T17:15:02.859Z","extensionVersion":"v3.4.3"}
View fast.js
// ? Login user
fastify.post(
'/login',
{
schema: {body: loginSchema},
},
async (req, res) => {
const {email, password} = req.body;
await UserModel.getAuthenticated(email, password, (err, user) => {
View pro.yaml
apiVersion: v1
items:
- apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
creationTimestamp: "2019-09-24T14:59:50Z"
generation: 1
labels:
app: prometheus-operator-prometheus
chart: prometheus-operator-6.11.0
@TheYkk
TheYkk / README.md
Created Aug 12, 2019 — forked from denji/README.md
Simple Sentry docker-compose.yml
View README.md
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000