Skip to content

Instantly share code, notes, and snippets.

@thanhhnguyen23
thanhhnguyen23 / http.clj
Created May 4, 2024 16:43 — forked from danielsz/http.clj
Ring-compliant web server from scratch
(ns socket.http
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.logging :as log])
(:import [java.net ServerSocket]
[java.net SocketException]
[java.nio.file Files]
[java.io File]
[java.io InputStream OutputStream]))
@ovidiuvio
ovidiuvio / gist:b2be70614605356747bd43482ac52dfc
Created May 9, 2023 19:13
Running netbird (tailscale like wireguard solution) on EdgeRouter X
1. Install EdgeRouter wireguard-vyatta-ubnt kernel package from here
curl -L -O https://github.com/WireGuard/wireguard-vyatta-ubnt/releases/download/1.0.20220627-1/e50-v2-v1.0.20220627-v1.0.20210914.deb
dpkg -i e50-v2-v1.0.20220627-v1.0.20210914.deb
2. Install netbird for mipsel from here:
curl -L -O https://github.com/ovidiuvio/netbird/releases/download/v0.19.0-mipsel-4/netbird_0.19.0-mipsel-4_linux_mips_softfloat.tar.gz
tar -xf netbird_0.19.0-mipsel-4_linux_mips_softfloat.tar.gz
sudo mv netbird /usr/bin/
sudo netbird service install
sudo netbird service start
sudo netbird up
@Restioson
Restioson / Readme.md
Last active May 4, 2024 16:42
[Obsidian] Search through your Fantasty Statblocks bestiary by CR/type

Monster Search

Search through your Fantasty Statblocks bestiary by monster CR and type, using Dataview!

image

How to add

  1. Make sure that Meta-Bind, Fantasy Statblocks, Dataview and is installed
@Juul
Juul / lte_mbim_from_scratch.md
Last active May 4, 2024 16:40
How to use 4G LTE modems like the MC7455 on both Debian/Ubuntu and OpenWRT using MBIM

The purpose of this document is to get you familiar with the concepts and command line tools involved with connecting to the internet using modern 4G LTE modems on both Debian/Ubuntu and OpenWRT.

This writeup is based on my experiences with the Sierra Wireless AirPrime MC7455 modem and a Calyx (Sprint) SIM card, but it should apply to most modern 4G LTE modems.

High level overview

These are the steps required:

  • Physically connect antennas
@lynchjames
lynchjames / deploy.cmd
Last active May 4, 2024 16:36
Preparing Obsidian vault for pushing to Azure DevOps Wiki
echo 'Copying attachment files into .attachments folder'
cp attachments/* .attachments/
echo 'Updating attachment links'
find . -type f -name "*.md" -print0 | xargs -0 sed -i 's/(attachments\//(\/\.attachments\//g'
@wojteklu
wojteklu / clean_code.md
Last active May 4, 2024 16:35
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active May 4, 2024 16:34
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 4, 2024 16:31
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+