Skip to content

Instantly share code, notes, and snippets.

View RaitoBezarius's full-sized avatar
🎯
Very restricted availability

Ryan Lahfa RaitoBezarius

🎯
Very restricted availability
View GitHub Profile
data PosInf a = Infinity | Finite a deriving (Show, Read, Eq)
instance Ord a => Ord (PosInf a) where
compare Infinity Infinity = EQ
compare Infinity Finite{} = GT
compare Finite{} Infinity = LT
compare (Finite a) (Finite b) = compare a b
instance Num a => Num (PosInf a) where
Finite x + Finite y = Finite (x + y)
@RaitoBezarius
RaitoBezarius / strace.txt
Created January 2, 2020 18:23
strace output of all cptofs processes under qemu during ext4 creation process
strace: Process 3288891 attached with 2 threads
[pid 3288893] 19:17:57 futex(0x623f7f88, FUTEX_WAIT, 4294967295, NULL <unfinished ...>
[pid 3288891] 19:17:57 mprotect(0x5d6000, 217088, PROT_READ) = 0
[pid 3288891] 19:17:57 brk(0x624c3000) = 0x624c3000
[pid 3288891] 19:17:57 mprotect(0x400083d000, 4096, PROT_READ) = 0
[pid 3288891] 19:17:57 set_tid_address(0x400104e750) = 146
[pid 3288891] 19:17:57 brk(0x624c4000) = 0x624c4000
[pid 3288891] 19:17:57 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1 RT_2], NULL, 8) = 0
[pid 3288891] 19:17:57 rt_sigaction(SIGRT_32, {sa_handler=0x600c3e70, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x602463ca}, NULL, 8) = 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RaitoBezarius
RaitoBezarius / support-etc-hosts.patch
Created February 12, 2024 15:30
Support /etc/hosts in Mastodon patch
diff --git a/app/lib/request.rb b/app/lib/request.rb
index 8d4120868..e640fadd2 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -261,11 +261,7 @@ class Request
begin
addresses = [IPAddr.new(host)]
rescue IPAddr::InvalidAddressError
- Resolv::DNS.open do |dns|
- dns.timeouts = 5
… while calling the 'map' builtin
at /nix/store/rhn4fkh7hqjlqs9j6naaq623qpl62yz0-source/lib/modules.nix:597:12:
596| (n: concatLists)
597| (map
| ^
598| (module:
… in the condition of the assert statement
at /nix/store/rhn4fkh7hqjlqs9j6naaq623qpl62yz0-source/lib/modules.nix:574:9:
573| checkedConfigs =