Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile

Variables in the Caddyfile

Caddy is a super webserver that has many useful features. Caddy can enable very very powerful scenarios and many of them are documented in this Wiki. As these scenarios become more elaborate (some might say complex!) writing a caddy config file starts to feel more like programming than basic configuration.

When that starts to happen I find myself reaching out for variables to enable multiple scenarios in a single configuration file by manipulating those variables.

For those situations caddy has a few types of variables to consider. What I hope to do here is illuminate how to use these variable types in the Caddyfile.

A note about examples

I will use examples to illustrate the concepts. I use the respond directive to verify how caddy works.

@minhhieutruong0705
minhhieutruong0705 / OpenCV_Build-Guide.md
Last active November 8, 2025 18:32
Guide to build OpenCV from Source with GPU support (CUDA and cuDNN)

Guide to build OpenCV from source with GPU support (CUDA and cuDNN)

Feb 22nd, 2022

System specification

  • Operating system: Ubuntu 20.04 x84_64 (64-bit)
  • Architecture: amd64
  • GPU: NVIDIA GeForce RTX 3090
  • Python 3.8

Install dependencies and recommeneded packages

@slavistan
slavistan / cuda-ready-archlinux-for-wsl2.md
Last active October 23, 2025 08:16
CUDA-ready Archlinux for WSL2

This is a brief guide on how to install Archlinux as a WSL2 distribution and how to set up CUDA afterwards.

As of late, Window's WSL2 offers GPU passthrough from WSL2/Linux to Windows for NVidia graphics cards which allows to run (and develop) CUDA-based applications on the WSL2/Linux-side with almost native performance. Unfortunately, the official guides for the CUDA setup for WSL2/Linux are predominantly Ubuntu-specific. Here's to you, Arch!

1. Install Archlinux

  1. Make sure that your Windows meets the dependencies and that your WSL2 is set up. See these instructions.

Archlinux is not among the default distributions available for WSL2. We'll install it from a tarball instead, a functionality offered natively by the WSL.

@scrouthtv
scrouthtv / Arch-aarch-qemu
Created October 15, 2021 16:10
Creating an aarch64 VM for qemuhost, with Arch Linux guest
/*
* This document is provided to the public domain under the
* terms of the WTFPL license.
*/
This is
This is a combination of
- [How to boot Arch Linux ARM in QEMU (patched for M1)](https://gist.github.com/thalamus/561d028ff5b66310fac1224f3d023c12) - thanks to Avatar
Will Tisdale
@luc65r
luc65r / functor.zig
Created September 21, 2021 21:46
Zig functor
const std = @import("std");
const expect = std.testing.expect;
fn Functor(
comptime F: fn (comptime type) type,
) type {
return struct {
fmap: fmap_type,
const Self = @This();
@CharlesGodwin
CharlesGodwin / How to use ssh-copy-id.md
Last active August 26, 2025 17:37
Windows 10/11 scripts to support ssh-copy-id which is missing in Windows OpenSSH

The Windows version of OpenSSH client doesn't include a ssh-copy-id command. I don't know why. If it does one day, then this gist can be ignored.

  • This script is written in PowerShell as the legacy program cmd.exe is not flexible enough for the required options.
  • Download the file ssh-copy-id.ps1 to your Windows PC, or copy and paste its contents to a file of the same name.
  • Run the script passing your linux account ssh information (for example powershell .\ssh-copy-id.ps1 [email protected]). If you use a non-standard port add the parameter -port=nnnn. This should work with any Linux platform.
  • Run the command for each linux account you connect with. You will be prompted for your Linux host password. If you have more than 1 account on any machine, you must do this for each account.

If the script won't run, then run this command once

Set-ExecutionPolicy RemoteSigned CurrentUser

@pooladkhay
pooladkhay / wayland-blurry-fix.md
Last active September 14, 2025 20:52
VSCode blurry text under Wayland

Source: https://wiki.archlinux.org/title/Visual_Studio_Code#Blurry_text_under_Wayland

Due to Electron issues Visual Studio Code defaults to run under XWayland which may cause blurry text if you're using HiDPI screens.

In order to fix this issue you need to force Electron to run under Wayland by adding --enable-features=UseOzonePlatform --ozone-platform=wayland, for example you'll be launching VSCode like

$ code --enable-features=UseOzonePlatform --ozone-platform=wayland

This fix can be made permanent by creating a .desktop file or by directly editing /usr/share/applications/visual-studio-code.desktop

@TayouVR
TayouVR / DynamicPenetrationSystem.md
Last active July 28, 2025 04:38
A Guide to the Dynamic Penetration System

Dynamic Penetration Guide (EN) (日本語版)

for Dynamic Penetration System v1_21 (Gumroad)
I noticed some things aren't super clear for the Dynamic Penetration System, there is a lack of documentation to some extent.
This Guide does not describe how to set up penetrators using the provided script, but rather aids people in the manual process. Instructions for the Script may come at a later point.


Channels:

Light Ranges correspond to channels.

@pmenke-de
pmenke-de / README.md
Last active May 10, 2024 09:54 — forked from chpatrick/nix-cmake
Using CLion with Nix

let's say you have a C++ project in Nix that you want to work on with CLion so that the nix dependencies are available.

  1. create a .nix utility directory in your project directory.
  2. put the below nix-run.sh and nix-cmake.sh in the .nix directory.
  3. in the .nix directory create symlinks for make, gcc, g++ - and maybe more tools, that need to have the nix dependencies and build tools available - and point them to nix-run.sh
  4. then, in Settings -> Build, Execution, Deployment -> Toolchains set CMake to the path to nix-cmake.sh and point all other build tools to the symlinks you've created.
@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active October 15, 2025 10:43
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally

Commit jupyter notebooks code to git and keep output locally

  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file: