Skip to content

Instantly share code, notes, and snippets.

View 5pecia1's full-sized avatar
πŸ˜€
Rustaceans

sol 5pecia1

πŸ˜€
Rustaceans
View GitHub Profile
@gauchy
gauchy / notion2Habitica.py
Last active June 25, 2025 18:41
Notion to Habitica Sync tool
import requests, json
#Notion's token and databaseId
token = 'XXX'
databaseId = 'XXX'
#Notion's headers
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json",
@qdm12
qdm12 / README.md
Last active May 11, 2025 10:51
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though πŸ˜‰)

@sarxos
sarxos / pom.xml
Last active April 24, 2025 04:29
CheckerFramework with Lombok and Maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.plan.bofime</groupId>
<artifactId>swim-common-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
@segfault87
segfault87 / dodo_fighter_agent.py
Last active August 19, 2018 10:58
도도 νŒŒμ΄ν„°(https://pycon-2018-dodo-fighter.spoqa.com) μ—μ΄μ „νŠΈ 예제 μ½”λ“œ
import json
import sys
# 도도 νŒŒμ΄ν„°μ— μ°Έκ°€ν•˜κΈ° μœ„ν•΄μ„œλŠ” μ—μ΄μ „νŠΈλ₯Ό λ§Œλ“€μ–΄μ„œ μ œμΆœν•΄ μ£Όμ…”μ•Ό ν•©λ‹ˆλ‹€.
# μ—μ΄μ „νŠΈλŠ” μ‚¬μš©μžκ°€ μž‘μ„±ν•˜λŠ” 인곡지λŠ₯ μ½”λ“œλ‘œμ„œ, μ£Όμ–΄μ§€λŠ” ν˜„μž¬ κ²Œμž„ μƒνƒœλ₯Ό λ°”νƒ•μœΌλ‘œ
# μ–΄λ–€ μ•‘μ…˜μ„ μ·¨ν• μ§€λ₯Ό κ²°μ •ν•˜λŠ” 역할을 ν•©λ‹ˆλ‹€.
#
# μ•‘μ…˜ μ„€λͺ…
# - idle - 아무것도 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
# - forward - μ•žμœΌλ‘œ μ›€μ§μž…λ‹ˆλ‹€. μƒλŒ€κ°€ λ°”λ‘œ μ•žμ— μžˆμ„ 경우 더 움직이지 μ•ŠμŠ΅λ‹ˆλ‹€.
@tanaikech
tanaikech / submit.md
Last active April 15, 2021 01:28
Copying Values from JSON to Struct using reflect Package for Golang

Copying Values from JSON to Struct using reflect Package

This is a sample script for copying values from JSON to a struct using reflect package.

Script :

package main

import (
	"encoding/json"
	"fmt"
@styblope
styblope / docker-api-port.md
Last active July 4, 2025 17:58
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@BretFisher
BretFisher / docker-swarm-ports.md
Last active August 12, 2024 16:10
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@sokcuri
sokcuri / ServerTime.js
Last active July 27, 2017 23:49
Calculate and Show ServerTime (Tested Chrome)
function e(){if(typeof clocks!='undefined')return;var sokcuri="Sokcuri ServerTime";var url="https://gist.github.com/";var div=document.createElement('div');div.id="clocks";div.style.position='fixed';div.style.width='100%';div.style.top='0';div.style.height='150';div.style.pointerEvents='none';div.style.backgroundColor='rgba(200, 200, 200, 0.4)';div.innerHTML='μ„œλ²„μ‹œκ°„μ„ μ–»μ–΄μ˜€λŠ” 쀑..';div.style.zIndex='99999';div.style.fontSize='40px';if(document.getElementsByTagName('body').length){document.body.appendChild(div);}else{document.head.outerHTML+=div.outerHTML;} function leadingZeros(n,digits){var zero='';n=n.toString();if(n.length<digits){for(i=0;i<digits-n.length;i++)zero+='0';} return zero+n;} var sec;var curr;var curr_sys;var cont=true;var nget=0;function getsrvTime(){delay=0;if(nget>=200) {clocks.innerHTML="μ„œλ²„μ‹œκ°„μ„ μ–»μ–΄μ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€";return 0;} if(window.XMLHttpRequest){var req=new XMLHttpRequest();req.open('HEAD',window.location.href.toString()+'?&_='+new Date().getTime(),true);req.setRequestHeader("Content-Type","text/htm