Skip to content

Instantly share code, notes, and snippets.

@xeptore
xeptore / main.go
Created April 12, 2024 11:43
Fizzbuzz in Go
package main
import (
"fmt"
"strconv"
)
func main() {
var iterationsStr string
fmt.Print("Enter the number of iterations: ")
@xeptore
xeptore / rule-set.json
Last active December 29, 2023 20:46
All commands and code snippets
{
"route": {
"rule_set": [
{
"tag": "ir",
"type": "remote",
"format": "source",
"url": "https://gist.githubusercontent.com/z4x7k/8604b64ec25e37f0acb1c7f0c9d2a7a8/raw/ir-rule-set.json",
"download_detour": "direct"
},
@xeptore
xeptore / openapi.yml
Created September 28, 2023 09:42
openapi.yml
components:
securitySchemes:
bearerToken:
bearerFormat: JWT
scheme: bearer
type: http
cookieToken:
in: cookie
name: __Host-session_id
type: apiKey
@xeptore
xeptore / openapi-v3.1-operation-object-schema.yaml
Last active January 18, 2024 04:40
The description of OpenAPI v3.1.x operation documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0
$id: https://gist.githubusercontent.com/xeptore/87f3b80f5c13e9d2c5b620c338c2c43e/raw/openapi-v3.1-operation-object-schema.yaml
$schema: https://json-schema.org/draft/2020-12/schema
title: OpenAPI v3.1.x Operation Object Schema
$comment: https://spec.openapis.org/oas/v3.1.0#operation-object
type: object
additionalProperties: false
unevaluatedProperties: false
required:
- tags
- summary
@xeptore
xeptore / guide.md
Last active December 3, 2022 05:59
Accessing Self-Managed GitLab

Accessing Self-Managed GitLab

This guide with help you to setup up your environment in order to access the new self-managed GitLab instance accessible at https://git.eways.dev/.

Setup

  1. Install cloudflared
  2. Configure SSH to use cloudflared

You need append the following lines to your SSH client configuration file:

@xeptore
xeptore / wg-net.conf
Created October 7, 2022 05:30
WireGuard Chain Setup Config
[Interface]
Address = 10.66.66.1/24,fd42:42:42::1/64
ListenPort = 55280
PrivateKey = ???
FwMark = 51820
PostUp = iptables -A FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostUp = iptables -I FORWARD -i %i -o ivpn -j ACCEPT
PostUp = iptables -I FORWARD -o %i -m state --state RELATED,ESTABLISHED -j ACCEPT
PreDown = iptables -D FORWARD -o %i -m state --state RELATED,ESTABLISHED -j ACCEPT
PreDown = iptables -D FORWARD -i %i -o ivpn -j ACCEPT
@xeptore
xeptore / second.py
Created October 29, 2021 20:36
Solution to Codility.com Coding Challenge 2nd Problem
import math
def move_element_at_index_to_last(i, l):
return l[:i] + l[i + 1:] + [l[i]]
BEST = math.inf
def find(l, d):
global BEST
@xeptore
xeptore / config.conf
Created July 4, 2021 07:54
Nginx Static Files Proxy Pass Configuration
server {
server_name _;
index index.html index.htm index.nginx-debian.html;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000/;
@xeptore
xeptore / voucher-validator.ts
Last active July 4, 2021 06:05
Voucher Validator Idea Implementation
const enum Gender {
Male = "Male",
Female = "Female",
}
interface Order {
id: string;
date: Date;
totalPrice: number;
customer: {
@xeptore
xeptore / gitlab-runner-cache-s3-policy.md
Created April 6, 2021 06:22
GitLab Runner (Shared) Cache Amazon S3 Bucket Policy

GitLab Runner (Shared) Cache Amazon S3 Bucket Policy

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"seems-it-doesnt-matter-much-except-the-uniqueness",
      "Effect":"Allow",
      "Action":[