Skip to content

Instantly share code, notes, and snippets.

View ianloic's full-sized avatar

Ian McKellar ianloic

View GitHub Profile
@ianloic
ianloic / notes.sh
Created May 31, 2024 16:22
Installing Steam RPM on Fedora Silverblue
# add the rpmfusion free & nonfree repos, if needed
rpm-ostree install -A https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# apply the changes, or reboot into the new version.
sudo rpm-ostree apply-live --allow-replacement
# try to install steam
rpm-ostree install -A steam
# but it fails:
@ianloic
ianloic / remote-code.zsh
Created February 16, 2021 19:49
Zsh function to invoke vscode remote
code () {
local script=$(echo ~/.vscode-server/bin/*/bin/code(*ocNY1))
if [[ -z ${script} ]]
then
echo "VSCode remote script not found"
exit 1
fi
local socket=$(echo /run/user/$UID/vscode-ipc-*.sock(=ocNY1))
if [[ -z ${socket} ]]
then
type piece interface {
Write(wr io.Writer)
}
type stringPiece string
func (sp stringPiece) Write(wr io.Writer) {
fmt.Fprint(wr, string(sp))
}
@ianloic
ianloic / README
Last active December 18, 2020 18:59
uring statx failure
Stating a bunch of files in a git repo fails in a weird way.
It doesn't fail every time but in my checkout of https://github.com/git/git it fails about 30% of the time.
I invoke:
git ls-files | strace -o /tmp/stat-many.strace ~/Projects/git-dirty/stat-many $PWD
I have attached a failing strace.
I'm running a 5.7.17 kernel on amd64 with liburing 0.7 from Debian.
import typing, math
from nmigen import *
from nmigen.build import Platform
from nmigen.back.pysim import Simulator, Delay
class Pulse(Elaboratable):
def __init__(self,
frequency: float,
clock_frequency: typing.Optional[float],
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage: $0 <depfile> <command...>" >&2
exit 1
fi
# The .d file we're going to write.
DEPSFILE=$1
shift
@ianloic
ianloic / Makefile
Created September 7, 2019 03:47
fontconfig is easy
CFLAGS=$(shell pkg-config --cflags fontconfig)
LDFLAGS=$(shell pkg-config --libs fontconfig)
example: example.o
@ianloic
ianloic / error.html
Created February 26, 2019 17:35
error.html
<html>
<head>
<title>No Tunnel</title>
</head>
<body>
<h1>No Tunnel</h1>
<p>There is no tunnel configured for <i><script>document.write(location.host)</script></i>...</p>
<p>Create a tunnel with:
<code>
@ianloic
ianloic / crashypants.cc
Last active March 3, 2020 07:57
Why is this wrong?
#include <iostream>
#include <string>
#include <vector>
void test_string_vector() {
std::vector<std::string> v;
const char* one = v.emplace_back("one").data();
std::cout << "added one" << std::endl;
std::cout << "v.capacity() = " << v.capacity() << std::endl;