Skip to content

Instantly share code, notes, and snippets.

View david50407's full-sized avatar

Davy david50407

View GitHub Profile
@thalamus
thalamus / ArchLinuxARM-M1
Last active November 16, 2024 05:37
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu
@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns
@JoshCheek
JoshCheek / ruby-command-line-fu.md
Last active September 13, 2024 20:26
Ruby command line fu

Ruby in place of sed / awk

One of Ruby's major influences was Perl, leaving well equipped to replace bash, sed, and awk. Lets take a look at how to do that.

The -e flag

@danny8376
danny8376 / resolver_ptr_cname.patch
Last active December 9, 2015 18:06
nginx resolve ptr cname patch
--- src/core/ngx_resolver.c.orig 2015-04-21 22:11:59.000000000 +0800
+++ src/core/ngx_resolver.c 2015-12-10 01:13:54.230523751 +0800
@@ -2012,7 +2012,7 @@
int32_t ttl;
ngx_int_t octet;
ngx_str_t name;
- ngx_uint_t i, mask, qident, class;
+ ngx_uint_t i, mask, qident, type, class;
ngx_queue_t *expire_queue;
ngx_rbtree_t *tree;
@jpillora
jpillora / sshd.go
Last active November 17, 2024 21:43
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@ascendbruce
ascendbruce / gist:10584882
Created April 13, 2014 13:46
KKBOX 授權擁有的動漫卡通音樂 集中帖 第一頁 (markdown)

整理自 KKBOX 討論區的「KKBOX 授權擁有的動漫卡通音樂 集中帖」的第一頁(討論串樓主整理的)

需注意後面零星的歌單並沒有整理到這裡

這個 gist 是整理到 ACG Music (Taiwan) 前整理用 temp。

「鋼之鍊金術師」

《劇場版 主題曲》Link-L'Arc-en-Ciel(彩虹樂團)

anonymous
anonymous / gist:3212014
Created July 30, 2012 23:45
想當年,學長誆我在梯前
想當年,
學長誆我在梯前,
糊塗進電研,
十七八青春宅窩獻,
枉費俺這俊俏臉,
辛酸直含淚。
天無眼,
自忖力拚一兩年,
不眠也不睡,