Skip to content

Instantly share code, notes, and snippets.

View mrusme's full-sized avatar
🌊
Surfing the great wave off Kanagawa

◤◢◤◢◤◢◤◢ mrusme

🌊
Surfing the great wave off Kanagawa
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active May 4, 2024 09:26
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@Nama
Nama / sway_workspaces.py
Last active January 27, 2023 18:54
Restore workspaces in sway to displays and move applications to saved workspaces. Maintained in its own repo now: https://github.com/Nama/sway-workspaces
#!/usr/bin/python
'''
* setup displays first, e.g. with wdisplay
* run after setting up your displays `python sway_workspaces.py save <profilename>`
* repeat for every display setup
* setup kanshi and make it run `python sway_workspaces.py load <profilename>`
Multiple windows of an application/class aren't handled. No idea how to do so.
Had to alter the default tree, so the outputs are not the ports.
@mrusme
mrusme / tmux-cheatsheet.txt
Last active February 13, 2024 20:09
Tmux Cheatsheet (80 char ASCII version of https://www.tmuxcheatsheet.com)
╔════════════════════════════════════════════════════════════════════════════╗
║ Sessions ║
╚════════════════════════════════════════════════════════════════════════════╝
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ $ tmux ┃ ┃ $ tmux ls ┃
┃ $ tmux new ┃ ┃ $ tmux list-sessions ┃
┃ $ tmux new-session ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┃ : new ┃ [Ctrl] + [b] [s]
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Show all sessions
Start a new session
@mrintrepide
mrintrepide / Wayland Native.md
Last active April 14, 2024 09:21
Wayland Native Games Compatibility List
Game Wayland Engine Info
Aragami no Unity SDL2: crash
Baba Is You no Multimedia Fusion 2 SDL2: crash
Bastion yes* FNA-XNA SDL2 preload mouse KO, xbox pad OK
BattleBlock Theater® no - SDL2: crash
Besiege no Unity SDL2 : no effect
BioShock Infinite yes* Unreal Engine 3 SDL2 preload
BIT.TRIP Presents... Runner2: Future Legend of Rhythm Alien no - SDL2: crash
Black Mesa yes* Source SDL2 preload
@dustyfresh
dustyfresh / default.conf
Last active May 10, 2022 12:53
Hardened nginx config
# Security enhancements and custom Nginx server header
#
# Requirements:
# $ apt install nginx vim
# $ apt install libnginx-mod-http-headers-more-filter
# $ vim /etc/nginx/sites-enabled/default
#
# Further reading http://docs.hardentheworld.org/Applications/Nginx/
#
server {
@janga1
janga1 / spotify.html
Created March 3, 2020 10:14
A Hugo shortcode to embed Spotify songs.
{{ if in .Params "small"}}
<iframe src="https://open.spotify.com/embed/track/{{ .Get 0 }}" width="300" height="80" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
{{ else }}
<iframe src="https://open.spotify.com/embed/track/{{ .Get 0 }}" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
{{ end }}

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@fnky
fnky / ANSI.md
Last active May 5, 2024 19:31
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@andphe
andphe / gist:3232343
Created August 2, 2012 01:41
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@jboner
jboner / latency.txt
Last active May 5, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD