Skip to content

Instantly share code, notes, and snippets.

View markstos's full-sized avatar

Mark Stosberg markstos

View GitHub Profile
@simonplend
simonplend / parseargs-example.mjs
Last active June 5, 2022 06:17
Example using new experimental Node.js parseArgs method (https://nodejs.org/api/util.html#utilparseargsconfig) - more new features covered at https://github.com/simonplend/whats-new-in-node-js-core
import { parseArgs } from "node:util";
const args = parseArgs({
options: {
name: {
type: "string",
},
verbose: {
type: "boolean",
short: "v",
@DonaldKellett
DonaldKellett / 90-logitech-c930e.rules
Last active February 16, 2023 02:54
Disable autofocus and specify absolute focus for Logitech c930e with udev and systemd (Fedora 35 Workstation)
KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0843", TAG+="systemd", ENV{SYSTEMD_WANTS}="logitech-c930e@$env{MINOR}.service"
@ortango
ortango / lsvisible.jq
Created October 27, 2021 17:03
wmfocus quick n' dirty stdin support
#!/bin/jq -rf
.monitors[] |
.focusedDesktopId as $d |
.desktops[] |
select(.id==$d) |
.focusedNodeId as $fw |
getpath(paths(.client?!=null and .hidden==false)) |
.id as $w |
.client |
@grafov
grafov / part-of-sway-config
Created April 3, 2021 14:08
Configuration for the remapping Kensington Expert Mouse buttons for Sway WM
# Copypaste it to your ~/.config/sway/config
set $TBALL 1149:4128:Kensington______Kensington_Expert_Mouse
# Turns on scrolling with the ball when right bottom button pressed.
input $TBALL {
scroll_method on_button_down
scroll_button 273
}
@akihikodaki
akihikodaki / README.en.md
Last active April 20, 2024 02:43
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@thalamus
thalamus / ArchLinuxARM-M1
Last active March 11, 2024 16:55
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
@vietor
vietor / md-renderer.html
Last active February 18, 2024 19:44
Nginx render markdown by browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/milligram/1.4.1/milligram.min.css">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/styles/github.min.css">
<script type="application/javascript" src="https://cdn.bootcdn.net/ajax/libs/marked/1.1.1/marked.min.js"></script>
<script type="application/javascript" src="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/highlight.min.js"></script>
<style rel="stylesheet">
body {
@kppullin
kppullin / config.fish
Created May 16, 2020 03:51
Fish shell + WSL2 + gnome-keyring / secret-tool
#
# This fish config sets up a working `gnome-keyring` on WSL2.
# I imagine it will work with WSL1 as well, perhaps after adjusting the `DISPLAY` value.
#
# Based off this bash script: https://askubuntu.com/questions/815327/running-gnome-keyring-on-wsl-windows-subsystem-for-linux
# Tested and working with `aws-vault` and `jetbrains-toolbox`.
#
# Be sure your x server is running!!!
set -x DISPLAY (cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
@ha7ilm
ha7ilm / i3.conf
Last active October 22, 2021 16:11
Prompt to rename current workspace in i3 so that the new name starts with the number of the current workspace, e.g. "1:term"
bindsym $mod+u exec i3-input -F "rename workspace to \"$(i3-msg -t get_workspaces | jq -r \"map(select(.focused))[0].num\"):%s\"" -P 'New name for this workspace: '
@david-zw-liu
david-zw-liu / remove_old_builds.sql
Last active January 4, 2024 06:31
Keep 1000 builds per repos for DroneCI (sqlite3 version >= 3.25 required)
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite
-- Enable to delete logs by cascading delete
PRAGMA foreign_keys = ON;
WITH n_build_ids_per_repo as (
SELECT build_id
FROM (
SELECT
build_id,
build_repo_id,