Skip to content

Instantly share code, notes, and snippets.

@paul-vd
paul-vd / readme.md
Last active June 2, 2024 07:36
GPU Passthrough Fedora
@andrebrait
andrebrait / keychron_linux.md
Last active June 26, 2024 03:35
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@mittorn
mittorn / dlstub.c
Last active July 26, 2023 04:06
Static linking helpers. Static-linked glibc tries to load current glibc version dynamically, this is to workaround this mess
// this prevents using glibc's dinamic linker features (which may cause failure)
// remove -ldl when linking it, this should remove static linking warning
// if you really need dlopen implementation that works in static binary,
// try https://github.com/mittorn/custom-linker or android bionic linker
void *dlopen( const char *n, int f )
{
return 0;
}
void *dlsym( void *l, const char *n )
{
@domenic
domenic / 0-github-actions.md
Last active May 26, 2024 07:43
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@maxleiko
maxleiko / org.kevoree.mm
Created January 16, 2015 09:47
Kevoree MM v6 proposal
//KMF_VERSION=4.8.1
//VERSION=6.0.0-SNAPSHOT
class org.kevoree.Model {
@contained
nodes : org.kevoree.Node[0,*]
@contained
channels : org.kevoree.Channel[0,*]
@contained
groups : org.kevoree.Group[0,*]
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing
@willurd
willurd / web-servers.md
Last active June 30, 2024 03:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mopemope
mopemope / dynamicbloom.c
Created July 11, 2011 03:28
Dynamic Bloom Filter
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <inttypes.h>
#include <math.h>
typedef struct {