Skip to content

Instantly share code, notes, and snippets.

View raymanfx's full-sized avatar
🚀
Paving the way

Christopher N. Hesse raymanfx

🚀
Paving the way
  • BlackBerry QNX
  • Germany
View GitHub Profile
use eye::prelude::*;
use minifb::{Window, WindowOptions};
use std::{io, time};
fn main() -> io::Result<()> {
// Query for available devices.
let devices = Context::enumerate_devices();
if devices.is_empty() {
return Err(io::Error::new(io::ErrorKind::Other, "No devices available"));
}
@raymanfx
raymanfx / gtk.rs
Created July 4, 2020 22:36
Eye GTK example
extern crate eye;
extern crate gdk_pixbuf;
extern crate glib;
extern crate gtk;
use std::thread;
use eye::hal::traits::Device;
use eye::prelude::*;
https://www.reddit.com/r/VFIO/comments/7n38lh/2nd_amd_gpu_also_usable_in_host/
@raymanfx
raymanfx / podman.sh
Created October 19, 2019 13:11
openSUSE
#/bin/sh
# package(s)
sudo zypper install -y podman
# create mappable user ranges
sudo touch /etc/sub{u,g}id
sudo usermod --add-subuids 10000-65536 $(whoami)
sudo usermod --add-subgids 10000-65536 $(whoami)
@raymanfx
raymanfx / Pantheon.txt
Last active July 5, 2019 08:15
Pantheon Desktop (Elementary OS DE) tweaks
# show elements in workspace overview on second monitor
# ref: https://elementaryos.stackexchange.com/questions/2732/workspaces-seem-to-only-apply-to-the-primary-display-is-this-a-feature-or-a-bug
gsettings set org.gnome.mutter workspaces-only-on-primary true
@raymanfx
raymanfx / fedora-setup
Created November 7, 2018 11:07
Fedora setup
#!/bin/bash
# zswap
# https://fedoraproject.org/wiki/Zswap
sudo -i
echo "add_drivers+=\"lz4 lz4_compress\"" | tee /etc/dracut.conf.d/lz4.conf
dracut --regenerate-all --force
# /etc/default/grub
GRUB_CMDLINE_LINUX=" ... zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4"
#!/usr/env python3
import os
import stat
import sys
def main():
argc = len(sys.argv)
import math
"""
k-means algorithm
"""
data_set = [[2, 2],
[2, 1],
[1, 1],
[0, 0],
@raymanfx
raymanfx / spotiblock.sh
Last active August 23, 2017 19:05
Spotify adblock host entries
#!/bin/bash
HOSTS_FILE="/etc/hosts"
# check if we are root
USER_ID=`id -u`
if [ "$USER_ID" != '0' ]; then
echo "This script must be run with root permissions, try again."
exit 1
fi
@raymanfx
raymanfx / decon_core-debug.patch
Last active March 20, 2017 17:55
Samsung Exynos 7 decon FB debug
diff --git a/drivers/video/exynos/decon/decon_core.c b/drivers/video/exynos/decon/decon_core.c
index 7f1e9f0e066a..e4327b24e4f9 100644
--- a/drivers/video/exynos/decon/decon_core.c
+++ b/drivers/video/exynos/decon/decon_core.c
@@ -2453,6 +2453,10 @@ static int decon_set_win_buffer(struct decon_device *decon, struct decon_win *wi
}
}
+ decon_err("GRALLOC_DEBUG: [win_no=%d] WIN_BUF_DUMP! SRC: x=%d, y=%d, w=%u, h=%u, f_w=%u, f_h=%u\n", win_no, win_config->src.x, win_config->dst.y, win_config->src.w, win_config->src.h, win_config->src.f_w, win_config->src.f_h);
+ decon_err("GRALLOC_DEBUG: [win_no=%d] WIN_BUF_DUMP! DST: x=%d, y=%d, w=%u, h=%u, f_w=%u, f_h=%u\n", win_no, win_config->dst.x, win_config->dst.y, win_config->dst.w, win_config->dst.h, win_config->dst.f_w, win_config->dst.f_h);