Skip to content

Instantly share code, notes, and snippets.

View Narazaka's full-sized avatar
🐫
Just Another **** Hacker,

Narazaka Narazaka

🐫
Just Another **** Hacker,
View GitHub Profile
@slavistan
slavistan / cuda-ready-archlinux-for-wsl2.md
Last active June 13, 2024 00:46
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.

@deksoke
deksoke / 1-install-container.bat
Created April 16, 2019 10:23
Install Container & Hyper-V in Windows 10 Home
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause
@lazlo-bonin
lazlo-bonin / UndoUtility.cs
Last active June 17, 2024 12:51
Fixing Unity's broken Undo.RecordObject
using UnityEditor;
using UnityEngine;
using UnityObject = UnityEngine.Object;
namespace Ludiq
{
public static class UndoUtility
{
private static void RecordObject(UnityObject uo, string name)
{
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 6, 2024 00:25 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
param ( $TemplateFile, $Destination, $Styles, $Values )
$ErrorActionPreference = 'Stop'
$TemplateFile = 'C:\Users\Administrator\Desktop\Source.xlsx'
$Destination = 'C:\Users\Administrator\Desktop\Output.xlsx'
$Styles = '
{
"マイ シート": {
"MyArea1": "Variable1",
@0xbadfca11
0xbadfca11 / Wrong usage Optimize-VHD.md
Created January 5, 2016 09:38
お前らの Optimize-VHD の使い方は間違っている
  • ゲストでsdelete -z→シャットダウンして→Optimize-VHD -Mode Prezeroed
  • ホストでMount-VHDsdelete -zDismount-VHDOptimize-VHD -Mode Prezeroed

これらは時間と書き込み量を浪費しているだけだから今すぐ止めて
Mount-VHD <VHD> [-NoDriveLetter] -ReadOnly -Passthru | Optimize-VHD [-Mode {Quick|Full}] -Passthru | Dismount-VHD
を使うべき。

なんで?

読み取り専用でマウントしている時に Optimize-VHD をすればディスクイメージ内の NTFS から得られる空き領域情報を利用するから。

@willprice
willprice / .travis.yml
Last active June 15, 2024 04:29
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@voluntas
voluntas / shiguredo.rst
Last active June 6, 2024 02:04
時雨堂コトハジメ
@lunark
lunark / GenderEstimate.bas
Last active October 14, 2023 04:04
VBAマクロ向け関数。GenderEstimate。漢字の名前とふりがなから、性別を推定する関数
Public Function GenderEstimate(ByVal strMK As String, Optional strMF As String = "") As String
GenderEstimate = ""
strMK = Replace(Replace(Replace(strMK, " ", ""), " ", ""), "「", "")
strMF = Replace(Replace(StrConv(strMF, vbHiragana), " ", ""), " ", "")
'デバッグ用。こいつをブレークポイントに持ってきて挙動を確認する
'If strMK Like "理世" Then
' Debug.Print strMK
'End If
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。