Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile
@slavistan
slavistan / cuda-ready-archlinux-for-wsl2.md
Last active January 5, 2025 18:14
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();
@pooladkhay
pooladkhay / wayland-blurry-fix.md
Last active February 27, 2025 21:20
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 December 4, 2024 14: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 April 7, 2025 11:33
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:

@hihebark
hihebark / kill_kinsing_kdevtmpfsi.sh
Last active May 7, 2021 11:48
an unsuitable quick solution to kill the kdevtmpfsi / kinsing malware spreading.
#!/bin/sh
# an unsuitable quick solution
# added it to crontab -e
ps -aux | grep -v grep | grep -E "kdevtmpfsi|kinsing" | awk '{print $2}' | while read line ; do kill -9 $line ; done && rm -rf /tmp/kdevtmpfsi* && rm -rf /tmp/kinsing*
echo "$(date) removing..."
@ityonemo
ityonemo / test.md
Last active April 16, 2025 07:10
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@pesterhazy
pesterhazy / promises-cljs.md
Last active April 14, 2025 16:42
Promises in ClojureScript

Chaining promises

Chaining promises in ClojureScript is best done using the thread-first macro, ->. Here's an example of using the fetch API:

(-> (js/fetch "/data")
    (.then (fn [r]
             (when-not (.-ok r)
               (throw (js/Error. "Could not fetch /data")))
             (.json r)))